mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
Fix the behavior when skybox color is black and skymap is available
This commit is contained in:
parent
d3d4775232
commit
69c4075439
2 changed files with 7 additions and 1 deletions
|
@ -50,6 +50,10 @@ void Skybox::updateDataBuffer() const {
|
|||
auto blend = 0.0f;
|
||||
if (getCubemap() && getCubemap()->isDefined()) {
|
||||
blend = 1.0f;
|
||||
// If pitch black neutralize the color
|
||||
if (glm::all(glm::equal(getColor(), glm::vec3(0.0f)))) {
|
||||
blend = 2.0f;
|
||||
}
|
||||
}
|
||||
|
||||
if (blend != _dataBuffer.get<Data>()._blend) {
|
||||
|
|
|
@ -45,7 +45,9 @@ void main(void) {
|
|||
vec3 color = _skybox._color.rgb;
|
||||
if (_skybox._color.a > 0.0) {
|
||||
vec3 texel = texture(cubeMap, coord).rgb;
|
||||
color *= texel;
|
||||
if (_skybox._color.a < 2.0) {
|
||||
color *= texel;
|
||||
}
|
||||
}
|
||||
|
||||
vec3 pixel = pow(color, vec3(1.0/2.2)); // manual Gamma correction
|
||||
|
|
Loading…
Reference in a new issue