Lodge
- 6 Devlogs
- 49 Total hours
A small 3D vulkan game engine with lua scripting.
A small 3D vulkan game engine with lua scripting.
I added screen-space reflections by using ray marching in a compute shader and falling back to environment probes when off-screen. Now reflections look more realistic and metal materials can reflect too, not just glass like before.
Now the asset loader also reads normals, metallicness, and roughness from models so everything looks better.
I’m still only creating probes for transparent objects, I probably should start calculating good positions for them based on the environment since every object could reflect now.
Now each glass object gets a probe that captures what the object sees on every face at scene load and the glass shader samples it instead of the sky.
I also added a new pipeline and shaders so that there is a sky instead of just the clear color. It also gets reflected by the glass. It doesn’t support skyboxes yet, but that would just be updating the shader to sample a skybox instead of a function.
It was much simpler than what I expected, I just had to draw opaque objects to a sampler before rendering to the window and then sample that in the glass shader. Currently the reflections are just sampling a fake skybox, I’m now going to try to pass a cubemap of the scene so the reflections can finally reflect objects in the scene.
I also rewrote how objects, lights and cameras are handled to use a more general API that abstracts the renderer so that adding scripting and physics is easier later.
I had to finally add a second rendering pipeline so that colored glass would blend with objects behind it, which made me have to change how I was doing rendering, but it wasn’t that big of a refactor as I expected.
There are no shadows yet, so light stays the same color even if it passes through the glass, so I’ll work on that next, and allowing for rendering multiple models in the same scene.
Added loading 3D models into the engine and a debug menu for development. No lighting or transparency yet, so it looks kinda weird, but I will be adding that next.
I implemented my own heap-allocated stack for computing the correct world transform for nested nodes without recursion, I think that’s a pretty neat solution.
Spent 11h just to get a brick cube to render…. I love vulkan.
Tbh, now that everything is set up everything else should be the easy part