mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-11-17 05:16:13 +00:00
* 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.
20 lines
447 B
Bash
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
|