OpenNaja / cobra-tools

A suite of GUI tools for extracting and modifying OVL and OVS archives, as well as editing the associated in-house file formats. Also includes a model plugin for Blender. For downloads, guides, and FAQs visit:
https://opennaja.github.io/cobra-tools/
GNU General Public License v3.0
98 stars 28 forks source link

MS2 - Flickering fur textures post-injection #264

Closed rinrobi closed 1 year ago

rinrobi commented 1 year ago

Describe the bug

After injection, patches on the fur texture flickers. See attachment

To Reproduce Steps to reproduce the behavior:

  1. Export a dino that has a fur texture in vanilla (eg. Pyroraptor)
  2. Inject
  3. Look in game or Species Viewer (easier to see in SV)

Expected behavior

No flickering, looking like vanilla

Screenshots

https://user-images.githubusercontent.com/116887550/198758793-04d01cd1-2b23-4a5e-9801-f85e0ea74583.mp4

Version Info:

ovl_tool_gui.log

rinrobi commented 1 year ago

Video had to be short due to file size. Can send a longer video with more angles on Discord if needed!

HENDRIX-ZT2 commented 1 year ago

Injection of the model I presume?

rinrobi commented 1 year ago

Yes! Sorry I didn’t specify

HENDRIX-ZT2 commented 1 year ago

@harlequinzeg0 this is likely due to the bad floats data on the chunks, so the sorting goes wrong

ilodev commented 1 year ago

that flickering looks to me like the are actually in the same exact position and fighting for the render order, could it be the float compression or something losing precission?

HENDRIX-ZT2 commented 1 year ago

that flickering looks to me like the are actually in the same exact position and fighting for the render order, could it be the float compression or something losing precission?

Yes, they are Z-fighting, but I think it is not due to precision issues in the mesh data but due to us feeding bad data for the sorting of chunks. Each chunk has a bunch of floats that I interpret as relevant for the Z sorting of chunks. That's the most likely explanation for why they implemented chunks in the first place. It's much faster to Z sort chunks than all polys of a mesh.

harlequinzeg0 commented 1 year ago

issue is specific to the shell meshes

HENDRIX-ZT2 commented 1 year ago

issue is specific to the shell meshes

Have you tried actually deleting the shell meshes with the current patch - flickering is gone, then?

HENDRIX-ZT2 commented 1 year ago

This appears to be due to the bad chunk splitting algorithm.

harlequinzeg0 commented 1 year ago

fixed in commit that rewrote chunking