THREE-CustomShaderMaterial
THREE-CustomShaderMaterial copied to clipboard
Cannot use both csm_DiffuseColor and csm_FragColor in if/else
When in opaque mode, my shader uses diffuse color to allow there to be lighting on the mesh. When not in opaque mode, my shader forms a neon overlay. But using both, even in an exclusive if/else statement, doesn't work. Heck, even commenting "// csm_FragColor" anywhere breaks the code.
uniform bool opaque;
void main() {
if (opaque) {
csm_DiffuseColor = vec4(1.0);
else {
csm_FragColor = vec4(1.0, 0.0, 0.0, 0.5);
}
}