shader modifs

This commit is contained in:
Clément Le Bihan
2021-06-16 14:16:05 +02:00
parent b6aa3f184a
commit da8b7fe4c3
2 changed files with 6 additions and 1 deletions
+4 -1
View File
@@ -4,6 +4,7 @@ precision mediump float;
// Input vertex attributes (from vertex shader)
varying vec3 fragPosition;
varying vec3 fragNormal;
varying vec2 fragTexCoord;
uniform sampler2D texture0;
@@ -13,7 +14,9 @@ void main() {
// Texel color fetching from texture sampler
// NOTE: Implement here your fragment shader code
vec4 tmp = texture2D(texture0, fragTexCoord);
vec4 tmp;
tmp.rgb = texture2D(texture0, fragTexCoord).rgb;
tmp.a = alpha;
+2
View File
@@ -98,6 +98,7 @@ uniform float radius;
varying vec3 fragPosition;
varying vec2 fragTexCoord;
varying vec4 fragColor;
varying vec3 fragNormal;
// NOTE: Add here your custom variables
@@ -105,6 +106,7 @@ void main() {
// Send vertex attributes to fragment shader
fragPosition = vertexPosition + vertexPosition * vec3(cnoise(vec3(vertexNormal + vec3(frame))) * 0.5);
fragColor = vertexColor;
fragNormal = vertexNormal;
fragTexCoord = vertexTexCoord;
// Calculate final vertex position
gl_Position = mvp * vec4(fragPosition , radius);