larry babby and threejs for glsl

This commit is contained in:
Sam
2024-06-24 21:24:00 +12:00
parent 87d5dc634d
commit 907ebae4c0
6474 changed files with 1279596 additions and 8 deletions

View File

@@ -0,0 +1,19 @@
varying vec3 vColor;
void main() {
float distance = length(gl_PointCoord - vec2(0.5, 0.5));
float radius = 0.5; // The radius of the circle, where 0.5 is the edge of the point sprite
float intensity = 0.5; // Gaussian for smooth intensity increase
// float intensity = exp(-pow(distance * 3.0, 2.0)); // Gaussian for smooth intensity increase
// If the distance is greater than the radius, discard the fragment (make it transparent)
if (distance > radius) {
discard;
}
// Use the intensity to modulate the color within the circle
vec3 brightColor = vColor * intensity;
brightColor = clamp(brightColor, 0.0, 2.5);
gl_FragColor = vec4(brightColor, 1.0); // Full alpha within the circle
}