Improved emission map effect

Former-commit-id: 44b8332a05d87175edd5e2e5f831c4b7f6b33f25
This commit is contained in:
Lynix 2013-05-21 13:54:50 +02:00
parent 864fcc639c
commit d3986d40cd
1 changed files with 2 additions and 2 deletions

View File

@ -291,8 +291,8 @@ namespace
if (flags & nzShaderFlags_EmissiveMapping)
{
sourceCode += "vec3 emission = vec3(" + textureLookupKW + "(MaterialEmissiveMap, vTexCoord));\n"
+ fragmentColorKW + " = vec4(mix(lighting, emission, length(emission)), alpha);\n";
///NOTE: Pour un shader avec un coût réduit avec une qualité moyenne, il est possible de remplacer "length(emission)" par "dot(emission, emission)"
+ fragmentColorKW + " = vec4(mix(lighting, emission, max(0.0, 1.0-length(light))), alpha);\n";
///NOTE: Pour un shader avec un coût réduit avec une qualité moyenne, il est possible de remplacer "length(light)" par "dot(light, light)"
}
else
sourceCode += fragmentColorKW + " = vec4(lighting, alpha);\n";