mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-06 03:18:14 +00:00
REVIEWED: example: models_textures_tiling
shaders
This commit is contained in:
@@ -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);
|
||||
vec2 texCoord = fragTexCoord*tiling;
|
||||
|
||||
finalColor = texture(texture0, texCoord)*colDiffuse;
|
||||
}
|
||||
|
Reference in New Issue
Block a user