33 lines
No EOL
999 B
GLSL
33 lines
No EOL
999 B
GLSL
const vec3 BLUE = vec3(6.0, 152.0, 193.0) / 255.0;
|
|
const vec3 PURPLE = vec3(156.0, 64.0, 214.0) / 255.0;
|
|
|
|
uniform float iWidth = 0.004;
|
|
uniform float iMiddle = 0.5;
|
|
uniform float iShell = 1.0;
|
|
uniform float iSpeed = 1.0;
|
|
|
|
vec4 getProceduralColor() {
|
|
float intensity = 0.0;
|
|
float time = iGlobalTime / 5.0 * iSpeed;
|
|
vec3 position = _position.xyz * 1.5 * iWorldScale;
|
|
for (int i = 0; i < 1; ++i) {
|
|
float modifier = pow(2, i);
|
|
vec3 noisePosition = position * modifier;
|
|
float noise = snoise(vec4(noisePosition, time));
|
|
noise /= modifier;
|
|
intensity += noise;
|
|
}
|
|
intensity += 1.0;
|
|
intensity /= 2.0;
|
|
if (intensity > iMiddle + iWidth || intensity < iMiddle - iWidth) {
|
|
discard;
|
|
}
|
|
vec3 COLOR = BLUE;
|
|
return vec4(COLOR * iShell, 1);
|
|
}
|
|
|
|
|
|
float getProceduralColors(inout vec3 diffuse, inout vec3 specular, inout float shininess) {
|
|
specular = getProceduralColor().rgb;
|
|
return 1.0;
|
|
} |