Skip to content

Update optimize still software rendering voxelspace engine cpu bound

License

Notifications You must be signed in to change notification settings

ianmicheal/dreamcast-voxelspace-engine

 
 

Repository files navigation

Voxel Space Engine for Dreamcast

#Update to Nareez: Dreamcast port.

#Ian micheal: Changes i made to Improve speed.

*1 Optimizing and fixing Pvr dma rendering is now 32bit aligned and working added sh4 math header.

*2 I have been optimizing this and have fixed the 32-bit DMA rendering alignment and added SH4 math functions.

*3 Replace the inner for loop with a while loop that terminates early when the projected height falls below zero or above the screen height.

*4 I reorder the heightMap and pixelmap arrays to improve cache locality by aligning adjacent memory elements to adjacent points in the world, resulting in fewer cache misses and better performance.

*5 Precompute values that are used in the loop, like sh4FSCARadianSine, sh4FSCARadianCosine, plx, ply, prx, and pry, instead of recomputing them in each iteration of the loop.

*6 Unroll the loop that iterates over the z variable by incrementing z by 2 in each iteration since the loop body is executed twice for each value of z.

*7 Compute the rx and ry variables outside the loop that iterates over z and increment them inside the loop instead of recomputing them in each iteration of the loop. This eliminates one multiplication and one addition per iteration of the z loop.

NOw 35fps on hardware

bandicam.2023-02-15.05-14-31-568.mp4

Running on Dreamcast hardware now 21fps

bandicam.2023-02-15.03-39-15-884.mp4

##HISTORY      Now 16fps on hardware bandicam 2023-02-05 05-16-46-130

bandicam.2023-01-16.13-02-44-038.mp4

Dreamcast emulators are much faster then hardware examples below King of being way too fast flycast flycast 2023-01-16 14-06-53-537 DEMUL 15fps 5 fps faster then a real dreamcast demul1 2023-01-16 13-55-28-050 Redream faster then hardware redream 2023-01-16 13-57-58-990 Nulldc 7 fps faster then hardware nullDC_Win32_Release 2023-01-16 13-58-54-075 Update video

TODO

  • Develop workking code of voxel space engine for Dreamcast

  • FPS Count

  • Collision

  • Fog Effect

  • Delta time

Issues:

  • Screen tearing and flickering - Solution: Develop Double Buffering
  • Slow RAM to VRAM data transfer - Solution: Transfer framebuffer data thru store queue copy
  • Ugly surface colors - Solution: Increase brightness
  • Non aligned memory not allowing to run on real hardware

Credits

Dreamcast development credits

About

Update optimize still software rendering voxelspace engine cpu bound

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 85.2%
  • Shell 14.5%
  • Makefile 0.3%