nicoyn / mupen64plus

Automatically exported from code.google.com/p/mupen64plus
0 stars 0 forks source link

glide64mk2: S3TC Texture Compression mixes up color channels for HiRes Textures #566

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Describe your system:
 - Operating System (be specific): Linux Mint 13
 - Machine type (32-bit or 64-bit): 32-bit
 - Mupen64Plus version: 2.0 (Compiled from hg)
 - Plugins used: glide64mk2, audio-sdl, input-sdl, rsp-hle

For visual artifacts, give:
- game name and CRC/MD5 hash (printed on console)
Core: Goodname: Legend of Zelda, The - Ocarina of Time - Master Quest (U) (GC) 
[!]
Core: Name: THE LEGEND OF ZELDA 
Core: MD5: DA35577FE54579F6A266931CC75F512D
Core: CRC: f034001a ae47ed06

Using this HiRes texture pack: 
http://www.emutalk.net/threads/51481-Zelda-Ocarina-of-time-Community-Retexture-P
roject-V6-Development-Topic

- description of the artifact (missing polygons, flashing, wrong colors,
etc)
Wrong colors

Describe the problem:
When using Glide64Mk2, S3TC Texture Compression and HiRes Textures don't mix.  
The result is that color channels in the source images get mixed up somewhere 
along the way.

Compression On (Incorrect Behavior):
https://lh3.googleusercontent.com/-zq62Sbs5GOk/UdT5YmFITmI/AAAAAAAAAHc/brpMz9kMz
iI/s912/CompressionOn.png
Compression Off (Correct Behavior):
https://lh6.googleusercontent.com/-IvHpXUNN96I/UdT5Yob3yNI/AAAAAAAAAHg/os7ZTF1oG
bk/s912/CompressionOff.png

It clearly looks like an RGB vs BGR issue.  Most likely is that somewhere 
between compressing and decompressing the texture, a mistake occurs regarding 
the channel order.  Unfortunately I don't know enough about how Glide64 works 
to make a patch myself.

Original issue reported on code.google.com by iLagDoes...@gmail.com on 4 Jul 2013 at 5:24

GoogleCodeExporter commented 8 years ago
Thanks for the testcase and the description (pictures!!!). I don't have the 
time to check it right now but will look at the problem after the 2.0 release

Original comment by s...@narfation.org on 4 Jul 2013 at 9:42

GoogleCodeExporter commented 8 years ago

Original comment by s...@narfation.org on 4 Jul 2013 at 9:43

GoogleCodeExporter commented 8 years ago
I had no time to test this problem, but here is just an easy testcase for later 
(sky in the into of "Legend of Zelda, The - Ocarina of Time - Master Quest (U) 
(Debug Version)" 8CA71E87DE4CE5E9F6EC916202A623E9). Your assumption about the 
order of channels seems to be right.

My glide64mk2 config

[Video-Glide64mk2]

# Card ID
card_id = 0
# Vertical sync
vsync = False
# TODO:ssformat
ssformat = False
# Display performance stats (add together desired flags): 1=FPS counter, 2=VI/s 
counter, 4=% speed, 8=FPS transparent
show_fps = 0
# Clock enabled
clock = False
# Clock is 24-hour
clock_24_hr = False
# Wrapper resolution
wrpResolution = 0
# Wrapper VRAM
wrpVRAM = 0
# Wrapper FBO
wrpFBO = True
# Wrapper Anisotropic Filtering
wrpAnisotropic = False
# Texture Enhancement: Smooth/Sharpen Filters
ghq_fltr = 0
# Texture Compression: 0 for S3TC, 1 for FXT1
ghq_cmpr = 0
# Texture Enhancement: More filters
ghq_enht = 0
# Hi-res texture pack format (0 for none, 1 for Rice)
ghq_hirs = 1
# Compress texture cache with S3TC or FXT1
ghq_enht_cmpr = True
# Tile textures (saves memory but could cause issues)
ghq_enht_tile = 0
# Force 16bpp textures (saves ram but lower quality)
ghq_enht_f16bpp = False
# Compress texture cache
ghq_enht_gz = True
# Don't enhance textures for backgrounds
ghq_enht_nobg = False
# Enable S3TC and FXT1 compression
ghq_hirs_cmpr = True
# Tile hi-res textures (saves memory but could cause issues)
ghq_hirs_tile = False
# Force 16bpp hi-res textures (saves ram but lower quality)
ghq_hirs_f16bpp = False
# Compress hi-res texture cache
ghq_hirs_gz = True
# Alternative CRC calculation -- emulates Rice bug
ghq_hirs_altcrc = True
# Save tex cache to disk
ghq_cache_save = True
# Texture Cache Size (MB)
ghq_cache_size = 128
# Use full alpha channel -- could cause issues for some tex packs
ghq_hirs_let_texartists_fly = False
# Dump textures
ghq_hirs_dump = False

Original comment by s...@narfation.org on 8 Jul 2013 at 8:12

Attachments:

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Can you please test 
https://bitbucket.org/ecsv/mupen64plus-video-glide64mk2-fixes/commits/4ca56f40a9
e5249f1db7d0b52efb67cc9d7f2778 (will be removed after richard42 merged it)

Original comment by s...@narfation.org on 8 Jul 2013 at 9:05

GoogleCodeExporter commented 8 years ago
It is now merged

Original comment by s...@narfation.org on 9 Jul 2013 at 5:50