copied from the old Ppoject:
shaders, object class Modified to use better names and use Qt things
This commit is contained in:
@@ -5,5 +5,7 @@
|
||||
<qresource prefix="/shaders">
|
||||
<file>simple.frag</file>
|
||||
<file>simple.vert</file>
|
||||
<file>TextureShader.frag</file>
|
||||
<file>TextureShader.vert</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
12
MeshViewerQt/Resources/TextureShader.frag
Normal file
12
MeshViewerQt/Resources/TextureShader.frag
Normal file
@@ -0,0 +1,12 @@
|
||||
#version 450
|
||||
|
||||
// Input
|
||||
in vec2 UV;
|
||||
|
||||
// Output
|
||||
out vec4 color;
|
||||
|
||||
void main()
|
||||
{
|
||||
color = texture(textureSampler, UV).rgb;
|
||||
}
|
17
MeshViewerQt/Resources/TextureShader.vert
Normal file
17
MeshViewerQt/Resources/TextureShader.vert
Normal file
@@ -0,0 +1,17 @@
|
||||
#version 450
|
||||
|
||||
// Input vertex data, different for all executions of this shader
|
||||
layout(location = 0) in vec3 vertexPosition;
|
||||
layout(location = 1) in vec3 vertexUV;
|
||||
|
||||
// Input that stay constant fpr the whole mesh
|
||||
uniform mat4 MVP;
|
||||
|
||||
// Output
|
||||
out vec2 UV;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = MVP * vec4(vertexPosition, 1);
|
||||
UV = vertexUV;
|
||||
}
|
Reference in New Issue
Block a user