diff options
author | quou <quou@disroot.org> | 2025-02-09 18:50:58 +1100 |
---|---|---|
committer | quou <quou@disroot.org> | 2025-02-09 18:51:30 +1100 |
commit | 629dc808c595d65cda74a86975ebd780113f3431 (patch) | |
tree | 72d0c17600c6420fc2b834529d781dc43cc20317 /model.hpp | |
parent | 1c86bb51da99df1950124d812eabcfe15af4f771 (diff) |
Properly send lights from the CPU
Diffstat (limited to 'model.hpp')
-rw-r--r-- | model.hpp | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -8,6 +8,7 @@ #include <tuple> struct Camera; +struct Lighting; struct Material : public Asset { float metalness, roughness, ao; @@ -29,7 +30,7 @@ struct Material : public Asset { struct Model; struct Mesh { int offset, vbo_offset, count; - int parent, mesh_binding, mvp_binding, mat_binding; + int parent, mesh_binding, mvp_binding, mat_binding, light_binding; int env_cube_binding; int mvp_binding_depth; bool world_dirty; @@ -94,11 +95,16 @@ struct Model_Instance { void init(Device* dev, Heap* h, Model* model); void destroy(Device* dev, Heap* h); void update(); - void update_cbuffers(Device* dev, const Camera& cam); + void update_cbuffers( + Device* dev, + const Lighting& lighting, + const Camera& cam + ); void render( Device* dev, Arena* a, Render_Pass& pass, + const Lighting* lighting, Texture_Id env_cubemap, Sampler_Id sampler ); @@ -115,11 +121,16 @@ struct Model_Scene { void destroy(Device* dev); void init(Arena* arena, int max_instances, Sampler_Id s); - void update(const Camera& cam, Device* dev); + void update( + const Camera& cam, + const Lighting& lighting, + Device* dev + ); void render( Device* dev, Arena* a, Render_Pass& pass, + const Lighting* lighting, Texture_Id env_cubemap, Sampler_Id sampler ); |