Coder Social home page Coder Social logo

Comments (10)

gonetz avatar gonetz commented on June 30, 2024

@GhostlyDark I checked that problem. GLideN64 dumps only 3 of 4 textures because it calculates the same Rice CRC for two textures. GLideN64 texture CRC is different for them, so native textures work correctly. It can be a bug in GLideN64 implementation of Rice CRC calculation. I tried to dump textures with Rice plugin to check that. Unfortunately, I can't find these textures among dumped ones. Could you try to dump these textures with Rice and if it makes correct dump, attach it to the task?

from gliden64.

GhostlyDark avatar GhostlyDark commented on June 30, 2024

Rice exhibits the exact same issues.

image

image

image

from gliden64.

gonetz avatar gonetz commented on June 30, 2024

@GhostlyDark , thanks! So, it's not a problem with implementation of Rice CRC, it is problem with Rice CRC itself.
The only way to solve it is to somehow modify CRC calculation.
I can suggest the following solution:

  • add new dump mode: "dump with strong hash".
  • if some textures dumped incorrectly with vanilla RiceCRC, texture artist uses alternative dump mode.
    Texture format remains the same, only checksum in texture name will be different.
  • During textures load, graphics plugin will first try to load HD texture as usual, with RiceCRC.
    If load fails, the plugin calculates alternative CRC and tries to load HD texture with it.

This way we keep compatibility with existing HD packs and solve problems like this one.
Such a modification is easy to add to other graphics plugins.
The necessary condition is existing of 32bit hash, which is stronger than RiceCRC32 one.
Such hash really exists. GLideN64 currently uses XXH3_64bits_withSeed for texture checksum calculation.
It returns 64bit hash. We need a 32bit one for compatibility with Rice format.
I checked the "Cerebral Bore crosshair" case. XXH3_64bits returns different hashes for textures, where RiceCRC32 fails and return the same. The results remain different even just being cast to uint32. We can also xor higher and lower 32 bits to be sure in the result.

If this solution sounds acceptable, I can implement it.

from gliden64.

GhostlyDark avatar GhostlyDark commented on June 30, 2024

Sounds good to me.

from gliden64.

gonetz avatar gonetz commented on June 30, 2024

@GhostlyDark
I created PR: Add "Use strong CRC for texture dump" option. #2820
All textures for "Cerebral Bore crosshair" dumped correctly with strong CRC and plugin can load them as HD textures.
Texture dumps stored in "strong_crc" sub-folder when this option is enabled.
I also added a hotkey to switch it on/off, so you may switch between dump modes without using the config dialog.
Please try that build and tell me, what should be added or changed for texture artists convenience.

from gliden64.

GhostlyDark avatar GhostlyDark commented on June 30, 2024

This works really well and addresses similar issues, like #2798.

Used some mindless upscaling for testing, the strong_crc is needed for I, . and :.
image

#2317 is at least partially fixed. The numbers in the VS Record screen are still busted, which is probably unrelated to this, as the Rice dumps differ. I updated that issue with some info and a savestate, in case you want to check it out.

Resident Evil 2 has issues with differently colored text overwriting, which is also fixed with this new option.

The hotkey is really handy and I don't have an issue with the current implementation. The location of the strong_crc folder is fine and makes it easy to sort out the files, although it can look a bit cluttered. Not sure if it'd be better to have it in Internal ROM Name/strong_crc or Internal ROM Name/GLideNHQ_strong_crc or something similar, but I don't have hard feelings either way.
image

from gliden64.

gonetz avatar gonetz commented on June 30, 2024

Thanks for the feedback!

Not sure if it'd be better to have it in Internal ROM Name/strong_crc or Internal ROM Name/GLideNHQ_strong_crc or something similar, but I don't have hard feelings either way.

The plugin builds path to dumps folder and passes it to GLideNHQ library. The library adds internal name to the path and builds the full file name. To build path as "Internal ROM Name/GLideNHQ_strong_crc", I need to pass "strong_crc" flag to the library. It could be done, but I had decided to add as little changes to library's interface as possible. If the current location of the strong_crc folder looks cluttered, I'll fix it.

from gliden64.

GhostlyDark avatar GhostlyDark commented on June 30, 2024

I think going the route of doing as little changes as possible is better, so keeping it the way it is right now should be fine.

from gliden64.

gonetz avatar gonetz commented on June 30, 2024

It was not hard to change and the changes in the library interface were minimal - I just added txfilter_dmptx_strong function.

from gliden64.

GhostlyDark avatar GhostlyDark commented on June 30, 2024

Fixed via ded38f8

from gliden64.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.