diff options
Diffstat (limited to 'source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_id_vert.glsl')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_id_vert.glsl | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_id_vert.glsl b/source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_id_vert.glsl new file mode 100644 index 00000000000..f265bf9fc01 --- /dev/null +++ b/source/blender/gpu/shaders/gpu_shader_instance_variying_size_variying_id_vert.glsl @@ -0,0 +1,23 @@ + +uniform mat4 ViewProjectionMatrix; +uniform int baseId; + +/* ---- Instantiated Attribs ---- */ +in vec3 pos; + +/* ---- Per instance Attribs ---- */ +in mat4 InstanceModelMatrix; +#ifdef UNIFORM_SCALE +in float size; +#else +in vec3 size; +#endif +in int callId; + +flat out uint finalId; + +void main() +{ + gl_Position = ViewProjectionMatrix * InstanceModelMatrix * vec4(pos * size, 1.0); + finalId = uint(baseId + callId); +} |