REVIEWED: example: models_textures_tiling
shaders
This commit is contained in:
parent
fddfb58f85
commit
cfbba79bd3
2 changed files with 17 additions and 11 deletions
|
@ -7,15 +7,15 @@ varying vec2 fragTexCoord;
|
|||
varying vec4 fragColor;
|
||||
|
||||
// Input uniform values
|
||||
uniform sampler2D diffuseMap;
|
||||
uniform vec4 tiling;
|
||||
uniform sampler2D texture0;
|
||||
uniform vec4 colDiffuse;
|
||||
|
||||
// NOTE: Add here your custom variables
|
||||
uniform vec2 tiling;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 texCoord = fragTexCoord*tiling;
|
||||
fragColor = texture2D(diffuseMap, texCoord);
|
||||
|
||||
gl_FragColor = fragColor;
|
||||
gl_FragColor = texture2D(texture0, texCoord)*colDiffuse;
|
||||
}
|
||||
|
|
|
@ -1,14 +1,20 @@
|
|||
#version 330 core
|
||||
|
||||
uniform sampler2D diffuseMap;
|
||||
// Input vertex attributes (from vertex shader)
|
||||
in vec2 fragTexCoord;
|
||||
in vec4 fragColor;
|
||||
|
||||
// Input uniform values
|
||||
uniform sampler2D texture0;
|
||||
uniform vec4 colDiffuse;
|
||||
|
||||
uniform vec2 tiling;
|
||||
|
||||
in vec2 fragTexCoord;
|
||||
|
||||
out vec4 fragColor;
|
||||
out vec4 finalColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 texCoord = fragTexCoord*tiling;
|
||||
fragColor = texture(diffuseMap, texCoord);
|
||||
|
||||
finalColor = texture(texture0, texCoord)*colDiffuse;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue