Pattern/Mask issue

Well, to put those steps I described in a closer-to-code form, it would be:

P\_COLOR vec4 t1 = texture2D(CoronaSampler0, texCoord); P\_COLOR vec4 t2 = texture2D(CoronaSampler1, texCoord); t2 = CoronaColorScale(t2); if (t1.a \< .01) return vec4(0.); // Choose some small epsilon if (dot(t1.rgb, vec3(1.)) \< .01) return vec4(0.); // Ditto; dot() = the dot product if (t2.a \< .01) return t1; return t2;

It’s all off the cuff, but that’s the gist of it. The dot product is just to consolidate all three color components into one check, since checking them individually isn’t good enough: if the red part is 0, green could still be 1, for example.

By all means, pick away with questions.

I’m the same guy doing the shaders segments on Corona Geek, so if you have any (courteous!) criticism, I’d be glad to hear it, here or via PM. (This is an open call, actually.) There’s a decent chance I’ll follow these up with some written material, so it would be great to know where I’ve fallen short (if the honest answer is “everywhere”, that’s fine, but please explain!), or what would be more interesting to elaborate on. (Unfortunately, I’m not sure there’s any easy way to cover the first point I want to tackle on Monday!)