| 232 | } |
| 233 | |
| 234 | void pbr_renderer::run_depth_prepass(const view_data & view, const render_payload & scene) |
| 235 | { |
| 236 | GLboolean colorMask[4]; |
| 237 | glGetBooleanv(GL_COLOR_WRITEMASK, &colorMask[0]); |
| 238 | |
| 239 | glEnable(GL_DEPTH_TEST); // Enable depth testing |
| 240 | glDepthFunc(GL_LESS); // Nearest pixel |
| 241 | glDepthMask(GL_TRUE); // Need depth mask on |
| 242 | glColorMask(0, 0, 0, 0); // Do not write any color |
| 243 | |
| 244 | auto & shader = renderPassEarlyZ.get()->get_variant()->shader; |
| 245 | shader.bind(); |
| 246 | |
| 247 | for (const render_component & r : scene.render_components) |
| 248 | { |
| 249 | update_per_object_uniform_buffer(r.world_matrix, r.material->receive_shadow, view); |
| 250 | r.mesh->draw(); |
| 251 | } |
| 252 | |
| 253 | shader.unbind(); |
| 254 | |
| 255 | // Restore color mask state |
| 256 | glColorMask(colorMask[0], colorMask[1], colorMask[2], colorMask[3]); |
| 257 | } |
| 258 | |
| 259 | void pbr_renderer::run_skybox_pass(const view_data & view, const render_payload & scene) |
| 260 | { |
nothing calls this directly
no test coverage detected