magcius / noclip.website

A digital museum of video game levels
https://noclip.website/
Other
3.27k stars 259 forks source link

Battle for Bikini Bottom: RenderWare improvements #631

Closed seilweiss closed 8 months ago

seilweiss commented 8 months ago

This addresses/implements the suggestions from #629.

I want to separate more Gfx stuff from RenderWare's public types, e.g. RwTexture/RwRaster should not contain a GfxTexture/GfxSampler/etc. I'm considering adding a "RwGfx" helper class to RwEngine that holds all the Gfx-specific data and helper functions that can be reused across multiple RenderWare pipelines.

seilweiss commented 8 months ago

Added a new commit, per our Discord discussion I removed the light tracking fom the global atomic pipeline for now and lights are now recalculated per RpAtomic instance again. I wonder if it would be worth experimenting caching the lights on each RpAtomic instance since they usually don't change between renders of the same instance.

I also moved megaStateFlags to be per RpAtomic instance instead of in the global pipeline. Similarly to lights, I'm considering keeping a hash of RwRenderState in each instance as it usually doesn't change between renders, so I might be able to avoid redoing the conversion to megaStateFlags every render. This might be a negligible optimization though.

Happy to continue adding to this PR if you have any concerns/suggestions.