Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

501 B
Raw Blame
#pragma shader "GeneratedOnMesh"
#pragma version 300 es
#pragma domain Lit
#pragma param u_tint color default(0,1,0,1)

// Fragment only and no hand-written twin, drawn on a mesh: the WGSL twin is
// generated, and the halves prove it reads the varyings where the mesh wrote them.
#pragma fragment
precision mediump float;

in vec4 v_color;
in vec2 v_texCoord;

out vec4 fragColor;

void main() {
    fragColor = vec4(mix(vec3(1.0, 0.0, 0.0), u_tint.rgb, step(0.5, v_texCoord.x)), 1.0);
}
#pragma end