mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-02-22 19:31:17 +00:00
Limit the number of light rendered to the maximum set per surface
This commit is contained in:
parent
e17be2d135
commit
7252f9c3f1
3 changed files with 13 additions and 5 deletions
|
@ -110,6 +110,17 @@ bool FGLRenderState::ApplyShader()
|
|||
subLights = (int(lightPtr[2]) - int(lightPtr[1])) / LIGHT_VEC4_NUM;
|
||||
addLights = (int(lightPtr[3]) - int(lightPtr[2])) / LIGHT_VEC4_NUM;
|
||||
|
||||
// Here we limit the number of lights, but dont' change the light data so priority has to be mod, sub then add
|
||||
if (modLights > gles.maxlights)
|
||||
modLights = gles.maxlights;
|
||||
|
||||
if (modLights + subLights > gles.maxlights)
|
||||
subLights = gles.maxlights - modLights;
|
||||
|
||||
if (modLights + subLights + addLights > gles.maxlights)
|
||||
addLights = gles.maxlights - modLights - subLights;
|
||||
|
||||
|
||||
// Skip passed the first 4 floats so the upload below only contains light data
|
||||
lightPtr += 4;
|
||||
}
|
||||
|
|
|
@ -169,15 +169,13 @@ namespace OpenGLESRenderer
|
|||
gles.depthStencilAvailable = CheckExtension("GL_OES_packed_depth_stencil");
|
||||
gles.npotAvailable = CheckExtension("GL_OES_texture_npot");
|
||||
|
||||
gles.maxuniforms = 1024 * 16;
|
||||
gles.max_texturesize = 1024 * 4;
|
||||
gles.max_texturesize = 1024 * 2;
|
||||
#else
|
||||
gles.depthStencilAvailable = true;
|
||||
gles.npotAvailable = true;
|
||||
gles.useMappedBuffers = true;
|
||||
|
||||
gles.maxuniforms = 1024 * 16;
|
||||
gles.max_texturesize = 1024 * 4;
|
||||
gles.max_texturesize = 1024 * 2;
|
||||
#endif
|
||||
|
||||
gles.numlightvectors = (gles.maxlights * LIGHT_VEC4_NUM);
|
||||
|
|
|
@ -63,7 +63,6 @@ namespace OpenGLESRenderer
|
|||
struct RenderContextGLES
|
||||
{
|
||||
unsigned int flags;
|
||||
unsigned int maxuniforms;
|
||||
unsigned int maxlights;
|
||||
unsigned int numlightvectors;
|
||||
bool useMappedBuffers;
|
||||
|
|
Loading…
Reference in a new issue