Calculation of transparency in lighting shaders is determined exclusively by diffuse component.

This commit is contained in:
codeanticode
2012-04-21 17:22:36 +00:00
parent c27171555d
commit bf31211257
2 changed files with 10 additions and 8 deletions

View File

@@ -130,11 +130,12 @@ void main() {
}
}
// Calculating final color as result of all lights (plus emissive term)
vertColor = vec4(totalAmbient, 1) * inAmbient +
// Calculating final color as result of all lights (plus emissive term).
// Transparency is determined exclusively by the diffuse component.
vertColor = vec4(totalAmbient, 0) * inAmbient +
vec4(totalDiffuse, 1) * inColor +
vec4(totalSpecular, 1) * inSpecular +
inEmissive;
vec4(totalSpecular, 0) * inSpecular +
vec4(inEmissive.rgb, 0);
// Calculating texture coordinates, with r and q set both to one
vertTexcoord = texcoordMatrix * vec4(inTexcoord, 1.0, 1.0);

View File

@@ -128,9 +128,10 @@ void main() {
}
// Calculating final color as result of all lights (plus emissive term)
vertColor = vec4(totalAmbient, 1) * inAmbient +
// Calculating final color as result of all lights (plus emissive term).
// Transparency is determined exclusively by the diffuse component.
vertColor = vec4(totalAmbient, 0) * inAmbient +
vec4(totalDiffuse, 1) * inColor +
vec4(totalSpecular, 1) * inSpecular +
inEmissive;
vec4(totalSpecular, 0) * inSpecular +
vec4(inEmissive.rgb, 0);
}