Devlog #3 - Multi-planet rendering + LOD
I made some massive rendering breakthroughs today. The main goal was getting multiple planets working in the 3D world without tanking the GPU. I built a system that lets me add as many planets as I want, tweak their colors, and set their exact positions.
Performance is a big priority, so I implemented a custom Level of Detail (LOD) system. When you are far away, the mod swaps the planet for a low-poly version that keeps the textures intact. As you fly closer, it dynamically cranks up the polygon count so it rounds out into a high-quality sphere. It saves a ton of rendering overhead.
I did run into some weird graphical glitches. At one point, the planets were following the camera around the screen instead of staying fixed in the world, and looking at them from certain angles turned them into morphing blobs.
It took some digging, but I figured out it was a mix of matrix projection issues and backface culling deleting half the triangles. I manually reconstructed the model-view matrix from the camera’s rotation to get the world translations plotting perfectly, and disabled culling during the planet render passes so the spheres stay solid.
Everything is pushed and working great now. I finally have a sky filled with actual 3D planets you can fly towards.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.