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/gpu/GPU_material.h
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/gpu/GPU_material.h')
-rw-r--r--source/blender/gpu/GPU_material.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/gpu/GPU_material.h b/source/blender/gpu/GPU_material.h
index 680e717e615..12152a937d9 100644
--- a/source/blender/gpu/GPU_material.h
+++ b/source/blender/gpu/GPU_material.h
@@ -128,6 +128,11 @@ typedef enum eGPUMaterialStatus {
GPU_MAT_SUCCESS,
} eGPUMaterialStatus;
+typedef enum eGPUVolumeDefaultValue {
+ GPU_VOLUME_DEFAULT_0,
+ GPU_VOLUME_DEFAULT_1,
+} eGPUVolumeDefaultValue;
+
typedef void (*GPUMaterialEvalCallbackFn)(GPUMaterial *mat,
int options,
const char **vert_code,
@@ -148,7 +153,9 @@ GPUNodeLink *GPU_image_tiled(GPUMaterial *mat,
eGPUSamplerState sampler_state);
GPUNodeLink *GPU_image_tiled_mapping(GPUMaterial *mat, struct Image *ima, struct ImageUser *iuser);
GPUNodeLink *GPU_color_band(GPUMaterial *mat, int size, float *pixels, float *layer);
-GPUNodeLink *GPU_volume_grid(GPUMaterial *mat, const char *name);
+GPUNodeLink *GPU_volume_grid(GPUMaterial *mat,
+ const char *name,
+ eGPUVolumeDefaultValue default_value);
GPUNodeLink *GPU_builtin(eGPUBuiltin builtin);
bool GPU_link(GPUMaterial *mat, const char *name, ...);
@@ -242,6 +249,7 @@ typedef struct GPUMaterialTexture {
typedef struct GPUMaterialVolumeGrid {
struct GPUMaterialVolumeGrid *next, *prev;
char *name;
+ eGPUVolumeDefaultValue default_value;
char sampler_name[32]; /* Name of sampler in GLSL. */
char transform_name[32]; /* Name of 4x4 matrix in GLSL. */
int users;