mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-09 02:42:19 +02:00
Merge pull request #15634 from SamGondelman/skyboxColor
BUGZ-380: Revert skybox color behavior
This commit is contained in:
commit
bd3881ef14
1 changed files with 10 additions and 2 deletions
|
@ -26,6 +26,14 @@ layout(location=0) in vec3 _normal;
|
|||
layout(location=0) out vec4 _fragColor;
|
||||
|
||||
void main(void) {
|
||||
vec3 skyboxColor = texture(cubeMap, normalize(_normal)).rgb;
|
||||
_fragColor = vec4(mix(skybox.color.rgb, skyboxColor, skybox.color.a), 1.0);
|
||||
// FIXME: For legacy reasons, when skybox.color.a is 0.5, this is equivalent to:
|
||||
// skyboxColor * skyboxTexel
|
||||
// It should actually be:
|
||||
// mix(skyboxColor, skyboxTexel, skybox.color.a)
|
||||
// and the blend factor should be user controlled
|
||||
|
||||
vec3 skyboxTexel = texture(cubeMap, normalize(_normal)).rgb;
|
||||
vec3 skyboxColor = skybox.color.rgb;
|
||||
_fragColor = vec4(mix(vec3(1.0), skyboxTexel, float(skybox.color.a > 0.0)) *
|
||||
mix(vec3(1.0), skyboxColor, float(skybox.color.a < 1.0)), 1.0);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue