Files
bgfx/examples/53-sky2/sky2_common.sh
T
Matthew 527397d502 Atmospheric sky example v1 (#3861)
* Implemented terrain heightmap loading.

* Textured the terrain in sky2.

* Atmosphere implementation.

* Terrain lit, aerial perspective implemented.

* Shadow mapping for the terrain.

* Implemented hex-tiling.

im tired

* Cleanup

* Fixed OpenGL sampler issue.

* Brought back overridden shaders.
2026-08-02 02:29:51 +00:00

20 lines
447 B
Bash

#ifndef SKY2_COMMON_SH
#define SKY2_COMMON_SH
/*
* Copyright 2026 Mateusz Kozdrowicki. All rights reserved.
* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define SKY2_EXPOSURE 1.6
// ACES filmic Narkowicz 2015 fit.
vec3 sky2_tonemap(vec3 color) {
color *= SKY2_EXPOSURE;
vec3 num = color * (2.51 * color + 0.03);
vec3 den = color * (2.43 * color + 0.59) + 0.14;
return saturate(num / den);
}
#endif // SKY2_COMMON_SH