Page 1 of 2
Dreamcast Voxel engine
Posted: Sun Jan 08, 2023 9:51 pm
by Cass
Despite the rumours we didn't get Outcast back in the day but some clever clogs seems to be building his own Voxel engine for the Dreamcast.
https://youtu.be/ifd_kKgsq9c
Re: Dreamcast Voxel engine
Posted: Tue Jan 10, 2023 4:27 pm
by Ryo_Hazuki
Very good, the programmer said he started working on the Dreamcast two weeks ago.
Re: Dreamcast Voxel engine
Posted: Wed Jan 11, 2023 3:22 am
by runkthepunk
Ahh man this looks great.
I was really interested in Outcast and was disappointed when it never came out so just seeing this is cool.
Re: Dreamcast Voxel engine
Posted: Wed Jan 11, 2023 3:34 am
by TapamN
There was
another voxel demo from 2002 that used seemed to use the algorithm
from Flipcode to do hardware accelerated voxel heightmap drawing. It also looks like a commercial Dreamcast game, Surf Rocket Racers, did something similar for the water, but I've never looked at the wireframe in an emulator to verify for sure.
Re: Dreamcast Voxel engine
Posted: Wed Jan 11, 2023 6:37 am
by Ian Micheal
Current one is broken non aligned memory reads i posted this to the dev and where..Does not work on a real dreamcast.
Re: Dreamcast Voxel engine
Posted: Wed Jan 11, 2023 7:37 am
by cloofoofoo
TapamN wrote:There was
another voxel demo from 2002 that used seemed to use the algorithm
from Flipcode to do hardware accelerated voxel heightmap drawing. It also looks like a commercial Dreamcast game, Surf Rocket Racers, did something similar for the water, but I've never looked at the wireframe in an emulator to verify for sure.
Its polygon based. Its grid like near the player and simpler from a distance.
Re: Dreamcast Voxel engine
Posted: Wed Jan 11, 2023 7:55 am
by Ian Micheal
Software based is too slow 18 fps at 320x240 not 45fps ..
https://github.com/nareez/dreamcast-vox ... e/issues/1 this does not work at all on a real Dreamcast right now i show the problem and where..
Re: Dreamcast Voxel engine
Posted: Sat Jan 14, 2023 9:47 am
by Nareez
Hi everyone, I'm really happy that some people are interested in the Voxel Engine on the Dreamcast. I didn't expect anyone to care about that.
Unfortunately the demo still doesn't work on real hardware. Ian Michael showed me the error and I will work to correct it.
Many improvements need to be made, as I understand how to get the best out of the Dreamcast Hardware I will improve the Engine.
I'll show the progress on my twitter @NaReeZ
Re: Dreamcast Voxel engine
Posted: Sat Jan 14, 2023 10:11 am
by Ian Micheal
Nareez wrote:Hi everyone, I'm really happy that some people are interested in the Voxel Engine on the Dreamcast. I didn't expect anyone to care about that.
Unfortunately the demo still doesn't work on real hardware. Ian Michael showed me the error and I will work to correct it.
Many improvements need to be made, as I understand how to get the best out of the Dreamcast Hardware I will improve the Engine.
I'll show the progress on my twitter @NaReeZ
One of my fav engine styles i care for sure thank you..
Re: Dreamcast Voxel engine
Posted: Sun Jan 15, 2023 6:49 pm
by TapamN
cloofoofoo wrote:Its polygon based. Its grid like near the player and simpler from a distance.
Are you talking about the demo from boob or SRR? I looked at the boob demo a very long time ago, so I don't remember much of it. But SRR does some weirdness when the camera goes below the water, and the waterfall stage has some weird glitches that make me think it might work like the Flipcode hardware accelerated version.
Nareez wrote:Hi everyone, I'm really happy that some people are interested in the Voxel Engine on the Dreamcast. I didn't expect anyone to care about that.
Unfortunately the demo still doesn't work on real hardware. Ian Michael showed me the error and I will work to correct it.
Many improvements need to be made, as I understand how to get the best out of the Dreamcast Hardware I will improve the Engine.
I'll show the progress on my twitter @NaReeZ
I noticed you're using sq_cpy to update the frame buffer in VRAM. This is much better than trying to use video RAM directly, but it's still pretty slow. There are faster ways to update a VRAM buffer.
I got the following timings for copying a frame buffer from main RAM to video RAM for a 640x480 16-bit frame buffer:
- memcpy: 20.80 ms
- KOS sq_cpy: 8.24 ms
- Modified sq_cpy: 3.89 ms
- DMA (includes optimized cache flush, waits for DMA to complete): 1.98 ms
- DMA (includes optimized cache flush, DMA works in background): 0.08 ms
For a 320x240 resolution screen, they would take about 1/4th the time. If you let the DMA work in the background, you wouldn't actually get all of the 1.90 ms saved when waiting, since the DMA will slow down CPU memory access. You might only save something like 1 ms total in an real game.
It looks like you tried to use DMA, but had trouble since KOS's DMA isn't designed to update the frame buffer. Video RAM DMA will only work if you enable the 3D driver... Also, KOS's cache flush function is partially broken; it does flush the cache, but it's much slower than it needs to be. Using KOS's dcache_flush_range would add an extra 1.84 ms to DMA timings I listed.
I don't have complete, sharable code for using DMA to the frame buffer without the PVR driver right now, but you can speed up sq_cpy by using this function instead of regular sq_cpy:
Code: Select all
void modified_sq_cpy_pvr32(void *dst, void *src, size_t len) {
//Set PVR DMA register
(volatile int *)0xA05F6888 = 1;
//Convert read/write area pointer to DMA write only area pointer
void *dmaareaptr = ((uintptr_t)dst & 0xffffff) | 0x11000000;
sq_cpy(dmaareaptr, src, len);
}