mirror of
https://github.com/ZDoom/Raze.git
synced 2025-06-02 18:21:06 +00:00
- use explicitly declared matrix uniforms.
The builtin matrices are no longer available in modern GLSL, preventing an upgrade of the shader. Also perform better reporting of shader compilation errors.
This commit is contained in:
parent
8fd8d0858c
commit
71d132b470
9 changed files with 56 additions and 46 deletions
|
@ -99,8 +99,8 @@ bool FShader::Load(const char * name, const char * vert_prog, const char * frag_
|
|||
if (linked == 0)
|
||||
{
|
||||
// only print message if there's an error.
|
||||
initprintf("Init Shader '%s':\n%s\n", name, error.GetChars());
|
||||
return false;
|
||||
FStringf err("Init Shader '%s':\n%s\n", name, error.GetChars());
|
||||
throw std::runtime_error(err); // Failing to compile a shader is fatal.
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -158,6 +158,11 @@ bool PolymostShader::Load(const char * name, const char * vert_prog, const char
|
|||
NPOTEmulationXOffset.Init(hShader, "u_npotEmulationXOffset");
|
||||
Brightness.Init(hShader, "u_brightness");
|
||||
RotMatrix.Init(hShader, "u_rotMatrix");
|
||||
ModelMatrix.Init(hShader, "u_modelMatrix");
|
||||
ProjectionMatrix.Init(hShader, "u_projectionMatrix");
|
||||
DetailMatrix.Init(hShader, "u_detailMatrix");
|
||||
GlowMatrix.Init(hShader, "u_glowMatrix");
|
||||
|
||||
ShadeInterpolate.Init(hShader, "u_shadeInterpolate");
|
||||
|
||||
glUseProgram(hShader);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue