Expose water ripple as a uniform to allow for water ripple shaders
This commit is contained in:
parent
d06ffdd9af
commit
0c8d2efce0
1 changed files with 6 additions and 0 deletions
|
|
@ -656,6 +656,8 @@ typedef enum
|
|||
|
||||
gluniform_scr_resolution,
|
||||
|
||||
gluniform_water_ripple,
|
||||
|
||||
gluniform_max,
|
||||
} gluniform_t;
|
||||
|
||||
|
|
@ -1943,6 +1945,8 @@ static void Shader_SetUniforms(FSurfaceInfo *Surface, GLRGBAFloat *poly, GLRGBAF
|
|||
|
||||
UNIFORM_2(shader->uniforms[gluniform_scr_resolution], (GLfloat)vid.width, (GLfloat)vid.height, pglUniform2f);
|
||||
|
||||
UNIFORM_1(shader->uniforms[gluniform_water_ripple], !!(Surface && (Surface->PolyFlags & PF_Ripple)), pglUniform1f);
|
||||
|
||||
#undef UNIFORM_1
|
||||
#undef UNIFORM_2
|
||||
#undef UNIFORM_3
|
||||
|
|
@ -2079,6 +2083,8 @@ static boolean Shader_CompileProgram(gl_shader_t *shader, GLint i)
|
|||
// misc. (custom shaders)
|
||||
shader->uniforms[gluniform_leveltime] = GETUNI("leveltime");
|
||||
|
||||
shader->uniforms[gluniform_water_ripple] = GETUNI("water_ripple");
|
||||
|
||||
#undef GETUNI
|
||||
|
||||
// set permanent uniform values
|
||||
|
|
|
|||
Loading…
Reference in a new issue