mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
When alpha mask is off, don't write to stencil if stencil is off (as
alpha and stencil are shared on the PSP, when neither are on nothing should be written to the stencil channel). thanks unknown.
This commit is contained in:
parent
676c000b8a
commit
fbe8a19143
1 changed files with 8 additions and 4 deletions
|
@ -126,7 +126,7 @@ void TransformDrawEngine::ApplyDrawState(int prim) {
|
|||
// Set cull
|
||||
bool wantCull = !gstate.isModeClear() && !gstate.isModeThrough() && prim != GE_PRIM_RECTANGLES && gstate.isCullEnabled();
|
||||
glstate.cullFace.set(wantCull);
|
||||
if (wantCull)
|
||||
if (wantCull)
|
||||
glstate.cullFaceMode.set(cullingMode[gstate.getCullMode()]);
|
||||
|
||||
// TODO: The top bit of the alpha channel should be written to the stencil bit somehow. This appears to require very expensive multipass rendering :( Alternatively, one could do a
|
||||
|
@ -234,9 +234,13 @@ void TransformDrawEngine::ApplyDrawState(int prim) {
|
|||
glstate.colorMask.set(colorMask, colorMask, colorMask, alphaMask);
|
||||
|
||||
// Stencil Test
|
||||
glstate.stencilTest.enable();
|
||||
glstate.stencilOp.set(GL_REPLACE, GL_REPLACE, GL_REPLACE);
|
||||
glstate.stencilFunc.set(GL_ALWAYS, 0, 0xFF);
|
||||
if (alphaMask) {
|
||||
glstate.stencilTest.enable();
|
||||
glstate.stencilOp.set(GL_REPLACE, GL_REPLACE, GL_REPLACE);
|
||||
glstate.stencilFunc.set(GL_ALWAYS, 0, 0xFF);
|
||||
} else {
|
||||
glstate.stencilTest.disable();
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue