Tag Info

New answers tagged


replace your whole if-statement with this: float vstep = step( u_bgColor.r, texColor.r); texColor.a = mix(0.1, u_lightIntensity/10.0, vstep); mix will select either the 1st argument of the mix if vstep == 0, or the 2nd otherwise (which is vstep == 1)


screenPosition is not at the right scale for texture coordinate lookup. Texture2D::Sample expects texture coordinates (0..1) while Texture2D::Load expects texel coordinates (0..[Width or Height]-1). So you're probably sampling way off the edge of the texture and either hitting the border color, or clamping to the edge which happens to be black. As a ...

Top 50 recent answers are included