-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Example now renders in 3D using the tracked HMD position and shows cubes at the location of each hand controller.
- Loading branch information
Showing
8 changed files
with
493 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
#version 450 | ||
#extension GL_EXT_multiview : require | ||
|
||
layout(location = 0) in vec2 screen_coords; | ||
layout(location = 1) in vec3 vColor; | ||
layout(location = 0) out vec4 color; | ||
|
||
void main() { | ||
color = vec4(screen_coords, gl_ViewIndex, 1); | ||
color = vec4(vColor.r, (cos(vColor.gb * 4) + 1)/2.0, 1); | ||
} |
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#version 450 | ||
#extension GL_EXT_multiview : require | ||
|
||
layout(location = 0) in vec3 vPosition; | ||
|
||
layout(location = 0) out vec2 screen_coords; | ||
layout(location = 1) out vec3 vColor; | ||
|
||
layout(push_constant) uniform ModelTransform { | ||
mat4 model; | ||
}; | ||
|
||
struct Transform { | ||
mat4 view_project; | ||
}; | ||
|
||
layout(binding = 0) uniform Transforms { | ||
Transform transform[2]; | ||
}; | ||
|
||
void main() { | ||
vec4 world_pos = model * vec4(vPosition, 1.0); | ||
vec4 pos = transform[gl_ViewIndex].view_project * world_pos; | ||
gl_Position = pos; | ||
vColor = vec3(gl_VertexIndex/10.0, world_pos.gb); | ||
} |
Binary file not shown.
Oops, something went wrong.