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:
authorBrecht Van Lommel <brecht@blender.org>2020-09-03 16:26:52 +0300
committerBrecht Van Lommel <brecht@blender.org>2020-09-03 16:49:41 +0300
commitf0c376a52a53db98bd8d8db3c79116f71001fb5c (patch)
tree6553e87a82f831c3e6f6bbdb527fda8337ab06ac /source/blender/nodes
parent96439de784801c7ed0072408a5238bb877af828e (diff)
Fix T80332: principle volume shader not working for world in Eevee
The handling of missing volume grids for the principled volume shader was incomplete, different inputs need different default values.
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_attribute.c6
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_volume_info.c8
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_volume_principled.c6
3 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_attribute.c b/source/blender/nodes/shader/nodes/node_shader_attribute.c
index 116bc181997..4fd0ce4f1ef 100644
--- a/source/blender/nodes/shader/nodes/node_shader_attribute.c
+++ b/source/blender/nodes/shader/nodes/node_shader_attribute.c
@@ -44,13 +44,13 @@ static int node_shader_gpu_attribute(GPUMaterial *mat,
if (GPU_material_is_volume_shader(mat)) {
if (out[0].hasoutput) {
- out[0].link = GPU_volume_grid(mat, attr->name);
+ out[0].link = GPU_volume_grid(mat, attr->name, GPU_VOLUME_DEFAULT_0);
}
if (out[1].hasoutput) {
- out[1].link = GPU_volume_grid(mat, attr->name);
+ out[1].link = GPU_volume_grid(mat, attr->name, GPU_VOLUME_DEFAULT_0);
}
if (out[2].hasoutput) {
- out[2].link = GPU_volume_grid(mat, attr->name);
+ out[2].link = GPU_volume_grid(mat, attr->name, GPU_VOLUME_DEFAULT_0);
}
return 1;
diff --git a/source/blender/nodes/shader/nodes/node_shader_volume_info.c b/source/blender/nodes/shader/nodes/node_shader_volume_info.c
index 7ccc00f1af3..6cafc991e13 100644
--- a/source/blender/nodes/shader/nodes/node_shader_volume_info.c
+++ b/source/blender/nodes/shader/nodes/node_shader_volume_info.c
@@ -34,16 +34,16 @@ static int node_shader_gpu_volume_info(GPUMaterial *mat,
GPUNodeStack *out)
{
if (out[0].hasoutput) {
- out[0].link = GPU_volume_grid(mat, "color");
+ out[0].link = GPU_volume_grid(mat, "color", GPU_VOLUME_DEFAULT_0);
}
if (out[1].hasoutput) {
- out[1].link = GPU_volume_grid(mat, "density");
+ out[1].link = GPU_volume_grid(mat, "density", GPU_VOLUME_DEFAULT_0);
}
if (out[2].hasoutput) {
- out[2].link = GPU_volume_grid(mat, "flame");
+ out[2].link = GPU_volume_grid(mat, "flame", GPU_VOLUME_DEFAULT_0);
}
if (out[3].hasoutput) {
- out[3].link = GPU_volume_grid(mat, "temperature");
+ out[3].link = GPU_volume_grid(mat, "temperature", GPU_VOLUME_DEFAULT_0);
}
return true;
diff --git a/source/blender/nodes/shader/nodes/node_shader_volume_principled.c b/source/blender/nodes/shader/nodes/node_shader_volume_principled.c
index b581a4bd3a6..1a25aec5cb8 100644
--- a/source/blender/nodes/shader/nodes/node_shader_volume_principled.c
+++ b/source/blender/nodes/shader/nodes/node_shader_volume_principled.c
@@ -78,13 +78,13 @@ static int node_shader_gpu_volume_principled(GPUMaterial *mat,
}
if (STREQ(sock->name, "Density Attribute")) {
- density = GPU_volume_grid(mat, attribute_name);
+ density = GPU_volume_grid(mat, attribute_name, GPU_VOLUME_DEFAULT_1);
}
else if (STREQ(sock->name, "Color Attribute")) {
- color = GPU_volume_grid(mat, attribute_name);
+ color = GPU_volume_grid(mat, attribute_name, GPU_VOLUME_DEFAULT_1);
}
else if (use_blackbody && STREQ(sock->name, "Temperature Attribute")) {
- temperature = GPU_volume_grid(mat, attribute_name);
+ temperature = GPU_volume_grid(mat, attribute_name, GPU_VOLUME_DEFAULT_0);
}
}