
So, I decided to try to use a pre processed texture to store my ignore colors in and pass that to the shader to use as a lookup table instead of looping through an array in the shader. If I found a match, just return the sampled drawing texture color, else add the lighting texture color at the same location to it.Īfter upgrading to XNA 4.0 the shader would no longer compile. Originaly I hardcoded these specific ignore colors as a large int3 array inside the shader itself, and for each pixel, sampled the drawing texture, multiplied it by 255, and rounded those, and compared the results to each color in the int3 array. Now I have around 120 specific RGB values that I want the shader to ignore and not add the lighting color to it, just return the input color.

This contains a greyscale pre lit texture that I just use additive blending with the given texture to add basic lighting. What I need to do is pass a light texture to the shader. This is all 2D, using shader model 3.0, HLSL, using XNA 4.0 framework in C#, and SpriteBatch for drawing. I originally had some shaders written that worked for XNA 3.1, but after converting to XNA 4.0 they would no longer compile due to instruction counts, flow control issues, etc and I cannot get a rewritten version to work. I am stuck on trying to solve this problem.
