Parcourir la source

REVIEWED: example: `models_textures_tiling` shaders

pull/4684/head
Ray il y a 5 jours
Parent
révision
cfbba79bd3
2 fichiers modifiés avec 17 ajouts et 11 suppressions
  1. +5
    -5
      examples/shaders/resources/shaders/glsl100/tiling.fs
  2. +12
    -6
      examples/shaders/resources/shaders/glsl330/tiling.fs

+ 5
- 5
examples/shaders/resources/shaders/glsl100/tiling.fs Voir le fichier

@ -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;
}

+ 12
- 6
examples/shaders/resources/shaders/glsl330/tiling.fs Voir le fichier

@ -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;
}

Chargement…
Annuler
Enregistrer