Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use stenciltest for glblendFuncSeparate() #3387

Merged
merged 1 commit into from
Aug 26, 2013
Merged

Use stenciltest for glblendFuncSeparate() #3387

merged 1 commit into from
Aug 26, 2013

Conversation

dbz400
Copy link
Contributor

@dbz400 dbz400 commented Aug 25, 2013

Tested with Persona 2 , FF CC ,Tactic Orge and all seems to be fine with this change.

@thedax
Copy link
Collaborator

thedax commented Aug 25, 2013

With this as it is, it breaks Pangya's particle effects(they should be transparent, not a big blob of black):

Screenshot 01

It also breaks Half-Minute Hero's title screen again(shouldn't be grey):
Screenshot 02

What it should look like:
Screenshot 03
Screenshot 04
Screenshot 05
Screenshot 06

We really need to get some data from a real PSP. Could 3D Studio from JPCSP be of any use here?

@dbz400
Copy link
Contributor Author

dbz400 commented Aug 26, 2013

How about this ? Tested with FF CC , Persona 2 , Half Minute Hero and Tactic Orge

    if (gstate.isModeThrough() && !gstate.isStencilTestEnabled() && !gstate.isColorTestEnabled())
        glstate.blendFuncSeparate.set(glBlendFuncA, glBlendFuncB, GL_ZERO, GL_ONE);
    else if (!gstate.isModeThrough() && !gstate.isStencilTestEnabled() && !gstate.isColorTestEnabled()) 
        glstate.blendFuncSeparate.set(glBlendFuncA, glBlendFuncB, GL_ZERO, GL_ONE);
    else
        glstate.blendFuncSeparate.set(glBlendFuncA, glBlendFuncB, glBlendFuncA, glBlendFuncB);

@hrydgard
Copy link
Owner

That is equivalent to:

if (!gstate.isStencilTestEnabled() && !gstate.isColorTestEnabled())
    glstate.blendFuncSeparate.set(glBlendFuncA, glBlendFuncB, GL_ZERO, GL_ONE);
else
    glstate.blendFuncSeparate.set(glBlendFuncA, glBlendFuncB, glBlendFuncA, glBlendFuncB);

Color test seems like an odd thing to check for here...

@dbz400
Copy link
Contributor Author

dbz400 commented Aug 26, 2013

Without color test also okay to pass those games but not too sure Pangya Golf

I initially try different mode test to see what are their similarities.

@dbz400
Copy link
Contributor Author

dbz400 commented Aug 26, 2013

Just tested Pangya Golf also good .Rebased

@solarmystic
Copy link
Contributor

@raven02

I'll test this later if you want, but i'm not on my primary machine at the moment.

If you really think it needs testing of course.

(posted from my phone)

@dbz400
Copy link
Contributor Author

dbz400 commented Aug 26, 2013

It would be good to test it on other games as well as many games involves blending :)

Test build here.
ppssppwindows

@thedax
Copy link
Collaborator

thedax commented Aug 26, 2013

Confirmed, Half-Minute Hero's title and Pangya are no longer exhibiting the graphical issues, and Zack still has his shadow in Crisis Core. Nice work.

@dbz400
Copy link
Contributor Author

dbz400 commented Aug 26, 2013

@thedax .Thanks for testing. Hopefully this one is solid enough.

@solarmystic
Copy link
Contributor

@raven02

I managed to escape from work for an early lunch break, thanks to an elective procedure that finished much earlier than expected. Managed to put some time into the test suite, I've got a couple of hours before I've got to get back to work.

Report (You're not going to like this):-

capture

Major observations:-

a. Danganronpa is graphically broken in Framebuffers to Memory mode (GPU/CPU) compared to master

Savefile for testing (just enter the room, I'm standing right in front of the door in the savefile, and once you're in the room, turn the camera around to reproduce the issue):-

http://www.mediafire.com/download/o3zc2jhppdj3c1i/NPJH50515DATKG0005.7z

Your test build with FB2MEM (look at the glitchy, repeating objects (flags) at the top, it occurs when you swivel the camera in that particular room):-

danganronpa glitchy graphics in fb2mem mode

Current master (0.9.1-172) with FB2MEM (correct behaviour):-

danganronpa proper graphics in fb2mem mode master

b. Tactics Ogre does work fine, but notice that the blur is missing now in the World Map, compared to the master. I'm not so concerned about this one since nothing got functionally broken and the blur is an aesthetic feature.

Your test build (missing blur):-

tactics ogre blur missing test build

Current master (0.9.1-172) (blur is present):-

tactics ogre blur present master

@solarmystic
Copy link
Contributor

Here're another set of screenshots showing the glitches as compared to the working master:-

Test build:-
danganronpa glitchy graphics in fb2mem mode1

Master:-
danganronpa proper graphics in fb2mem mode master1

@thedax
Copy link
Collaborator

thedax commented Aug 26, 2013

What's interesting is, I'm getting different results.

In @raven02's test build, the issues do indeed exist, but when you apply the changes to the latest master(e3d0e4b as of this writing), the issues don't exist for me on my NVidia card. Can we get a test build that's based on e3d0e4b?

Did the test build that @solarmystic and I used have more changes than just the one in the commit? Hm..

@dbz400
Copy link
Contributor Author

dbz400 commented Aug 26, 2013

Yep , sorry that i did some changes to the framebuffer in my build since i use it to test multiple issues .

As long as the changes applied to latest master is okay then should be okay .

@thedax
Copy link
Collaborator

thedax commented Aug 26, 2013

I'll upload a test build in a minute then, with nothing changed except for the ones in this pullrq. Test results can't be accurate if other changes are making the test build dirty.

@thedax
Copy link
Collaborator

thedax commented Aug 26, 2013

Try this one: removed due to official merge.

@solarmystic
Copy link
Contributor

@thedax

Right in the nick of time too. I was about to head back to work.

I can confirm that with this provided build by @thedax , those two games are working just fine, in comparison to the master on my ATI card. (You can see that I'm using @thedax's build because it's using the newer speed/vps notation)

Danganronpa (no more graphical glitches):-

dr

Tactics Ogre (blur is present again):-

to

This commit can be merged now, me thinks.

Off to work I go, see you later folks.

@thedax
Copy link
Collaborator

thedax commented Aug 26, 2013

Indeed. Test builds should be provided as cleanly as possible. Anyway, this looks good to merge then, assuming no other games are broken by this.

@dbz400
Copy link
Contributor Author

dbz400 commented Aug 26, 2013

Thanks chaps.

@hrydgard
Copy link
Owner

The stencil buffer has something to do with alpha as they share bits, so this doesn't seem completely crazy. Let's try it.

hrydgard added a commit that referenced this pull request Aug 26, 2013
Use stenciltest for glblendFuncSeparate()
@hrydgard hrydgard merged commit 9667b9e into hrydgard:master Aug 26, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants