EEVEE Next: Volumes #107176

Merged
Miguel Pozo merged 126 commits from pragma37/blender:pull-eevee-next-volumes into main 2023-08-04 16:47:22 +02:00
6 changed files with 4 additions and 29 deletions
Showing only changes of commit 0bd14fe7e8 - Show all commits

View File

@ -499,7 +499,6 @@ set(GLSL_SRC
engines/eevee_next/shaders/eevee_surf_shadow_frag.glsl
engines/eevee_next/shaders/eevee_surf_world_frag.glsl
engines/eevee_next/shaders/eevee_velocity_lib.glsl
engines/eevee_next/shaders/eevee_volume_clear_comp.glsl
engines/eevee_next/shaders/eevee_volume_integration_comp.glsl
engines/eevee_next/shaders/eevee_volume_lib.glsl
engines/eevee_next/shaders/eevee_volume_material_comp.glsl

View File

@ -77,14 +77,9 @@ void WorldVolumePipeline::sync(GPUMaterial *gpumat)
inst_.lights.bind_resources(&world_ps_);
inst_.shadows.bind_resources(&world_ps_);
if (gpumat) {
world_ps_.material_set(*inst_.manager, gpumat);
volume_sub_pass(world_ps_, nullptr, nullptr, gpumat);
}
else {
/* If no world or volume material is present just clear the buffer. */
world_ps_.shader_set(inst_.shaders.static_shader_get(VOLUME_CLEAR));
}
world_ps_.material_set(*inst_.manager, gpumat);
volume_sub_pass(world_ps_, nullptr, nullptr, gpumat);
world_ps_.dispatch(math::divide_ceil(inst_.volume.grid_size(), int3(VOLUME_GROUP_SIZE)));
/* Sync with object property pass. */
world_ps_.barrier(GPU_BARRIER_SHADER_IMAGE_ACCESS);

View File

@ -172,8 +172,6 @@ const char *ShaderModule::static_shader_create_info_name_get(eShaderType shader_
return "eevee_shadow_tag_usage_opaque";
case SHADOW_TILEMAP_TAG_USAGE_TRANSPARENT:
return "eevee_shadow_tag_usage_transparent";
case VOLUME_CLEAR:
return "eevee_volume_clear";
case VOLUME_INTEGRATION:
return "eevee_volume_integration";
case VOLUME_RESOLVE:

View File

@ -80,7 +80,6 @@ enum eShaderType {
SHADOW_TILEMAP_TAG_USAGE_OPAQUE,
SHADOW_TILEMAP_TAG_USAGE_TRANSPARENT,
VOLUME_CLEAR,
VOLUME_INTEGRATION,
VOLUME_RESOLVE,
VOLUME_SCATTER,

View File

@ -186,13 +186,9 @@ void VolumeModule::begin_sync()
::World *world = inst_.scene->world;
if (world && world->use_nodes && world->nodetree && !inst_.use_studio_light()) {
material = inst_.shaders.world_shader_get(world, world->nodetree, MAT_PIPE_VOLUME);
if (!GPU_material_has_volume_output(material)) {
material = nullptr;
}
enabled_ = GPU_material_has_volume_output(material);
}
enabled_ = material != nullptr;
inst_.pipelines.world_volume.sync(material);
}

View File

@ -12,18 +12,6 @@ GPU_SHADER_CREATE_INFO(eevee_volume_lib)
.sampler(VOLUME_SCATTERING_TEX_SLOT, ImageType::FLOAT_3D, "volume_scattering_tx")
.sampler(VOLUME_TRANSMITTANCE_TEX_SLOT, ImageType::FLOAT_3D, "volume_transmittance_tx");
GPU_SHADER_CREATE_INFO(eevee_volume_clear)
.additional_info("eevee_shared")
.uniform_buf(VOLUMES_INFO_BUF_SLOT, "VolumesInfoData", "volumes_info_buf")
.compute_source("eevee_volume_clear_comp.glsl")
.local_group_size(VOLUME_GROUP_SIZE, VOLUME_GROUP_SIZE, VOLUME_GROUP_SIZE)
/* Outputs. */
.image(0, GPU_R11F_G11F_B10F, Qualifier::WRITE, ImageType::FLOAT_3D, "out_scattering_img")
.image(1, GPU_R11F_G11F_B10F, Qualifier::WRITE, ImageType::FLOAT_3D, "out_extinction_img")
.image(2, GPU_R11F_G11F_B10F, Qualifier::WRITE, ImageType::FLOAT_3D, "out_emissive_img")
.image(3, GPU_RG16F, Qualifier::WRITE, ImageType::FLOAT_3D, "out_phase_img")
.do_static_compilation(true);
GPU_SHADER_CREATE_INFO(eevee_volume_scatter)
.additional_info("eevee_shared")
.additional_info("draw_resource_id_varying")