Linear Space Lighting: Normal Maps Loaded at Runtime

Hello,

I just switched my project to Linear Space Lighting and encountered an issue with the normal maps I’m loading at runtime. The known workaround for normalmaps when loaded with the WWW class is the following:

Color32[] colors = texture.GetPixels32();
byte r, g, b, a;
for (int i = colors.Length-1; i >= 0; i--)
{
    Color32 c = colors[i];
    r = g = b = c.g;
    a = c.r;
    colors[i] = new Color32(r, g, b, a);
}
texture.SetPixels32(colors);

However, these normal maps don’t work with Linear Space Lighting and cause rather strange looking bugs, most certainly caused by offset RGBA values of the loaded normal map. Has anyone used runtime loaded normal maps with Linear Space Lighting before?

Really late reply, but while investigating my own bug i came accross this unanswered question. For future reference: I think the solution to your problem is to set linear to true when you create the normal map texture to be used with linear-space lighting.