Don't apply fog to alpha channel

--HG--
branch : opengl3
hg/feature/opengl3
kaetemi 10 years ago
parent 3a2f04bfb5
commit a2f5ed0037

@ -552,6 +552,7 @@ void ppGenerate(std::string &result, const CPPBuiltin &desc, CGlExtensions &glex
ss << "float fogFactor = (fogParams.t - z) / (fogParams.t - fogParams.s);" << std::endl; ss << "float fogFactor = (fogParams.t - z) / (fogParams.t - fogParams.s);" << std::endl;
ss << "fogFactor = clamp(fogFactor, 0.0, 1.0);" << std::endl; ss << "fogFactor = clamp(fogFactor, 0.0, 1.0);" << std::endl;
ss << "vec4 fColor = mix(fogColor, col, fogFactor);" << std::endl; ss << "vec4 fColor = mix(fogColor, col, fogFactor);" << std::endl;
ss << "fColor.a = col.a;" << std::endl;
ss << "return fColor;" << std::endl; ss << "return fColor;" << std::endl;
ss << "}" << std::endl; ss << "}" << std::endl;
ss << std::endl; ss << std::endl;

Loading…
Cancel
Save