-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
REVIEWED: example:
models_textures_tiling
shaders
- Loading branch information
Showing
2 changed files
with
17 additions
and
11 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,14 +1,20 @@ | ||
#version 330 core | ||
|
||
uniform sampler2D diffuseMap; | ||
uniform vec2 tiling; | ||
|
||
// Input vertex attributes (from vertex shader) | ||
in vec2 fragTexCoord; | ||
in vec4 fragColor; | ||
|
||
// Input uniform values | ||
uniform sampler2D texture0; | ||
uniform vec4 colDiffuse; | ||
|
||
out vec4 fragColor; | ||
uniform vec2 tiling; | ||
|
||
out vec4 finalColor; | ||
|
||
void main() | ||
{ | ||
vec2 texCoord = fragTexCoord * tiling; | ||
fragColor = texture(diffuseMap, texCoord); | ||
vec2 texCoord = fragTexCoord*tiling; | ||
|
||
finalColor = texture(texture0, texCoord)*colDiffuse; | ||
} |