Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/eevee_materials.c
| Show First 20 Lines • Show All 348 Lines • ▼ Show 20 Lines | static char *eevee_get_volume_defines(int options) | ||||
| str = BLI_dynstr_get_cstring(ds); | str = BLI_dynstr_get_cstring(ds); | ||||
| BLI_dynstr_free(ds); | BLI_dynstr_free(ds); | ||||
| return str; | return str; | ||||
| } | } | ||||
| /** | /** | ||||
| * ssr_id can be null to disable ssr contribution. | * ssr_id can be null to disable ssr contribution. | ||||
| **/ | */ | ||||
| static void add_standard_uniforms( | static void add_standard_uniforms( | ||||
| DRWShadingGroup *shgrp, EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, | DRWShadingGroup *shgrp, EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, | ||||
| int *ssr_id, float *refract_depth, | int *ssr_id, float *refract_depth, | ||||
| bool use_diffuse, bool use_glossy, bool use_refract, | bool use_diffuse, bool use_glossy, bool use_refract, | ||||
| bool use_ssrefraction, bool use_alpha_blend) | bool use_ssrefraction, bool use_alpha_blend) | ||||
| { | { | ||||
| LightCache *lcache = vedata->stl->g_data->light_cache; | LightCache *lcache = vedata->stl->g_data->light_cache; | ||||
| ▲ Show 20 Lines • Show All 168 Lines • ▼ Show 20 Lines | static void EEVEE_update_viewvecs(float invproj[4][4], float winmat[4][4], float (*r_viewvecs)[4]) | ||||
| /** | /** | ||||
| * If ortho : view_vecs[0] is the near-bottom-left corner of the frustum and | * If ortho : view_vecs[0] is the near-bottom-left corner of the frustum and | ||||
| * view_vecs[1] is the vector going from the near-bottom-left corner to | * view_vecs[1] is the vector going from the near-bottom-left corner to | ||||
| * the far-top-right corner. | * the far-top-right corner. | ||||
| * If Persp : view_vecs[0].xy and view_vecs[1].xy are respectively the bottom-left corner | * If Persp : view_vecs[0].xy and view_vecs[1].xy are respectively the bottom-left corner | ||||
| * when Z = 1, and top-left corner if Z = 1. | * when Z = 1, and top-left corner if Z = 1. | ||||
| * view_vecs[0].z the near clip distance and view_vecs[1].z is the (signed) | * view_vecs[0].z the near clip distance and view_vecs[1].z is the (signed) | ||||
| * distance from the near plane to the far clip plane. | * distance from the near plane to the far clip plane. | ||||
| **/ | */ | ||||
| copy_v4_v4(r_viewvecs[0], view_vecs[0]); | copy_v4_v4(r_viewvecs[0], view_vecs[0]); | ||||
| /* we need to store the differences */ | /* we need to store the differences */ | ||||
| r_viewvecs[1][0] = view_vecs[1][0] - view_vecs[0][0]; | r_viewvecs[1][0] = view_vecs[1][0] - view_vecs[0][0]; | ||||
| r_viewvecs[1][1] = view_vecs[2][1] - view_vecs[0][1]; | r_viewvecs[1][1] = view_vecs[2][1] - view_vecs[0][1]; | ||||
| r_viewvecs[1][2] = view_vecs[3][2] - view_vecs[0][2]; | r_viewvecs[1][2] = view_vecs[3][2] - view_vecs[0][2]; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 286 Lines • ▼ Show 20 Lines | struct GPUMaterial *EEVEE_material_hair_get( | ||||
| MEM_freeN(defines); | MEM_freeN(defines); | ||||
| return mat; | return mat; | ||||
| } | } | ||||
| /** | /** | ||||
| * Create a default shading group inside the given pass. | * Create a default shading group inside the given pass. | ||||
| **/ | */ | ||||
| static struct DRWShadingGroup *EEVEE_default_shading_group_create( | static struct DRWShadingGroup *EEVEE_default_shading_group_create( | ||||
| EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, DRWPass *pass, | EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, DRWPass *pass, | ||||
| bool is_hair, bool is_flat_normal, bool use_blend, bool use_ssr, int shadow_method) | bool is_hair, bool is_flat_normal, bool use_blend, bool use_ssr, int shadow_method) | ||||
| { | { | ||||
| EEVEE_EffectsInfo *effects = vedata->stl->effects; | EEVEE_EffectsInfo *effects = vedata->stl->effects; | ||||
| static int ssr_id; | static int ssr_id; | ||||
| ssr_id = (use_ssr) ? 1 : -1; | ssr_id = (use_ssr) ? 1 : -1; | ||||
| int options = VAR_MAT_MESH; | int options = VAR_MAT_MESH; | ||||
| Show All 12 Lines | static struct DRWShadingGroup *EEVEE_default_shading_group_create( | ||||
| DRWShadingGroup *shgrp = DRW_shgroup_create(e_data.default_lit[options], pass); | DRWShadingGroup *shgrp = DRW_shgroup_create(e_data.default_lit[options], pass); | ||||
| add_standard_uniforms(shgrp, sldata, vedata, &ssr_id, NULL, true, true, false, false, use_blend); | add_standard_uniforms(shgrp, sldata, vedata, &ssr_id, NULL, true, true, false, false, use_blend); | ||||
| return shgrp; | return shgrp; | ||||
| } | } | ||||
| /** | /** | ||||
| * Create a default shading group inside the default pass without standard uniforms. | * Create a default shading group inside the default pass without standard uniforms. | ||||
| **/ | */ | ||||
| static struct DRWShadingGroup *EEVEE_default_shading_group_get( | static struct DRWShadingGroup *EEVEE_default_shading_group_get( | ||||
| EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, | EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, | ||||
| Object *ob, ParticleSystem *psys, ModifierData *md, | Object *ob, ParticleSystem *psys, ModifierData *md, | ||||
| bool is_hair, bool is_flat_normal, bool use_ssr, int shadow_method) | bool is_hair, bool is_flat_normal, bool use_ssr, int shadow_method) | ||||
| { | { | ||||
| static int ssr_id; | static int ssr_id; | ||||
| ssr_id = (use_ssr) ? 1 : -1; | ssr_id = (use_ssr) ? 1 : -1; | ||||
| int options = VAR_MAT_MESH; | int options = VAR_MAT_MESH; | ||||
| Show All 31 Lines | static struct DRWShadingGroup *EEVEE_default_shading_group_get( | ||||
| } | } | ||||
| else { | else { | ||||
| return DRW_shgroup_create(e_data.default_lit[options], vedata->psl->default_pass[options]); | return DRW_shgroup_create(e_data.default_lit[options], vedata->psl->default_pass[options]); | ||||
| } | } | ||||
| } | } | ||||
| /** | /** | ||||
| * Create a default shading group inside the lookdev pass without standard uniforms. | * Create a default shading group inside the lookdev pass without standard uniforms. | ||||
| **/ | */ | ||||
| static struct DRWShadingGroup *EEVEE_lookdev_shading_group_get( | static struct DRWShadingGroup *EEVEE_lookdev_shading_group_get( | ||||
| EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, | EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata, | ||||
| bool use_ssr, int shadow_method) | bool use_ssr, int shadow_method) | ||||
| { | { | ||||
| static int ssr_id; | static int ssr_id; | ||||
| ssr_id = (use_ssr) ? 1 : -1; | ssr_id = (use_ssr) ? 1 : -1; | ||||
| int options = VAR_MAT_MESH | VAR_MAT_LOOKDEV; | int options = VAR_MAT_MESH | VAR_MAT_LOOKDEV; | ||||
| ▲ Show 20 Lines • Show All 890 Lines • Show Last 20 Lines | |||||