diff options
author | Brecht Van Lommel <brecht@blender.org> | 2020-08-12 19:50:09 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2020-08-12 19:50:40 +0300 |
commit | 6238eabcd4340893c1c52dcd9a0ffbc7658abe67 (patch) | |
tree | 9a04fe11d49760d1f96a320aa57a2e31cb989532 /source | |
parent | 655091297f1756c2ebc5c796bdeb5d673052c8b4 (diff) | |
parent | 54c2c1492122bc736f6d5a9f7ddf1f51b0673eff (diff) |
Merge branch 'blender-v2.90-release'
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_volumes.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_volumes.c b/source/blender/draw/engines/eevee/eevee_volumes.c index e1e65c29b4f..f8c7a6e16db 100644 --- a/source/blender/draw/engines/eevee/eevee_volumes.c +++ b/source/blender/draw/engines/eevee/eevee_volumes.c @@ -62,6 +62,7 @@ static struct { GPUTexture *dummy_density; GPUTexture *dummy_color; GPUTexture *dummy_flame; + GPUTexture *dummy_missing; GPUTexture *dummy_scatter; GPUTexture *dummy_transmit; @@ -141,6 +142,9 @@ static void eevee_create_shader_volumes(void) const float flame = 0.0f; e_data.dummy_flame = DRW_texture_create_3d(1, 1, 1, GPU_R8, DRW_TEX_WRAP, &flame); + + const float missing[4] = {0.0f, 0.0f, 0.0f, 0.0f}; + e_data.dummy_missing = DRW_texture_create_3d(1, 1, 1, GPU_RGBA8, DRW_TEX_WRAP, missing); } void EEVEE_volumes_set_jitter(EEVEE_ViewLayerData *sldata, uint current_sample) @@ -355,7 +359,7 @@ void EEVEE_volumes_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) /* Fix principle volumetric not working with world materials. */ ListBase gpu_grids = GPU_material_volume_grids(mat); LISTBASE_FOREACH (GPUMaterialVolumeGrid *, gpu_grid, &gpu_grids) { - DRW_shgroup_uniform_texture(grp, gpu_grid->sampler_name, e_data.dummy_density); + DRW_shgroup_uniform_texture(grp, gpu_grid->sampler_name, e_data.dummy_missing); } DRW_shgroup_call_procedural_triangles(grp, NULL, common_data->vol_tex_size[2]); @@ -443,7 +447,7 @@ static bool eevee_volume_object_grids_init(Object *ob, ListBase *gpu_grids, DRWS NULL; DRW_shgroup_uniform_texture( - grp, gpu_grid->sampler_name, (drw_grid) ? drw_grid->texture : e_data.dummy_density); + grp, gpu_grid->sampler_name, (drw_grid) ? drw_grid->texture : e_data.dummy_missing); if (drw_grid && multiple_transforms) { /* Specify per-volume transform matrix that is applied after the @@ -830,6 +834,7 @@ void EEVEE_volumes_free(void) DRW_TEXTURE_FREE_SAFE(e_data.dummy_density); DRW_TEXTURE_FREE_SAFE(e_data.dummy_flame); DRW_TEXTURE_FREE_SAFE(e_data.dummy_color); + DRW_TEXTURE_FREE_SAFE(e_data.dummy_missing); DRW_SHADER_FREE_SAFE(e_data.volumetric_clear_sh); DRW_SHADER_FREE_SAFE(e_data.scatter_sh); |