diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2020-03-17 18:27:08 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2020-03-18 13:23:05 +0300 |
commit | fd53b72871e045dfebfb9ddbe2b3c491491aa913 (patch) | |
tree | 892721f97e6bff16c9d87bc3ffee295d2f4a77bc /source/blender/gpu/intern/gpu_codegen.c | |
parent | b0a1cf2c9ae696b07f7a236bc855a5ab4a493dcb (diff) |
Objects: Eevee and workbench rendering of new Volume, Hair, PointCloud
Only the volume drawing part is really finished and exposed to the user. Hair
plugs into the existing hair rendering code and is fairly straightforward. The
pointcloud drawing is a hack using overlays rather than Eevee and workbench.
The most tricky part for volume rendering is the case where each volume grid
has a different transform, which requires an additional matrix in the shader
and non-trivial logic in Eevee volume drawing. In the common case were all the
transforms match we don't use the additional per-grid matrix in the shader.
Ref T73201, T68981
Differential Revision: https://developer.blender.org/D6955
Diffstat (limited to 'source/blender/gpu/intern/gpu_codegen.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_codegen.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index bcaa95c2f59..066b8d633d2 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -335,6 +335,7 @@ static int codegen_process_uniforms_functions(GPUMaterial *material, /* Volume Grids */ for (GPUMaterialVolumeGrid *grid = graph->volume_grids.first; grid; grid = grid->next) { BLI_dynstr_appendf(ds, "uniform sampler3D %s;\n", grid->sampler_name); + BLI_dynstr_appendf(ds, "uniform mat4 %s = mat4(0.0);\n", grid->transform_name); } /* Print other uniforms */ @@ -432,6 +433,9 @@ static void codegen_call_functions(DynStr *ds, GPUNodeGraph *graph, GPUOutput *f else if (input->source == GPU_SOURCE_VOLUME_GRID) { BLI_dynstr_append(ds, input->volume_grid->sampler_name); } + else if (input->source == GPU_SOURCE_VOLUME_GRID_TRANSFORM) { + BLI_dynstr_append(ds, input->volume_grid->transform_name); + } else if (input->source == GPU_SOURCE_OUTPUT) { codegen_convert_datatype( ds, input->link->output->type, input->type, "tmp", input->link->output->id); |