Created
December 1, 2023 09:22
-
-
Save transitive-bullshit/f51bcbd4ddcaad93f792cc9fe842ae72 to your computer and use it in GitHub Desktop.
Dexa logo superimposed onto the Las Vegas Sphere
This file contains hidden or 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
// paste this into https://whenistheweekend.com/theSphere.html | |
// shadertoy source: https://www.shadertoy.com/view/cldBz2 | |
uniform float time; | |
varying vec2 vUv; | |
varying vec3 vNormal; | |
void mainImage( out vec4 fragColor, in vec2 fragCoord ) | |
{ | |
vec2 center = vec2(0.25, 0.55); | |
vec2 pixel = fragCoord.xy; | |
vec2 iResolution = vec2(0.35, 0.5); | |
float size = 0.35; | |
float height = size * iResolution.y; | |
float width = size * iResolution.x; | |
vec2 diffR = abs(pixel - center); | |
// inside of rectangle | |
float insideRX = step(diffR.x, width / 2.0); | |
float insideRY = step(diffR.y, height / 2.0); | |
float insideR = insideRX * insideRY; | |
vec2 centerC = center - vec2(width * 0.5, 0); | |
float radiusC = height * 0.25; | |
vec2 diffC = pixel - centerC; | |
float insideC = step(radiusC, sqrt(diffC.x * diffC.x + diffC.y * diffC.y)); | |
float inside = insideR * insideC; | |
fragColor = vec4(inside, inside, inside, 1.0); | |
} | |
void main() { | |
vec2 fragCoord = vUv; | |
mainImage(gl_FragColor, fragCoord); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment