summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/examples/18-ibl/fs_ibl_skybox.sc
blob: 790fc0144fcbd42ce55b65f2719a6324655a00f4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
$input v_dir

/*
 * Copyright 2014 Dario Manesku. All rights reserved.
 * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
 */

#include "../common/common.sh"

SAMPLERCUBE(s_texCube, 0);

uniform vec4 u_params;
#define u_exposure  u_params.y

void main()
{
	vec3 dir = normalize(v_dir);

	vec4 color = textureCubeLod(s_texCube, dir, 0.0);
	color *= exp2(u_exposure);

	gl_FragColor = toFilmic(color);
}