mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-14 00:10:46 +00:00
33a540806e
Added $reflection texture map for (water) shaders. Just renders the screen to an fbo before rendering the surface. hub/savegame fixes. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4034 fc73d0e0-1445-4013-8a0c-d673dee63da5
22 lines
562 B
GLSL
22 lines
562 B
GLSL
//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
|
|
uniform sampler2D s_t0;
|
|
uniform sampler3D s_t1;
|
|
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
|