]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_backend.c
don't set r_hdr in the menu presets for lighting quality, the cvar has
[xonotic/darkplaces.git] / gl_backend.c
index 2f14c54a4c8ec76684c433d79926030003dce7e2..e523107055864d0dfdaf58028e69abce72950bda 100644 (file)
@@ -706,8 +706,6 @@ qboolean R_ScissorForBBox(const float *mins, const float *maxs, int *scissor)
        if (BoxesOverlap(r_refdef.view.origin, r_refdef.view.origin, mins, maxs))
                return false;
 
-       x1 = y1 = x2 = y2 = 0;
-
        // transform all corners that are infront of the nearclip plane
        VectorNegate(r_refdef.view.frustum[4].normal, plane4f);
        plane4f[3] = r_refdef.view.frustum[4].dist;
@@ -1266,7 +1264,12 @@ int R_Mesh_CreateFramebufferObject(rtexture_t *depthtexture, rtexture_t *colorte
                        qglGenFramebuffers(1, (GLuint*)&temp);CHECKGLERROR
                        R_Mesh_SetRenderTargets(temp, NULL, NULL, NULL, NULL, NULL);
                        // GL_ARB_framebuffer_object (GL3-class hardware) - depth stencil attachment
+#ifdef USE_GLES2
+                       // FIXME: separate stencil attachment on GLES
+                       if (depthtexture  && depthtexture->texnum ) qglFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT  , depthtexture->gltexturetypeenum , depthtexture->texnum , 0);CHECKGLERROR
+#else
                        if (depthtexture  && depthtexture->texnum ) qglFramebufferTexture2D(GL_FRAMEBUFFER, depthtexture->glisdepthstencil ? GL_DEPTH_STENCIL_ATTACHMENT : GL_DEPTH_ATTACHMENT  , depthtexture->gltexturetypeenum , depthtexture->texnum , 0);CHECKGLERROR
+#endif
                        if (depthtexture  && depthtexture->renderbuffernum ) qglFramebufferRenderbuffer(GL_FRAMEBUFFER, depthtexture->glisdepthstencil ? GL_DEPTH_STENCIL_ATTACHMENT : GL_DEPTH_ATTACHMENT  , GL_RENDERBUFFER, depthtexture->renderbuffernum );CHECKGLERROR
                        if (colortexture  && colortexture->texnum ) qglFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 , colortexture->gltexturetypeenum , colortexture->texnum , 0);CHECKGLERROR
                        if (colortexture2 && colortexture2->texnum) qglFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1 , colortexture2->gltexturetypeenum, colortexture2->texnum, 0);CHECKGLERROR
@@ -1277,6 +1280,7 @@ int R_Mesh_CreateFramebufferObject(rtexture_t *depthtexture, rtexture_t *colorte
                        if (colortexture3 && colortexture3->renderbuffernum) qglFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT2 , GL_RENDERBUFFER, colortexture3->renderbuffernum);CHECKGLERROR
                        if (colortexture4 && colortexture4->renderbuffernum) qglFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT3 , GL_RENDERBUFFER, colortexture4->renderbuffernum);CHECKGLERROR
 
+#ifndef USE_GLES2
                        if (colortexture4 && qglDrawBuffersARB)
                        {
                                qglDrawBuffersARB(4, drawbuffers);CHECKGLERROR
@@ -1302,6 +1306,7 @@ int R_Mesh_CreateFramebufferObject(rtexture_t *depthtexture, rtexture_t *colorte
                                qglDrawBuffer(GL_NONE);CHECKGLERROR
                                qglReadBuffer(GL_NONE);CHECKGLERROR
                        }
+#endif
                        status = qglCheckFramebufferStatus(GL_FRAMEBUFFER);CHECKGLERROR
                        if (status != GL_FRAMEBUFFER_COMPLETE)
                        {
@@ -1329,6 +1334,7 @@ int R_Mesh_CreateFramebufferObject(rtexture_t *depthtexture, rtexture_t *colorte
                        if (colortexture3 && colortexture3->renderbuffernum) qglFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT2 , GL_RENDERBUFFER, colortexture3->renderbuffernum);CHECKGLERROR
                        if (colortexture4 && colortexture4->renderbuffernum) qglFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT3 , GL_RENDERBUFFER, colortexture4->renderbuffernum);CHECKGLERROR
 
+#ifndef USE_GLES2
                        if (colortexture4 && qglDrawBuffersARB)
                        {
                                qglDrawBuffersARB(4, drawbuffers);CHECKGLERROR
@@ -1354,6 +1360,7 @@ int R_Mesh_CreateFramebufferObject(rtexture_t *depthtexture, rtexture_t *colorte
                                qglDrawBuffer(GL_NONE);CHECKGLERROR
                                qglReadBuffer(GL_NONE);CHECKGLERROR
                        }
+#endif
                        status = qglCheckFramebufferStatus(GL_FRAMEBUFFER);CHECKGLERROR
                        if (status != GL_FRAMEBUFFER_COMPLETE)
                        {
@@ -2630,14 +2637,14 @@ static qboolean GL_Backend_CompileShader(int programobject, GLenum shadertypeenu
        qglCompileShader(shaderobject);CHECKGLERROR
        qglGetShaderiv(shaderobject, GL_COMPILE_STATUS, &shadercompiled);CHECKGLERROR
        qglGetShaderInfoLog(shaderobject, sizeof(compilelog), NULL, compilelog);CHECKGLERROR
-       if (compilelog[0] && (strstr(compilelog, "error") || strstr(compilelog, "ERROR") || strstr(compilelog, "Error") || strstr(compilelog, "WARNING") || strstr(compilelog, "warning") || strstr(compilelog, "Warning") || developer_extra.integer))
+       if (compilelog[0] && ((strstr(compilelog, "error") || strstr(compilelog, "ERROR") || strstr(compilelog, "Error")) || ((strstr(compilelog, "WARNING") || strstr(compilelog, "warning") || strstr(compilelog, "Warning")) && developer.integer) || developer_extra.integer))
        {
                int i, j, pretextlines = 0;
                for (i = 0;i < numstrings - 1;i++)
                        for (j = 0;strings[i][j];j++)
                                if (strings[i][j] == '\n')
                                        pretextlines++;
-               Con_DPrintf("%s shader compile log:\n%s\n(line offset for any above warnings/errors: %i)\n", shadertype, compilelog, pretextlines);
+               Con_Printf("%s shader compile log:\n%s\n(line offset for any above warnings/errors: %i)\n", shadertype, compilelog, pretextlines);
        }
        if (!shadercompiled)
        {