This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// vertex shader ---------------------------------- | |
uniform float t; | |
uniform float freq; | |
uniform float amp; | |
varying vec3 normal; | |
varying vec2 uv; | |
void main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// vertex shader | |
#version 120 | |
uniform vec3 light_position; // in eye space | |
varying vec3 light_dir; | |
varying vec3 eye_dir; | |
varying vec2 uv; | |
vec3 calculate_tangent(vec3 n) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 120 | |
// === vertex shader | |
// | |
// When you use OpenGL Shader Builder to execute shader programs, | |
// * select plane as geometry | |
// * set resolution to 640x480 | |
// * set scale_factor to 2.5 | |
uniform vec2 resolution; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 120 | |
// === vertex shader | |
// | |
// When you use OpenGL Shader Builder to execute shader programs, | |
// * select plane as geometry | |
// * set resolution to 640x480 | |
// * set scale_factor to 2.5 | |
uniform vec2 resolution; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 120 | |
uniform vec3 light_direction; | |
varying vec3 vertex_normal; | |
varying vec3 vertex_color; | |
void main(void) { | |
vec3 N = normalize(vertex_normal); | |
vec3 L = normalize(light_direction); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 120 | |
uniform vec3 light_direction; | |
varying vec3 vertex_normal; | |
varying vec3 vertex_color; | |
void main(void) { | |
vec3 N = normalize(vertex_normal); | |
vec3 L = normalize(light_direction); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// fragment shader | |
uniform sampler2D tex; | |
uniform vec2 viewport; | |
uniform vec2 origin; | |
uniform float radius; | |
uniform float attenuation; | |
uniform vec3 background_color; | |
void main() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 120 | |
struct Fog { | |
float start; | |
float density; | |
vec3 color; | |
}; | |
uniform Fog fog; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PShader sh; | |
PShader f; | |
PShape square; | |
PGraphics canvas; | |
void setup() { | |
size(640, 480, P3D); | |
canvas = createGraphics(width, height, P3D); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 120 | |
uniform float rows; | |
uniform float cols; | |
void main() | |
{ | |
int x = int(floor(gl_TexCoord[0].x * cols)); | |
int y = int(floor(gl_TexCoord[0].y * rows)); | |
if (mod(x + y, 2) == 0) { |
OlderNewer