Closed LagoLunatic closed 1 month ago
I'll take a look at this in RenderDoc in a bit. Seems J3DUltra still has some bugs to sort out.
It appears to render correctly in my viewer program, Jekyll:
Jekyll is using this sort algorithm: https://github.com/Sage-of-Mirrors/Jekyll/blob/main/src/application/AJ3DContext.cpp#L34. What does GCFT use?
PyJ3DUltra seems to use this simple sort function that doesn't distinguish between opaque and transparent materials: https://github.com/LagoLunatic/PyJ3DUltra/blob/733abcd52adb72ef91d1fd1446f9fc32107fbde0/src/main.cpp#L38-L43
I copied your SortFuncTest into PyJ3DUltra, and it seems to fix the water not being blue issue.
However, there are two issues. First, loading the BTK still doesn't seem to animate the water, same as before.
Second, almost any transformation to the camera (rotating, zooming, translating) seems to mess up the rendering and make most of the model transparent, which didn't happen with the original sort function. Here's an example, the first image is the default camera position, and the second is after rotating the camera by about 5 degrees or so:
Do either of these issues happen in Jekyll?
Hmm... you're right that BTK seems broken. I'll look into that.
The other issue doesn't happen. Here's the build of Jekyll I used: jekyll.zip
You can just drag-and-drop the model file onto the viewport.
Looks like the materials for the water don't use a tex matrix transform to modify the UVs:
noclip's code has this comment in it: https://github.com/magcius/noclip.website/blob/3832c0c84d3c54d1492f6ce0a2834480fd04377c/src/Common/JSYSTEM/J3D/J3DLoader.ts#L1157-L1163
Ah. I'll fix that then. Thank you for bringing it to my attention!
Try https://github.com/Sage-of-Mirrors/J3DUltra/commit/629e7a09f204231f069d2ee72259674ce333a52a and let me know if it's fixed!
Yep, animates perfectly now!
I'm still confused about the sort function breaking, so I made a PyJ3DUltra issue for it here: https://github.com/Astral-C/PyJ3DUltra/issues/4
Custom model made by BSZ with SuperBMD, and BTK animation made by btk-conv: model.zip
It renders like this, and isn't being animated by the BTK (neither the waterfall nor the pond):
It works ingame, it also works in noclip, where renders like this, and is animated by the BTK:
Tested on latest main commit, with the only change being the bugfix in #6