Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/gpu/shaders/material/gpu_shader_material_volume_principled.glsl')
-rw-r--r--source/blender/gpu/shaders/material/gpu_shader_material_volume_principled.glsl22
1 files changed, 17 insertions, 5 deletions
diff --git a/source/blender/gpu/shaders/material/gpu_shader_material_volume_principled.glsl b/source/blender/gpu/shaders/material/gpu_shader_material_volume_principled.glsl
index 884d5415c51..1127c34b3ac 100644
--- a/source/blender/gpu/shaders/material/gpu_shader_material_volume_principled.glsl
+++ b/source/blender/gpu/shaders/material/gpu_shader_material_volume_principled.glsl
@@ -1,3 +1,5 @@
+#pragma BLENDER_REQUIRE(gpu_shader_material_blackbody.glsl)
+
void node_volume_principled(vec4 color,
float density,
float anisotropy,
@@ -7,6 +9,7 @@ void node_volume_principled(vec4 color,
float blackbody_intensity,
vec4 blackbody_tint,
float temperature,
+ float weight,
float density_attribute,
vec4 color_attribute,
float temperature_attribute,
@@ -14,7 +17,6 @@ void node_volume_principled(vec4 color,
float layer,
out Closure result)
{
-#ifdef VOLUMETRICS
vec3 absorption_coeff = vec3(0.0);
vec3 scatter_coeff = vec3(0.0);
vec3 emission_coeff = vec3(0.0);
@@ -60,8 +62,18 @@ void node_volume_principled(vec4 color,
}
}
- result = Closure(absorption_coeff, scatter_coeff, emission_coeff, anisotropy);
-#else
- result = CLOSURE_DEFAULT;
-#endif
+ ClosureVolumeScatter volume_scatter_data;
+ volume_scatter_data.weight = weight;
+ volume_scatter_data.scattering = scatter_coeff;
+ volume_scatter_data.anisotropy = anisotropy;
+
+ ClosureVolumeAbsorption volume_absorption_data;
+ volume_absorption_data.weight = weight;
+ volume_absorption_data.absorption = absorption_coeff;
+
+ ClosureEmission emission_data;
+ emission_data.weight = weight;
+ emission_data.emission = emission_coeff;
+
+ result = closure_eval(volume_scatter_data, volume_absorption_data, emission_data);
}