I'm using Gile[s] as my lightmapper and my engine can execute GLSL/HLSL scripts.

I would like to accomplish something like this for performance reasons. I was told that this technique can only be done by shaders.

Lightmap and Shadow Blending

Someone has provided me with a quick code example and starting code but it is still far from being implemented.

colorIntensity = (lightmapColor.r+lightmapColor.g+lightmapColor.b)/3.0;
lightCol = (1-colorIntensity)*ambient+(colorIntensity)*lightmapColor;

Not sure if it is applicable in my engine so I am looking for some guidance and perhaps some basic hlsl code to accomplish this. My lightmap texture uses the UV2 Channel if it helps. Thanks.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.