Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee/shaders/surface_vert.glsl
| #pragma BLENDER_REQUIRE(common_hair_lib.glsl) | #pragma BLENDER_REQUIRE(common_hair_lib.glsl) | ||||
| #pragma BLENDER_REQUIRE(common_view_lib.glsl) | #pragma BLENDER_REQUIRE(common_view_lib.glsl) | ||||
| #pragma BLENDER_REQUIRE(common_math_lib.glsl) | #pragma BLENDER_REQUIRE(common_math_lib.glsl) | ||||
| #pragma BLENDER_REQUIRE(common_utiltex_lib.glsl) | #pragma BLENDER_REQUIRE(common_utiltex_lib.glsl) | ||||
| #pragma BLENDER_REQUIRE(closure_eval_surface_lib.glsl) | #pragma BLENDER_REQUIRE(closure_eval_surface_lib.glsl) | ||||
| #pragma BLENDER_REQUIRE(surface_lib.glsl) | #pragma BLENDER_REQUIRE(surface_lib.glsl) | ||||
| #ifndef HAIR_SHADER | |||||
| in vec3 pos; | |||||
| in vec3 nor; | |||||
| #endif | |||||
| RESOURCE_ID_VARYING | RESOURCE_ID_VARYING | ||||
| void main() | void main() | ||||
| { | { | ||||
| GPU_INTEL_VERTEX_SHADER_WORKAROUND | GPU_INTEL_VERTEX_SHADER_WORKAROUND | ||||
| PASS_RESOURCE_ID | PASS_RESOURCE_ID | ||||
| Show All 31 Lines | |||||
| # ifndef HAIR_SHADER | # ifndef HAIR_SHADER | ||||
| worldNormal = normalize(normal_object_to_world(nor)); | worldNormal = normalize(normal_object_to_world(nor)); | ||||
| # endif | # endif | ||||
| /* No need to normalize since this is just a rotation. */ | /* No need to normalize since this is just a rotation. */ | ||||
| viewNormal = normal_world_to_view(worldNormal); | viewNormal = normal_world_to_view(worldNormal); | ||||
| # ifndef NO_ATTRIB_LOAD | |||||
| attrib_load(); | attrib_load(); | ||||
| #endif | # endif | ||||
| #endif | |||||
| } | } | ||||
| #ifdef HAIR_SHADER | #ifdef HAIR_SHADER | ||||
| # ifdef OBINFO_LIB | # ifdef OBINFO_LIB | ||||
| vec3 attr_load_orco(samplerBuffer cd_buf) | vec3 attr_load_orco(samplerBuffer cd_buf) | ||||
| { | { | ||||
| vec3 P = hair_get_strand_pos(); | vec3 P = hair_get_strand_pos(); | ||||
| vec3 lP = transform_point(ModelMatrixInverse, P); | vec3 lP = transform_point(ModelMatrixInverse, P); | ||||
| ▲ Show 20 Lines • Show All 101 Lines • Show Last 20 Lines | |||||