diff options
author | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-07-20 22:33:17 +1000 |
---|---|---|
committer | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-07-20 22:33:17 +1000 |
commit | bda9501ed2f18c42c361499ec8f234f2e576ab7e (patch) | |
tree | 841146a0f17d168926dabdf536a6ab0f208bf13c /src/new_render/render.c | |
parent | dc8952e6650aae6297915bf118e1f7b1259d235d (diff) |
pass shadow texture through to pbr function
Diffstat (limited to 'src/new_render/render.c')
-rw-r--r-- | src/new_render/render.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/new_render/render.c b/src/new_render/render.c index 386a356..eea9ad1 100644 --- a/src/new_render/render.c +++ b/src/new_render/render.c @@ -146,14 +146,10 @@ void Render_RenderEntities(RenderEnt* entities, size_t entity_count) { Renderer* ren = get_renderer(); RenderScene scene = ren->scene; - // TODO: -- Shadows - // f32 near_plane = 1.0, far_plane = 10.0; - // Mat4 light_projection = mat4_orthographic(-10.0, 10.0, -10.0, 10.0, near_plane, far_plane); - // Vec3 pos = vec3_negate(scene.sun.direction); - // Mat4 light_view = mat4_look_at(pos, VEC3_ZERO, VEC3_Y); - // Mat4 light_space_matrix = mat4_mult(light_view, light_projection); - // Shadow_ShadowmapExecute(ren->shadows, light_space_matrix, entities, entity_count); - PBR_Execute(ren->pbr, scene.camera, INVALID_TEX_HANDLE, entities, entity_count); + Shadow_Storage* shadow_storage = Render_GetShadowStorage(); + TextureHandle depthmap = shadow_storage->enabled ? Shadow_GetShadowMapTexture(shadow_storage) : INVALID_TEX_HANDLE; + + PBR_Execute(ren->pbr, scene.camera, depthmap, entities, entity_count); } TextureData TextureDataLoad(const char* path, bool invert_y) { |