-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Dx9 depal - needs debugging before merge #6920
Conversation
I found several things, but not working yet... hmm. Will send a pull. -[Unknown] |
pD3Ddevice->SetRenderState(D3DRS_STENCILENABLE, FALSE); | ||
pD3Ddevice->SetRenderState(D3DRS_SCISSORTESTENABLE, FALSE); | ||
pD3Ddevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE); | ||
pD3Ddevice->SetFVF(D3DFVF_XYZ | D3DFVF_TEX0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"D3DFVF_TEX0" means "I have 0 texture coordinates in the vertices", I think this ought to be D3DFVF_TEX1. I still don't think that will fix it.
-[Unknown]
I don't know what's going wrong here. In 3rd Birthday, if I alter the shader to just return Not sure if somehow a temp fbo/surface is being bound, or if something needs to sync for render to texture... -[Unknown] |
This branch need rebase |
Is this PR still relevant? Doesn't DX9 already have depalettization? |
No, it doesn't. This is still relevant but it doesn't work, and we still haven't figured out why. I think it ought to work... -[Unknown] |
Interestingly, #2917 in Direct3D isn't actually corrected by this, though it makes it better. The artifacts are like horizontal stripes with this change. The reason that is interesting is that Brave Story doesn't use depal, it just uses render-to-self (which is also covered by this pull request.) So, that seems to indicate there's a problem with the render copy stuff, instead of / in addition to the depal. Here's a version merged with master, conflicts resolved: -[Unknown] |
I'm wrong, debugging it more, the stripes are caused by off-by-one errors or something. It draws horizontal boxes from top to bottom to darken the texture, and there's some overlap or underlap on how they are drawn, even though the vertices are clean and exact. #7206 seems to actually help that slightly, but it's still off. The game uses throughmode and draws 8px tall slices, which don't exactly line up. But shouldn't the projection translation affect all points equally anyway? I'm not clear on how that could affect overlap. -[Unknown] |
One would think so, yes, although occasionally when using point sampling and sampling exactly on the border between texels you can get very strange off-by-one effects due to rounding errors... |
Removing the offset -[Unknown] |
I think I may have it (somewhat) working, but I found a totally different problem. The game I'm testing depal with is that Dragon Ball Z one, since it's pretty obvious when depal is not working. The game clears the stencil and depth buffer every frame, but not the color buffer. It does this in the pretty standard way of several vertical boxes. Depth and stencil are cleared, but alpha is not. I've tried messing with the masks and blending, but it didn't help... and there's no d3d errors. Not sure why that's happening... -[Unknown] |
Was alpha blending before.
Otherwise, it doesn't get restored.
We don't swap palettes anymore, except in the shader.
9eb4bd4
to
105087d
Compare
So, I think this actually works. Dragon Ball Z doesn't work because absdiff is missing. I say merge. -[Unknown] |
Dx9 depal - needs debugging before merge
Pretty much the same as GL ES 2.0 depalettization.
Doesn't work yet though, hope someone else can spot what's wrong.