Differential D13360 Diff 46967 source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_color_vert.glsl
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_color_vert.glsl
| #ifndef USE_GPU_SHADER_CREATE_INFO | |||||
| uniform mat4 ViewProjectionMatrix; | uniform mat4 ViewProjectionMatrix; | ||||
| /* ---- Instantiated Attrs ---- */ | /* ---- Instantiated Attrs ---- */ | ||||
| in vec3 pos; | in vec3 pos; | ||||
| /* ---- Per instance Attrs ---- */ | /* ---- Per instance Attrs ---- */ | ||||
| in mat4 InstanceModelMatrix; | in mat4 InstanceModelMatrix; | ||||
| in vec4 color; | in vec4 color; | ||||
| #ifdef UNIFORM_SCALE | # ifdef UNIFORM_SCALE | ||||
| in float size; | in float size; | ||||
| #else | # else | ||||
| in vec3 size; | in vec3 size; | ||||
| #endif | # endif | ||||
| flat out vec4 finalColor; | flat out vec4 finalColor; | ||||
| #endif | |||||
| void main() | void main() | ||||
| { | { | ||||
| finalColor = color; | finalColor = color; | ||||
| vec4 wPos = InstanceModelMatrix * vec4(pos * size, 1.0); | vec4 wPos = InstanceModelMatrix * vec4(pos * size, 1.0); | ||||
| gl_Position = ViewProjectionMatrix * wPos; | gl_Position = ViewProjectionMatrix * wPos; | ||||
| #ifdef USE_WORLD_CLIP_PLANES | #ifdef USE_WORLD_CLIP_PLANES | ||||
| world_clip_planes_calc_clip_distance(wPos.xyz); | world_clip_planes_calc_clip_distance(wPos.xyz); | ||||
| #endif | #endif | ||||
| } | } | ||||