mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Correct alpha in stencil upload, avoid blending.
Docs say blending is slower than masking, makes sense.
This commit is contained in:
parent
71a6a4ba04
commit
c79d0a2e3c
1 changed files with 2 additions and 4 deletions
|
@ -32,7 +32,7 @@ static const char *stencil_fs =
|
|||
"float roundAndScaleTo255f(in float x) { return floor(x * 255.99); }\n"
|
||||
"void main() {\n"
|
||||
" vec4 index = texture2D(tex, v_texcoord0);\n"
|
||||
" gl_FragColor = vec4(1.0);\n"
|
||||
" gl_FragColor = vec4(u_stencilValue);\n"
|
||||
" float shifted = roundAndScaleTo255f(index.a) / roundAndScaleTo255f(u_stencilValue);\n"
|
||||
" if (mod(floor(shifted), 2.0) < 0.99) discard;\n"
|
||||
"}\n";
|
||||
|
@ -90,9 +90,7 @@ bool FramebufferManager::NotifyStencilUpload(u32 addr, int size) {
|
|||
|
||||
MakePixelTexture(Memory::GetPointer(addr), dstBuffer->format, dstBuffer->fb_stride, dstBuffer->width, dstBuffer->height);
|
||||
DisableState();
|
||||
glstate.blend.set(true);
|
||||
glstate.blendEquation.set(GL_FUNC_ADD);
|
||||
glstate.blendFuncSeparate.set(GL_ZERO, GL_ONE, GL_ONE, GL_ZERO);
|
||||
glstate.colorMask.set(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE);
|
||||
glstate.stencilTest.enable();
|
||||
glstate.stencilOp.set(GL_REPLACE, GL_REPLACE, GL_REPLACE);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue