Dreamcast Voxel engine

General Dreamcast discussion applies here. Before posting here please check the other forums in the Dreamcast section to see if your topic would fit better in those categories.

Moderators: pcwzrd13, mazonemayu

Forum rules
Please check the other forums in the Dreamcast section before posting here to see if your topic would fit better in those categories. Example: A new game/homebrew release would go in the New Releases/Homebrew/Emulation section: http://dreamcast-talk.com/forum/viewforum.php?f=5 or if you're having an issue with getting your Dreamcast to work or a game to boot it would go in the Support section: http://dreamcast-talk.com/forum/viewforum.php?f=42
Cass
MegaDeath
Posts: 226
Joined: Sun Jul 26, 2020 7:50 pm
Dreamcast Games you play Online: None

Dreamcast Voxel engine

Post 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.

User avatar
Ryo_Hazuki
killer
Posts: 266
Joined: Sat Sep 28, 2019 5:45 pm

Re: Dreamcast Voxel engine

Post by Ryo_Hazuki »

Very good, the programmer said he started working on the Dreamcast two weeks ago.
User avatar
runkthepunk
Doom
Posts: 194
Joined: Mon Aug 30, 2010 2:42 pm
Dreamcast Games you play Online: I will happily play any once I get myself set-up with a decent internet connection!
Location: England

Re: Dreamcast Voxel engine

Post 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.
TapamN
letterbomb
Posts: 149
Joined: Sun Jan 10, 2021 10:52 pm

Re: Dreamcast Voxel engine

Post 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.
User avatar
Ian Micheal
Developer
Posts: 6009
Joined: Wed Dec 19, 2018 5:23 am
Location: USA
Contact:

Re: Dreamcast Voxel engine

Post 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.
cloofoofoo
Crazy Taxi!
Posts: 535
Joined: Wed Jan 06, 2010 10:15 pm
Dreamcast Games you play Online: PSO-SCHtACK

Re: Dreamcast Voxel engine

Post 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.
User avatar
Ian Micheal
Developer
Posts: 6009
Joined: Wed Dec 19, 2018 5:23 am
Location: USA
Contact:

Re: Dreamcast Voxel engine

Post 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..
User avatar
Nareez
Fancy Pants Admin
Posts: 1
Joined: Sat Jan 14, 2023 8:16 am
Dreamcast Games you play Online: Quake 3
Contact:

Re: Dreamcast Voxel engine

Post 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
User avatar
Ian Micheal
Developer
Posts: 6009
Joined: Wed Dec 19, 2018 5:23 am
Location: USA
Contact:

Re: Dreamcast Voxel engine

Post 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..
TapamN
letterbomb
Posts: 149
Joined: Sun Jan 10, 2021 10:52 pm

Re: Dreamcast Voxel engine

Post 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);
}
Post Reply