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.

706 B
Raw Blame
#pragma shader "BlockerMaterial"
#pragma version 300 es
#pragma domain Unlit

#pragma fragment
precision mediump float;

out vec4 fragColor;

// A constant, so the pixel says one thing only: the material ran, in the pass it
// belongs to. What it must NOT do is run in the shadow pass — an occluder there
// writes packed depth, and a material that reached it would write this red into
// the atlas instead (and sample the atlas it was writing, through the shadow
// sampler its mesh variant declares).
void main() {
    fragColor = vec4(1.0, 0.0, 0.0, 1.0);
}
#pragma end

#pragma fragment wgsl
@fragment fn fs_main(v : VSOut) -> @location(0) vec4f {
    return vec4f(1.0, 0.0, 0.0, 1.0);
}
#pragma end