2014-02-13 23:46:34 -05:00
|
|
|
$input v_dir
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright 2014 Dario Manesku. All rights reserved.
|
2016-01-01 03:11:04 -05:00
|
|
|
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
|
2014-02-13 23:46:34 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "../common/common.sh"
|
|
|
|
|
2015-06-06 20:12:29 -04:00
|
|
|
SAMPLERCUBE(s_texCube, 0);
|
2014-02-13 23:46:34 -05:00
|
|
|
|
|
|
|
uniform vec4 u_params;
|
|
|
|
#define u_exposure u_params.y
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
vec3 dir = normalize(v_dir);
|
|
|
|
|
2015-06-06 20:12:29 -04:00
|
|
|
vec4 color = textureCubeLod(s_texCube, dir, 0.0);
|
2014-02-13 23:46:34 -05:00
|
|
|
color *= exp2(u_exposure);
|
|
|
|
|
|
|
|
gl_FragColor = toFilmic(color);
|
|
|
|
}
|