summaryrefslogtreecommitdiff
path: root/renderer.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'renderer.hpp')
-rw-r--r--renderer.hpp36
1 files changed, 35 insertions, 1 deletions
diff --git a/renderer.hpp b/renderer.hpp
index c49c804..46f5331 100644
--- a/renderer.hpp
+++ b/renderer.hpp
@@ -12,6 +12,7 @@ enum {
SHADOW_MAP_END = SHADOW_MAP_START + Lighting::max_shadows,
drawlist_count = SHADOW_MAP_END };
+struct Asset_Arena;
struct Model_Instance;
struct Renderer;
@@ -32,26 +33,59 @@ struct Drawlist {
);
};
+struct Fullscreen_Quad {
+ Buffer_Id vb;
+
+ void init(Device* d);
+ void destroy(Device* d);
+ void render(
+ Context& ctx,
+ Pipeline& pip,
+ Render_Pass& pass,
+ int bind
+ );
+};
+
struct Renderer {
static constexpr int max_cameras = 16;
Hash_Map<Camera_Id, Camera, max_cameras> cameras;
Drawlist drawlists[drawlist_count];
Staged_Buffer globals;
+ Fullscreen_Quad quad;
int camera_count;
int frame;
+ Shader* ts_shader;
+ int ts_shadowmap_binding;
+ int ts_depthmap_binding;
+ int ts_prev_binding;
+ int ts_vert_binding;
+ int ts_config_binding;
+ int ts_caster_config_binding;
+ int ts_casters_binding;
+ int ts_globals_binding;
+ Sampler_Id ts_sampler;
+ Staged_Buffer ts_config, ts_config2;
+
Sampler_Id clamped_linear;
Texture_Id env_cubemap;
- void init(Arena* arena, Device* d);
+ void init(Arena* arena, Device* d, Asset_Arena& assets);
void destroy(Device* d);
void set_camera(Camera_Id cam, int drawlist);
+ void make_ts_sampler(Device* d);
void render(
Device* dev,
Arena* a,
Texture_Id hdr_target,
const Lighting* l
);
+ void temporal_shadows(
+ Device* dev,
+ Context& ctx,
+ const Lighting* l,
+ Pipeline_Builder& pb
+ );
void add_model(int drawlist, Model_Instance* m);
void rem_model(int drawlist, Model_Instance* m);