shdata.uniform("light_dir", -sun.get_direction());
sun.set_transmittance(get_transmittance(-sun.get_direction()));
- Renderer::Push push(renderer);
-
- if(transmittance_lookup_dirty)
{
- transmittance_lookup_dirty = false;
- renderer.set_framebuffer(&transmittance_lookup.get_framebuffer());
- renderer.set_shader_program(&transmittance_shprog, &shdata);
+ Renderer::Push push(renderer);
+
+ renderer.add_shader_data(shdata);
+
+ if(transmittance_lookup_dirty)
+ {
+ transmittance_lookup_dirty = false;
+ renderer.set_framebuffer(&transmittance_lookup.get_framebuffer());
+ renderer.set_shader_program(&transmittance_shprog);
+ fullscreen_mesh.draw(renderer);
+ }
+
+ renderer.set_framebuffer(&distant.get_framebuffer());
+ renderer.set_shader_program(&distant_shprog);
+ renderer.set_texture("transmittance_lookup", &transmittance_lookup.get_target_texture(0), &sampler);
fullscreen_mesh.draw(renderer);
}
- renderer.set_framebuffer(&distant.get_framebuffer());
- renderer.set_shader_program(&distant_shprog, &shdata);
- renderer.set_texture("transmittance_lookup", &transmittance_lookup.get_target_texture(0), &sampler);
- fullscreen_mesh.draw(renderer);
-
content.setup_frame(renderer);
}