Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee_next/eevee_pipeline.cc
| Show All 38 Lines | void WorldPipeline::sync(GPUMaterial *gpumat) | ||||
| world_ps_.bind_image("aov_value_img", &rbufs.aov_value_tx); | world_ps_.bind_image("aov_value_img", &rbufs.aov_value_tx); | ||||
| world_ps_.bind_ssbo("aov_buf", &inst_.film.aovs_info); | world_ps_.bind_ssbo("aov_buf", &inst_.film.aovs_info); | ||||
| /* RenderPasses. Cleared by background (even if bad practice). */ | /* RenderPasses. Cleared by background (even if bad practice). */ | ||||
| world_ps_.bind_image("rp_normal_img", &rbufs.normal_tx); | world_ps_.bind_image("rp_normal_img", &rbufs.normal_tx); | ||||
| world_ps_.bind_image("rp_light_img", &rbufs.light_tx); | world_ps_.bind_image("rp_light_img", &rbufs.light_tx); | ||||
| world_ps_.bind_image("rp_diffuse_color_img", &rbufs.diffuse_color_tx); | world_ps_.bind_image("rp_diffuse_color_img", &rbufs.diffuse_color_tx); | ||||
| world_ps_.bind_image("rp_specular_color_img", &rbufs.specular_color_tx); | world_ps_.bind_image("rp_specular_color_img", &rbufs.specular_color_tx); | ||||
| world_ps_.bind_image("rp_emission_img", &rbufs.emission_tx); | world_ps_.bind_image("rp_emission_img", &rbufs.emission_tx); | ||||
| world_ps_.bind_image("rp_cryptomatte_img", &rbufs.cryptomatte_tx); | |||||
| world_ps_.draw(DRW_cache_fullscreen_quad_get(), handle); | world_ps_.draw(DRW_cache_fullscreen_quad_get(), handle); | ||||
| /* To allow opaque pass rendering over it. */ | /* To allow opaque pass rendering over it. */ | ||||
| world_ps_.barrier(GPU_BARRIER_SHADER_IMAGE_ACCESS); | world_ps_.barrier(GPU_BARRIER_SHADER_IMAGE_ACCESS); | ||||
| } | } | ||||
| void WorldPipeline::render(View &view) | void WorldPipeline::render(View &view) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | opaque_ps_.init(); | ||||
| opaque_ps_.bind_image(RBUFS_NORMAL_SLOT, &inst_.render_buffers.normal_tx); | opaque_ps_.bind_image(RBUFS_NORMAL_SLOT, &inst_.render_buffers.normal_tx); | ||||
| opaque_ps_.bind_image(RBUFS_LIGHT_SLOT, &inst_.render_buffers.light_tx); | opaque_ps_.bind_image(RBUFS_LIGHT_SLOT, &inst_.render_buffers.light_tx); | ||||
| opaque_ps_.bind_image(RBUFS_DIFF_COLOR_SLOT, &inst_.render_buffers.diffuse_color_tx); | opaque_ps_.bind_image(RBUFS_DIFF_COLOR_SLOT, &inst_.render_buffers.diffuse_color_tx); | ||||
| opaque_ps_.bind_image(RBUFS_SPEC_COLOR_SLOT, &inst_.render_buffers.specular_color_tx); | opaque_ps_.bind_image(RBUFS_SPEC_COLOR_SLOT, &inst_.render_buffers.specular_color_tx); | ||||
| opaque_ps_.bind_image(RBUFS_EMISSION_SLOT, &inst_.render_buffers.emission_tx); | opaque_ps_.bind_image(RBUFS_EMISSION_SLOT, &inst_.render_buffers.emission_tx); | ||||
| /* AOVs. */ | /* AOVs. */ | ||||
| opaque_ps_.bind_image(RBUFS_AOV_COLOR_SLOT, &inst_.render_buffers.aov_color_tx); | opaque_ps_.bind_image(RBUFS_AOV_COLOR_SLOT, &inst_.render_buffers.aov_color_tx); | ||||
| opaque_ps_.bind_image(RBUFS_AOV_VALUE_SLOT, &inst_.render_buffers.aov_value_tx); | opaque_ps_.bind_image(RBUFS_AOV_VALUE_SLOT, &inst_.render_buffers.aov_value_tx); | ||||
| /* Cryptomatte. */ | |||||
| opaque_ps_.bind_image(RBUFS_CRYPTOMATTE_SLOT, &inst_.render_buffers.cryptomatte_tx); | |||||
| /* Storage Buf. */ | /* Storage Buf. */ | ||||
| opaque_ps_.bind_ssbo(RBUFS_AOV_BUF_SLOT, &inst_.film.aovs_info); | opaque_ps_.bind_ssbo(RBUFS_AOV_BUF_SLOT, &inst_.film.aovs_info); | ||||
| /* Textures. */ | /* Textures. */ | ||||
| opaque_ps_.bind_texture(RBUFS_UTILITY_TEX_SLOT, inst_.pipelines.utility_tx); | opaque_ps_.bind_texture(RBUFS_UTILITY_TEX_SLOT, inst_.pipelines.utility_tx); | ||||
| inst_.lights.bind_resources(&opaque_ps_); | inst_.lights.bind_resources(&opaque_ps_); | ||||
| inst_.sampling.bind_resources(&opaque_ps_); | inst_.sampling.bind_resources(&opaque_ps_); | ||||
| inst_.cryptomatte.bind_resources(&opaque_ps_); | |||||
| } | } | ||||
| opaque_single_sided_ps_ = &opaque_ps_.sub("SingleSided"); | opaque_single_sided_ps_ = &opaque_ps_.sub("SingleSided"); | ||||
| opaque_single_sided_ps_->state_set(DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL | | opaque_single_sided_ps_->state_set(DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL | | ||||
| DRW_STATE_CULL_BACK); | DRW_STATE_CULL_BACK); | ||||
| opaque_double_sided_ps_ = &opaque_ps_.sub("DoubleSided"); | opaque_double_sided_ps_ = &opaque_ps_.sub("DoubleSided"); | ||||
| opaque_double_sided_ps_->state_set(DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL); | opaque_double_sided_ps_->state_set(DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_EQUAL); | ||||
| ▲ Show 20 Lines • Show All 107 Lines • Show Last 20 Lines | |||||