Renderer/OpenGL: Apply swizzle on depth formats
Too much red when debugging shadow maps Former-commit-id: 4445429fcae3208912fd509097403f3293a2ec7e
This commit is contained in:
parent
52972b0514
commit
39779c059d
|
|
@ -1803,24 +1803,44 @@ bool NzOpenGL::TranslateFormat(nzPixelFormat pixelFormat, Format* format, Format
|
||||||
format->dataFormat = GL_DEPTH_COMPONENT;
|
format->dataFormat = GL_DEPTH_COMPONENT;
|
||||||
format->dataType = GL_UNSIGNED_SHORT;
|
format->dataType = GL_UNSIGNED_SHORT;
|
||||||
format->internalFormat = GL_DEPTH_COMPONENT16;
|
format->internalFormat = GL_DEPTH_COMPONENT16;
|
||||||
|
|
||||||
|
format->swizzle[0] = GL_RED;
|
||||||
|
format->swizzle[1] = GL_RED;
|
||||||
|
format->swizzle[2] = GL_RED;
|
||||||
|
format->swizzle[3] = GL_ONE;
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case nzPixelFormat_Depth24:
|
case nzPixelFormat_Depth24:
|
||||||
format->dataFormat = GL_DEPTH_COMPONENT;
|
format->dataFormat = GL_DEPTH_COMPONENT;
|
||||||
format->dataType = GL_UNSIGNED_INT;
|
format->dataType = GL_UNSIGNED_INT;
|
||||||
format->internalFormat = GL_DEPTH_COMPONENT24;
|
format->internalFormat = GL_DEPTH_COMPONENT24;
|
||||||
|
|
||||||
|
format->swizzle[0] = GL_RED;
|
||||||
|
format->swizzle[1] = GL_RED;
|
||||||
|
format->swizzle[2] = GL_RED;
|
||||||
|
format->swizzle[3] = GL_ONE;
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case nzPixelFormat_Depth24Stencil8:
|
case nzPixelFormat_Depth24Stencil8:
|
||||||
format->dataFormat = GL_DEPTH_STENCIL;
|
format->dataFormat = GL_DEPTH_STENCIL;
|
||||||
format->dataType = GL_UNSIGNED_INT_24_8;
|
format->dataType = GL_UNSIGNED_INT_24_8;
|
||||||
format->internalFormat = GL_DEPTH24_STENCIL8;
|
format->internalFormat = GL_DEPTH24_STENCIL8;
|
||||||
|
|
||||||
|
format->swizzle[0] = GL_RED;
|
||||||
|
format->swizzle[1] = GL_RED;
|
||||||
|
format->swizzle[2] = GL_RED;
|
||||||
|
format->swizzle[3] = GL_GREEN;
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case nzPixelFormat_Depth32:
|
case nzPixelFormat_Depth32:
|
||||||
format->dataFormat = GL_DEPTH_COMPONENT;
|
format->dataFormat = GL_DEPTH_COMPONENT;
|
||||||
format->dataType = GL_UNSIGNED_BYTE;
|
format->dataType = GL_UNSIGNED_BYTE;
|
||||||
format->internalFormat = GL_DEPTH_COMPONENT32;
|
format->internalFormat = GL_DEPTH_COMPONENT32;
|
||||||
|
|
||||||
|
format->swizzle[0] = GL_RED;
|
||||||
|
format->swizzle[1] = GL_RED;
|
||||||
|
format->swizzle[2] = GL_RED;
|
||||||
|
format->swizzle[3] = GL_ONE;
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case nzPixelFormat_Stencil1:
|
case nzPixelFormat_Stencil1:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue