~sircmpwn/xrgears

ref: 1ac9460a3fe49c9a47bc6d8262e124fd3d369758 xrgears/shaders/xrgears/sky.geom -rw-r--r-- 826 bytes
1ac9460aDrew DeVault Add wayland-direct window mode 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#version 450

#extension GL_ARB_viewport_array : enable

layout (triangles, invocations = 2) in;
layout (triangle_strip, max_vertices = 3) out;


layout (binding = 0) uniform UBOMatrices
{
	//mat4 normal[2];
	mat4 model;
} uboModel;

layout (binding = 2) uniform UBOCamera {
	mat4 projection[2];
	mat4 view[2];
	mat4 skyView[2];
	vec3 position;
} uboCamera;


// layout (location = 0) in vec3 inNormal[];

layout (location = 0) out vec3 outUVW;


void main(void)
{	
	for(int i = 0; i < gl_in.length(); i++)
	{
		outUVW = gl_in[i].gl_Position.xyz;
	  //outUVW.x *= -1.0;
		gl_Position = uboCamera.projection[gl_InvocationID] * uboCamera.skyView[gl_InvocationID] * gl_in[i].gl_Position;

		// Set the viewport index that the vertex will be emitted to
		gl_ViewportIndex = gl_InvocationID;

		EmitVertex();
	}
	EndPrimitive();
}