ClassiCube icon indicating copy to clipboard operation
ClassiCube copied to clipboard

Wii/GameCube: Investigate switching from specifying vertices one by one to drawing using arrays

Open UnknownShadow200 opened this issue 1 year ago • 12 comments

Although since I can't test on actual hardware, will need help from someone who can to check what difference it makes to performance

UnknownShadow200 avatar Nov 12 '23 00:11 UnknownShadow200

I've got a GameCube hooked up and ready to go. I also have a Nintendo 64, so I can test on that too, if needed.

GK6475 avatar Nov 21 '23 06:11 GK6475

Note that the Nintendo 64 port has never been tested on real hardware, so use at your own risk ClassiCube-n64.zip

You may need the Expansion Pak

UnknownShadow200 avatar Nov 22 '23 07:11 UnknownShadow200

Ok, I'll give it a try.

GK6475 avatar Nov 24 '23 05:11 GK6475

20231123_235332 20231123_235328 20231123_235323 20231123_235307 This happened after attempting to load a session. It worked for a second, froze, then displayed all this. Page 5 was empty.

GK6475 avatar Nov 24 '23 05:11 GK6475

Problem is with these lines in Intersection_RayIntersectsBox

invDirX = 1.0f / dir.X;
invDirY = 1.0f / dir.Y;
invDirZ = 1.0f / dir.Z;

If your camera happens to be looking exactly down the X, Y or Z axis, then dir.X/Y/Z will be zero


ClassiCube relies on the FPU being configured to ignore the division by zero attempt and instead produce infinity as the result

However, when LibDragon is compiled in debug mode, it configures the FPU to instead raise exceptions on division by zero: image

I will redesign the ray intersection code to avoid relying on dividing by zero though

UnknownShadow200 avatar Nov 24 '23 08:11 UnknownShadow200

CCN64_v2.zip Can you please try this updated build instead?

UnknownShadow200 avatar Nov 24 '23 09:11 UnknownShadow200

Yes, I'll try that shortly.

GK6475 avatar Nov 24 '23 20:11 GK6475

20231124_151007 It works, but feels like a slideshow, FPS must be less than 10. Some of the graphics are distorted, but if the framerate were better, I'd say this would be playable.

GK6475 avatar Nov 24 '23 21:11 GK6475

Pretty amazing to see it running on actual hardware, thanks for testing!

The port hasn't been optimised at all, so there is quite a lot of room for improvement. Unfortunately I don't really have the time to implement a fully optimised port, but I will try to find some time to see if I can improve performance a bit

UnknownShadow200 avatar Nov 25 '23 12:11 UnknownShadow200

Yeah, it would be neat to see the port run in a playable speed, like at least 20fps. But this is a pretty cool proof of concept.

GK6475 avatar Nov 26 '23 18:11 GK6475

@UnknownShadow200 not sure if you are aware or use discord, but there is a discord https://discord.gg/66xXTnjk for N64 Development, the #rom-testing channel would be a good place to upload test roms, and #libdragon for questions re libdragon usage.

daevangelion avatar Nov 27 '23 09:11 daevangelion

@UnknownShadow200 not sure if you are aware or use discord, but there is a discord https://discord.gg/66xXTnjk for N64 Development, the #rom-testing channel would be a good place to upload test roms, and #libdragon for questions re libdragon usage.

I do have Discord, but TBH I'm a bit reluctant to join there because I don't want to waste people's time

I've made some further changes to the Nintendo 64 port, so water should render now and FPS should show in the top left (not sure how accurate it is though) ClassiCube-n64-v4.zip

UnknownShadow200 avatar Dec 04 '23 11:12 UnknownShadow200