diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-05-09 17:16:12 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-05-10 13:14:41 +0300 |
commit | a298dde5d799bd41dd571cda9c91b62a6b78562a (patch) | |
tree | 75dc46e668c58915e0a2f1a8369f2a029e42072c /source/blender/draw/engines/eevee/eevee_materials.c | |
parent | fdddea676d4fa40668ca82f8ccc5106437d113f2 (diff) |
Eevee: Update matrices operations to not use combined matrices
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_materials.c')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_materials.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c index c195732aaf8..35e1ff8a9c1 100644 --- a/source/blender/draw/engines/eevee/eevee_materials.c +++ b/source/blender/draw/engines/eevee/eevee_materials.c @@ -48,6 +48,7 @@ static struct { char *frag_shader_lib; char *vert_shader_str; + char *vert_shadow_shader_str; char *volume_shader_lib; struct GPUShader *default_prepass_sh; @@ -609,18 +610,20 @@ void EEVEE_materials_init(EEVEE_ViewLayerData *sldata, e_data.vert_shader_str = BLI_string_joinN( datatoc_common_view_lib_glsl, datatoc_common_hair_lib_glsl, datatoc_lit_surface_vert_glsl); + e_data.vert_shadow_shader_str = BLI_string_joinN( + datatoc_common_view_lib_glsl, datatoc_common_hair_lib_glsl, datatoc_shadow_vert_glsl); + e_data.default_background = DRW_shader_create( datatoc_background_vert_glsl, NULL, datatoc_default_world_frag_glsl, NULL); - e_data.default_prepass_sh = DRW_shader_create( - datatoc_prepass_vert_glsl, NULL, datatoc_prepass_frag_glsl, NULL); - - e_data.default_prepass_clip_sh = DRW_shader_create( - datatoc_prepass_vert_glsl, NULL, datatoc_prepass_frag_glsl, "#define CLIP_PLANES\n"); - char *vert_str = BLI_string_joinN( datatoc_common_view_lib_glsl, datatoc_common_hair_lib_glsl, datatoc_prepass_vert_glsl); + e_data.default_prepass_sh = DRW_shader_create(vert_str, NULL, datatoc_prepass_frag_glsl, NULL); + + e_data.default_prepass_clip_sh = DRW_shader_create( + vert_str, NULL, datatoc_prepass_frag_glsl, "#define CLIP_PLANES\n"); + e_data.default_hair_prepass_sh = DRW_shader_create( vert_str, NULL, datatoc_prepass_frag_glsl, "#define HAIR_SHADER\n"); @@ -853,7 +856,7 @@ struct GPUMaterial *EEVEE_material_mesh_depth_get(struct Scene *scene, ma, engine, options, - (is_shadow) ? datatoc_shadow_vert_glsl : + (is_shadow) ? e_data.vert_shadow_shader_str : e_data.vert_shader_str, NULL, frag_str, @@ -1896,6 +1899,7 @@ void EEVEE_materials_free(void) } MEM_SAFE_FREE(e_data.frag_shader_lib); MEM_SAFE_FREE(e_data.vert_shader_str); + MEM_SAFE_FREE(e_data.vert_shadow_shader_str); MEM_SAFE_FREE(e_data.volume_shader_lib); DRW_SHADER_FREE_SAFE(e_data.default_hair_prepass_sh); DRW_SHADER_FREE_SAFE(e_data.default_hair_prepass_clip_sh); |