mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-09 16:52:12 +02:00
revert skybox color behavior
This commit is contained in:
parent
2bf95fe683
commit
61280214ca
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