Add capability to use model lighting with shaders enabled
The OpenGL API does not allow usage of fixed-function lighting and shaders at the same time, so using model lighting and shaders simultaneously in SRB2 was not possible. This patch fixes that by implementing a shader that replicates the model lighting functionality. This shader is used when model lighting and shaders are both enabled.
-
added 1 commit
- 92ebbdfc - Don't override custom shaders with model lighting shader
Toggle commit list -
unmarked as a Work In Progress
Toggle commit list -
changed the description
Toggle commit list -
Should be finished now.
-
1063 1106 #ifdef GL_SHADERS 1064 1107 if (gl_allowshaders) 1065 1108 { 1109 // If using model lighting, set the appropriate shader. 1110 // However don't override a custom shader. 1111 // Should use an enum or something... 1112 if (shader == 4 && model_lighting && !gl_shaderprograms[4].custom) 1113 shader = 8; -
Does this imply that an add-on shader can't tweak the lighting of a model/override shader 8 if shader 4 is also overriden by an add-on?
-
Basically the model lighting option will stop doing anything if the model shader is changed by a mod. Customizing the lighting version of the model shader is not possible unless it's added to the modding API/specs.
-
-
-
merged
Toggle commit list