GPU Lighting & Graphics Settings
been doing a bit of rendering work again… mostly trying to optimize things.
the biggest change is that I completely rewrote the lighting system
previously all the point light calculations were happening on the CPU, and after doing some profiling (and spending way too long staring at compiler generated assembly annotations) it became pretty obvious that this was one of the bigger performance bottlenecks (well THE biggest excluding driver overhead)
lighting now runs entirely on the GPU through shaders instead
changes
lighting
rewrote the lighting system.
- lighting is now shader-based and runs on the GPU
- removed the old CPU-side lighting calculations
- moved engine shaders (like the base shader and lighting shader) into built-in InternalShaders (hardcoded string literals, it might seem messy but i prefer it like that)
the internal shader change mostly exists because they’re pretty fundamental to the renderer. if they were treated like normal project assets and someone accidentally deleted them… well… suddenly nothing renders (unless they had setup their own shaders, which is fully supported!) and lighting completely falls over, also i prefer it to loading them from the filesystem anyways
overall I’m pretty happy with how the new lighting system turned out
graphics settings
also started working on configurable graphics settings
instead of baking them into the project, the engine now loads graphics settings from a separate JSON file. this doesn’t get packed into the .obpak, so users can tweak their graphics settings after exporting a game
currently supports:
- resolution
- fullscreen
- MSAA (toggle + sample count)
- target FPS
- VSync
it’s weirdly fun actually being back in OpenGL code again instead of just working with engine abstractions
sometimes it’s nice to get back into the weeds.. even if its.. painfull :D
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.