EEVEE-Next: Add Light Path node support

Fix #113922.

Pull Request: https://projects.blender.org/blender/blender/pulls/116107
This commit is contained in:
Miguel Pozo
2023-12-12 21:27:18 +01:00
parent b86d656df4
commit 224658266f
4 changed files with 26 additions and 2 deletions

View File

@@ -1211,6 +1211,9 @@ void DeferredProbeLayer::render(View &view,
Framebuffer &gbuffer_fb,
int2 extent)
{
inst_.pipelines.data.is_probe_reflection = true;
inst_.push_uniform_data();
GPU_framebuffer_bind(prepass_fb);
inst_.manager->submit(prepass_ps_, view);
@@ -1227,6 +1230,9 @@ void DeferredProbeLayer::render(View &view,
GPU_framebuffer_bind(combined_fb);
inst_.manager->submit(eval_light_ps_, view);
inst_.pipelines.data.is_probe_reflection = false;
inst_.push_uniform_data();
}
/** \} */
@@ -1369,6 +1375,9 @@ void PlanarProbePipeline::render(View &view,
{
GPU_debug_group_begin("Planar.Capture");
inst_.pipelines.data.is_probe_reflection = true;
inst_.push_uniform_data();
GPU_framebuffer_bind(gbuffer_fb);
GPU_framebuffer_clear_depth(gbuffer_fb, 1.0f);
inst_.manager->submit(prepass_ps_, view);
@@ -1396,6 +1405,9 @@ void PlanarProbePipeline::render(View &view,
GPU_framebuffer_bind(combined_fb);
inst_.manager->submit(eval_light_ps_, view);
inst_.pipelines.data.is_probe_reflection = false;
inst_.push_uniform_data();
GPU_debug_group_end();
}

View File

@@ -695,6 +695,7 @@ class PipelineModule {
void begin_sync()
{
data.is_probe_reflection = false;
probe.begin_sync();
planar.begin_sync();
deferred.begin_sync();

View File

@@ -1425,7 +1425,7 @@ BLI_STATIC_ASSERT_ALIGN(ProbePlanarDisplayData, 16)
struct PipelineInfoData {
float alpha_hash_scale;
float _pad0;
bool1 is_probe_reflection;
float _pad1;
float _pad2;
};

View File

@@ -107,7 +107,18 @@ void init_globals()
g_data.hair_time = 0.0;
g_data.hair_thickness = 0.0;
g_data.hair_strand_id = 0;
g_data.ray_type = RAY_TYPE_CAMERA; /* TODO */
#if defined(MAT_SHADOW)
g_data.ray_type = RAY_TYPE_SHADOW;
#elif defined(MAT_CAPTURE)
g_data.ray_type = RAY_TYPE_DIFFUSE;
#else
if (uniform_buf.pipeline.is_probe_reflection) {
g_data.ray_type = RAY_TYPE_GLOSSY;
}
else {
g_data.ray_type = RAY_TYPE_CAMERA;
}
#endif
g_data.ray_depth = 0.0;
g_data.ray_length = distance(g_data.P, drw_view_position());
g_data.barycentric_coords = vec2(0.0);