Shader Laboratory
842 subscribers
265 photos
15 videos
59 files
404 links
Shader Laboratory
a channel about shaders in telegram

ID : @smkgames

MyStack : goo.gl/smMuqe ๐Ÿ˜Ž๐Ÿ‘Œ
Download Telegram
Each pixel requires at least 3 bytes. One byte for each primary color.
Sometimes combined with a look-up table per primary
Each pixel can be one of 2^24 colors
Worry about your Endians
Indexed-Color Frame Buffers
Each pixel uses one byte
Each byte is an index into a color map
If the color map is not updated synchronously then Color-map flashing may occcur.
Color-map Animations
Each pixel may be one of 2^24 colors, but only 256 color be displayed at a time
High-Color Frame Buffers
opular PC/(SVGA) standard
Each pixel can be one of 2^15 colors
Can exhibit worse quantization effects than Indexed-color
Shader Laboratory
Photo
#define OR(A,B) (A+B-A*B)
#define AND(A,B) ((A)*(B))
#define NOT1(A) (1.-A)
#define NOT(A,B) AND(A,NOT1(B))

#define XOR(A,B) AND(OR(A,B),NOT1(AND(A,B)))

void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
vec2 uv = fragCoord/iResolution.xy;

uv.x += 0.1;
vec3 A = step(length(uv*2.-1.),0.2) * vec3(1.,0.,0.);
uv.x -= 0.1;
vec3 B = step(length(uv*2.-1.),0.2) * vec3(1.,1.,0.);

fragColor = vec4(XOR(A,B),1.0);
}

#Blending #Difference #LinearDodge
Shader Laboratory
Photo
void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
vec2 uv = fragCoord/iResolution.xy;

uv.x += 0.1;
vec3 A = step(length(uv*2.-1.),0.2) * vec3(1.,0.,0.);
uv.x -= 0.1;
vec3 B = step(length(uv*2.-1.),0.2) * vec3(1.,1.,0.);

fragColor = vec4(abs(A-B),1.0);
}


#Blending #Difference #LinearDodge
โค1