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
This commit is contained in:
		@@ -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);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user