mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2024-11-15 05:47:43 -07:00
finish fixing shadows
This commit is contained in:
parent
182e123598
commit
04f1809dd1
@ -594,6 +594,8 @@ void RenderSceneChunk(int y, int h)
|
|||||||
{
|
{
|
||||||
RendererPolygon* rp = &PolygonList[i];
|
RendererPolygon* rp = &PolygonList[i];
|
||||||
|
|
||||||
|
if (rp->PolyData->IsShadowMask) { i++; continue; }
|
||||||
|
|
||||||
// zorp
|
// zorp
|
||||||
glDepthFunc(GL_LESS);
|
glDepthFunc(GL_LESS);
|
||||||
|
|
||||||
@ -627,11 +629,6 @@ void RenderSceneChunk(int y, int h)
|
|||||||
|
|
||||||
if (rp->PolyData->IsShadowMask)
|
if (rp->PolyData->IsShadowMask)
|
||||||
{
|
{
|
||||||
// clear shadow bits in stencil buffer
|
|
||||||
|
|
||||||
glStencilMask(0x80);
|
|
||||||
glClear(GL_STENCIL_BUFFER_BIT);
|
|
||||||
|
|
||||||
// draw actual shadow mask
|
// draw actual shadow mask
|
||||||
|
|
||||||
UseRenderShader(flags | RenderFlag_ShadowMask);
|
UseRenderShader(flags | RenderFlag_ShadowMask);
|
||||||
@ -642,7 +639,7 @@ void RenderSceneChunk(int y, int h)
|
|||||||
glDepthMask(GL_FALSE);
|
glDepthMask(GL_FALSE);
|
||||||
|
|
||||||
glDepthFunc(GL_LESS);
|
glDepthFunc(GL_LESS);
|
||||||
glStencilFunc(GL_EQUAL, 0xFF, 0xFE);
|
glStencilFunc(GL_EQUAL, 0xFF, 0xFF);
|
||||||
glStencilOp(GL_KEEP, GL_INVERT, GL_KEEP);
|
glStencilOp(GL_KEEP, GL_INVERT, GL_KEEP);
|
||||||
glStencilMask(0x01);
|
glStencilMask(0x01);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user