mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-06 19:38:15 +00:00
REVIEWED: example: models_textures_tiling
shaders
This commit is contained in:
@@ -7,15 +7,15 @@ varying vec2 fragTexCoord;
|
|||||||
varying vec4 fragColor;
|
varying vec4 fragColor;
|
||||||
|
|
||||||
// Input uniform values
|
// Input uniform values
|
||||||
uniform sampler2D diffuseMap;
|
uniform sampler2D texture0;
|
||||||
uniform vec4 tiling;
|
uniform vec4 colDiffuse;
|
||||||
|
|
||||||
// NOTE: Add here your custom variables
|
// NOTE: Add here your custom variables
|
||||||
|
uniform vec2 tiling;
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec2 texCoord = fragTexCoord*tiling;
|
vec2 texCoord = fragTexCoord*tiling;
|
||||||
fragColor = texture2D(diffuseMap, texCoord);
|
|
||||||
|
|
||||||
gl_FragColor = fragColor;
|
gl_FragColor = texture2D(texture0, texCoord)*colDiffuse;
|
||||||
}
|
}
|
||||||
|
@@ -1,14 +1,20 @@
|
|||||||
#version 330 core
|
#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;
|
uniform vec2 tiling;
|
||||||
|
|
||||||
in vec2 fragTexCoord;
|
out vec4 finalColor;
|
||||||
|
|
||||||
out vec4 fragColor;
|
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec2 texCoord = fragTexCoord*tiling;
|
vec2 texCoord = fragTexCoord*tiling;
|
||||||
fragColor = texture(diffuseMap, texCoord);
|
|
||||||
|
finalColor = texture(texture0, texCoord)*colDiffuse;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user