-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Electron7-7
committed
Nov 7, 2024
1 parent
98a225a
commit 993880a
Showing
3 changed files
with
85 additions
and
46 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,13 +1,14 @@ | ||
#version 460 core | ||
out vec4 FragColor; | ||
|
||
in vec3 vertexColor; | ||
// in vec3 vertexColor; | ||
in vec2 textureCoordinates; | ||
|
||
uniform sampler2D newTexture2D; | ||
|
||
void main() | ||
{ | ||
FragColor = vec4(vertexColor, 1.0); | ||
FragColor = texture(newTexture2D, textureCoordinates) * vec4(vertexColor, 1.0); | ||
// FragColor = vec4(vertexColor, 1.0); | ||
// FragColor = texture(newTexture2D, textureCoordinates) * vec4(vertexColor, 1.0); | ||
FragColor = texture(newTexture2D, textureCoordinates); | ||
}; |
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,16 +1,21 @@ | ||
#version 460 core | ||
layout (location = 0) in vec3 aPos; | ||
layout (location = 1) in vec3 aColor; | ||
layout (location = 2) in vec2 aTexCoord; | ||
layout (location = 1) in vec2 aTexCoord; | ||
// layout (location = 1) in vec3 aColor; // 2D plane | ||
// layout (location = 2) in vec2 aTexCoord; // 2D plane | ||
|
||
out vec3 vertexColor; | ||
// out vec3 vertexColor; | ||
out vec2 textureCoordinates; | ||
|
||
uniform mat4 transform; | ||
uniform mat4 model; | ||
uniform mat4 backwards_view; | ||
uniform mat4 projection; | ||
|
||
void main() | ||
{ | ||
gl_Position = transform * vec4(aPos, 1.0); | ||
vertexColor = aColor; | ||
// gl_Position = transform * vec4(aPos, 1.0); | ||
gl_Position = projection * backwards_view * model * vec4(aPos, 1.0); | ||
// vertexColor = aColor; | ||
textureCoordinates = aTexCoord; | ||
}; |