Pregunta | Respuesta |
Image:
Image (binary/octet-stream)
|
// Fragment Shader // Colour RED out_fragmentColour = vec4(1.0f, 0, 0, 1); |
Image:
Image (binary/octet-stream)
|
// Fragment Shader out_fragmentColour = vec4(frag.normal.x, 0, 0, 1); |
Image:
Image (binary/octet-stream)
|
// Fragment Shader out_fragmentColour = vec4(frag.normal, 1); |
Image:
Image (binary/octet-stream)
|
// Fragment Shader vec2 st = gl_FragCoord.xy/u_resolution.xy; vec2 pos = (vec2(0.5)-st)*2; out_fragmentColour = vec4(pos,0,1); |
Image:
Image (binary/octet-stream)
|
// Fragment Shader out_fragmentColour = vec4(mod (10 * pos.x, 1), mod (10 * pos.x, 1),0,1); |
Image:
Image (binary/octet-stream)
|
// Fragment Shader out_fragmentColour = vec4(sin (10 * pos.x), sin (10 * pos.x), 0, 1); |
Image:
Image (binary/octet-stream)
|
// Fragment Shader out_fragmentColour = vec4 (pow (sin (frequency * pos.x), sharpness) * pow (sin (frequency * pos.y), sharpness), 0, 0, 1); |
Image:
Image (binary/octet-stream)
|
// Fragment Shader st *= ((a+1.)*3.); // Scale up the space by 3 st = fract(st); // Wrap around 1.0 // Now we have 3 spaces that goes from |
Image:
Image (binary/octet-stream)
|
// Vertex Shader gl_Position = vec4 (VertexPosition.x, VertexPosition.y + 0.1 * sin (30. * VertexPosition.x), Vertex |
Image:
Image (binary/octet-stream)
|
// Vertex Shader float angle = a * 10; mat4 T = mat4 (vec4 (cos (angle), sin(angle), 0, 0), vec4 (-sin(angle), cos(angle), 0, 0), vec4 (0, 0, 1, 0), vec4 (0, 0, 0, 1) ); gl_Position = T * vec4 (VertexPosition, 1); |
Image:
Image (binary/octet-stream)
|
out_fragmentColour = vec4(frag.normal, 1); |
Image:
Image (binary/octet-stream)
|
mat4 normalMatrix = transpose(inverse(ViewMatrix * WorldMatrix)); VertexOut.normal = normalize((normalMatrix * vec4(VertexNormal, 0)).xyz); |
Image:
Image (binary/octet-stream)
|
float Ka = max(0,a); float Ia = max(0,b); vec3 AmbientColour = vec3 (0.4, 0.7, 0.3); colour = colour + Ka * Ia * AmbientColour; out_fragmentColour = vec4(colour,1.0); |
Image:
Image (binary/octet-stream)
|
vec3 N = normalize (frag.normal); vec3 L = normalize (vec3 (frag.EyeSpaceLightPosition - frag.EyeSpacePosition)); colour = L; |
Image:
Image (binary/octet-stream)
|
vec3 LightColour = vec3 (0.9, 0.9, 1.0); float Kd = max(0,c); // 4. Add in the diffuse component. colour = colour + MaterialColour * (Kd * max (0.0, dot (N, L))) * LightColour; |
Image:
Image (binary/octet-stream)
|
vec3 R = normalize(reflect (L, N)); colour = R; |
Image:
Image (binary/octet-stream)
|
vec3 V = normalize (vec3 (frag.EyeSpacePosition) - vec3 (0, 0, 0)); colour = V; |
Image:
Image (binary/octet-stream)
|
vec3 HighlightColour = vec3 (1.0, 1.0, 1.0); float Ks = max(0,d); float n = 30 * (max(0,e) + 3); colour = colour + MaterialColour * (Ks * pow (max (0.0, dot (R, V)), n)) * HighlightColour; |
Image:
Image (binary/octet-stream)
|
fragColour = vec4 ( texture2D( texture1, vec2(s,t))); out_fragmentColour = fragColour; |
¿Quieres crear tus propias Fichas gratiscon GoConqr? Más información.