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

Alone in the dark 16bit color textures #109

Closed
saeedAlshaikh opened this Issue Jul 2, 2018 · 19 comments

Comments

Projects
None yet
3 participants
@saeedAlshaikh

saeedAlshaikh commented Jul 2, 2018

Like the title says, Alone in the dark textures are is incorrectly rendered in 16bit instead of 32bit check the comparison photos between
Demul Redream Reicast at the following link

https://imgur.com/a/kkmBr9i

demul
redream
reicast

@flyinghead

This comment has been minimized.

Collaborator

flyinghead commented Jul 9, 2018

@twinaphex This commit flyinghead@18b2d82 should fix this issue

@twinaphex

This comment has been minimized.

Member

twinaphex commented Jul 9, 2018

Tried backporting this but it looks like this in a lot of sprite-based games -

image

Any issues in this diff? Im testing with the OIT renderer -

https://hastebin.com/vidalehefe.diff

@flyinghead

This comment has been minimized.

Collaborator

flyinghead commented Jul 9, 2018

Can you point me to a game in particular? I haven't done extensive tests...

@flyinghead

This comment has been minimized.

Collaborator

flyinghead commented Jul 9, 2018

No need to. I just found one.

@flyinghead

This comment has been minimized.

Collaborator

flyinghead commented Jul 9, 2018

That should fix it: flyinghead@889f722

@twinaphex

This comment has been minimized.

Member

twinaphex commented Jul 9, 2018

Cool, let me try it.

@twinaphex

This comment has been minimized.

Member

twinaphex commented Jul 9, 2018

The issues are fixed now, thanks!

@twinaphex

This comment has been minimized.

Member

twinaphex commented Jul 9, 2018

Also, not sure if it is because of this commit or the floating point commit before, but Shadow Man now finally works in VGA mode!

@flyinghead

This comment has been minimized.

Collaborator

flyinghead commented Jul 9, 2018

Holy cow! Works for me too. How's that possible?

@flyinghead

This comment has been minimized.

Collaborator

flyinghead commented Jul 9, 2018

Yep, confirmed: another floating point precision victim. Not anymore :)

@twinaphex

This comment has been minimized.

Member

twinaphex commented Jul 9, 2018

Hmm, @flyinghead , this is what I get with Alone In The Dark with Reicast OIT -

image

@twinaphex

This comment has been minimized.

Member

twinaphex commented Jul 9, 2018

Hmm, this seems to affect Soul Calibur greatly too, even with the non-OIT renderer.

image

@flyinghead

This comment has been minimized.

Collaborator

flyinghead commented Jul 9, 2018

Yes, I see this in the OIT core, not on my branches

@flyinghead

This comment has been minimized.

Collaborator

flyinghead commented Jul 9, 2018

You should probably rebase TexCache.h, and perhaps TexCache.cpp, before applying my commit. I see lots of differences.

@twinaphex

This comment has been minimized.

Member

twinaphex commented Jul 9, 2018

OK, rebasing...

@twinaphex

This comment has been minimized.

Member

twinaphex commented Jul 9, 2018

Rebased TexCache.cpp. The Soul Calibur regressions are now fixed, unfortunately Alone In The Dark's backgrounds remain blue-ish.

@flyinghead

This comment has been minimized.

Collaborator

flyinghead commented Jul 9, 2018

You're almost there:

diff --git a/core/rend/TexCache.h b/core/rend/TexCache.h
index 9c8ef0c..0bd319a 100644
--- a/core/rend/TexCache.h
+++ b/core/rend/TexCache.h
@@ -68,7 +68,7 @@ void palette_update(void);
 
 // Unpack to 32-bit word
 
-#define ARGB8888( word ) ( (((word>>4)&0xF)<<4) | (((word>>12)&0xF)<<8) | (((word>>20)&0xF)<<12) | (((word>>28)&0xF)<<0) )
+#define ARGB8888( word ) ( ((word >> 24) & 0xFF) | (((word >> 16) & 0xFF) << 24) | (((word >> 8) & 0xFF) << 16) | ((word & 0xFF) << 8) )
 
 template<class PixelPacker>
 __forceinline u32 YUV422(s32 Y,s32 Yu,s32 Yv)

@twinaphex

This comment has been minimized.

Member

twinaphex commented Jul 9, 2018

Ah, thanks for pointing that out. Let me get to that real quick...

@twinaphex

This comment has been minimized.

Member

twinaphex commented Jul 9, 2018

yep, that fixed the remaining buggy textures. Thanks a lot!

@twinaphex twinaphex closed this Jul 9, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment