2018-11-27 16:48:19 +00:00
|
|
|
!!samps 2
|
2012-05-09 15:30:53 +00:00
|
|
|
//this glsl shader is useful for cubemapped post processing effects (see csaddon for an example)
|
|
|
|
varying vec4 tf;
|
|
|
|
#ifdef VERTEX_SHADER
|
|
|
|
void main ()
|
|
|
|
{
|
|
|
|
gl_Position = tf = vec4(v_position.xy,-1.0, 1.0);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#ifdef FRAGMENT_SHADER
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
vec2 fc;
|
|
|
|
fc = tf.xy / tf.w;
|
|
|
|
vec3 raw = texture2D(s_t0, (1.0 + fc) / 2.0).rgb;
|
|
|
|
#define LUTSIZE 16.0
|
|
|
|
vec3 scale = vec3((LUTSIZE-1.0)/LUTSIZE);
|
|
|
|
vec3 bias = vec3(1.0/(2.0*LUTSIZE));
|
|
|
|
gl_FragColor = texture3D(s_t1, raw * scale + bias);
|
|
|
|
}
|
|
|
|
#endif
|