I then used the "color neutral" texture found on the UDN here: http://udn.epicgames...lorGrading.html
I made sure to convert the color neautral texture from 2D to 3D, so 256x16 => 16x16x16.
Here is my shader code for sampling the texture:
[source lang="cpp"]half4 outColor;half4 inColor = tex2D(colorMap, inUV);half3 lutSize = half3(16.0h, 16.0h, 16.h);half3 scale = (lutSize - 1.0h) / lutSize;half3 offset = 1.0h / (2.0h * lutSize);outColor.rgb = tex3D(LUTSampler, scale * inColor.rgb + offset);outColor.a = 1.0h;return outColor;[/source]
My results are totally weird, for example everything is either bright green and pink. I am assuming either the "color neutral" texture I am using from Epic's website isnt neatral OR I am doing something wrong. If my code is correct does anyone know how I could generate a color neutral 3D lut?
Also, I converted the 2D image to 3D by writing a little tool that would write each 16 wide section of the original texture into a new slice of the volume texture. I checked each slice manually in the d3d texture tool and it was correct. I thought maybe the slice order was wrong but that didnt change anything except make it all red and black instead of pink and green. It's almost as if it only samples from the bottom slice...
I've attached a screen shot, ignore the vignette...
Edited by thedigga007, 26 July 2012 - 09:24 PM.