From bd49bd525f4c6c6c15c4142bf42d1dd38be6fc16 Mon Sep 17 00:00:00 2001 From: pryazha Date: Sun, 19 Jan 2025 17:33:44 +0500 Subject: initial commit --- instancing/shaders/instanced_arrays.vs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 instancing/shaders/instanced_arrays.vs (limited to 'instancing/shaders/instanced_arrays.vs') diff --git a/instancing/shaders/instanced_arrays.vs b/instancing/shaders/instanced_arrays.vs new file mode 100644 index 0000000..e7bbeb7 --- /dev/null +++ b/instancing/shaders/instanced_arrays.vs @@ -0,0 +1,14 @@ +#version 330 core +layout(location = 0) in vec2 apos; +layout(location = 1) in vec3 acolor; +layout(location = 2) in vec2 aoffset; + +out vec3 color; + +void +main(void) +{ + color = acolor; + vec2 pos = apos*(gl_InstanceID/100.0f); + gl_Position = vec4(pos+aoffset, 0.0f, 1.0f); +} -- cgit v1.2.3