-
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.
Added offset and size settings to image binding in order to draw sprites from spritesheets
- Loading branch information
Showing
7 changed files
with
94 additions
and
31 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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!DOCTYPE scene SYSTEM "shaders.dtd"> | ||
<shader> | ||
<version> | ||
330 | ||
</version> | ||
<vertex> | ||
layout (location = 0) in vec3 Position; | ||
layout (location = 1) in vec2 TexCoord; | ||
|
||
uniform mat4 gWVP; | ||
uniform mat4 gObjMat; | ||
|
||
out vec2 TexCoord0; | ||
|
||
void main(){ | ||
gl_Position = gWVP * gObjMat * vec4(Position, 1.0); | ||
TexCoord0 = TexCoord; | ||
} | ||
</vertex> | ||
<fragment> | ||
in vec2 TexCoord0; | ||
in vec3 color; | ||
out vec4 FragColor; | ||
|
||
uniform sampler2D gSampler; | ||
|
||
void main() | ||
{ | ||
FragColor = vec4(1, 1, 1, texture2D(gSampler, TexCoord0).a); | ||
} | ||
</fragment> | ||
</shader> |
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
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
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