mirror of
https://github.com/FMS-Cat/condition.git
synced 2025-08-10 16:04:31 +02:00
aesthetics: update condition
This commit is contained in:
@@ -2,11 +2,14 @@
|
|||||||
|
|
||||||
precision highp float;
|
precision highp float;
|
||||||
|
|
||||||
|
const float RADIUS_CULL_SPHERE = 1.5;
|
||||||
|
|
||||||
const int MTL_UNLIT = 1;
|
const int MTL_UNLIT = 1;
|
||||||
|
|
||||||
#define saturate(i) clamp(i,0.,1.)
|
#define saturate(i) clamp(i,0.,1.)
|
||||||
#define linearstep(a,b,x) saturate(((x)-(a))/((b)-(a)))
|
#define linearstep(a,b,x) saturate(((x)-(a))/((b)-(a)))
|
||||||
|
|
||||||
|
in float vScale;
|
||||||
in float vPhase;
|
in float vPhase;
|
||||||
in vec3 vNormal;
|
in vec3 vNormal;
|
||||||
in vec4 vPosition;
|
in vec4 vPosition;
|
||||||
@@ -35,10 +38,18 @@ uniform float phaseOffset;
|
|||||||
uniform float phaseWidth;
|
uniform float phaseWidth;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
float phase = fract( 2.0 * vPhase + vHuh.z + 0.1 * time + vHuh.y + phaseOffset );
|
float phase = fract( 2.0 * vPhase + vHuh.z + 0.1 * time + vHuh.y + phaseOffset / vScale );
|
||||||
if ( phase > phaseWidth ) { discard; }
|
if ( phase > phaseWidth ) { discard; }
|
||||||
|
|
||||||
vec3 color = vec3( 2.0 );
|
float lenFromCenter = length( vPosition.xyz );
|
||||||
|
if ( lenFromCenter < RADIUS_CULL_SPHERE ) { discard; }
|
||||||
|
|
||||||
|
float colorPhase = exp( -4.0 * ( lenFromCenter - RADIUS_CULL_SPHERE ) );
|
||||||
|
vec3 color = mix(
|
||||||
|
vec3( 2.0 ),
|
||||||
|
vec3( 0.0 ),
|
||||||
|
colorPhase
|
||||||
|
);
|
||||||
|
|
||||||
#ifdef FORWARD
|
#ifdef FORWARD
|
||||||
fragColor = vec4( color, 1.0 );
|
fragColor = vec4( color, 1.0 );
|
||||||
|
@@ -8,6 +8,7 @@ layout (location = 0) in vec2 what;
|
|||||||
layout (location = 1) in vec4 huh;
|
layout (location = 1) in vec4 huh;
|
||||||
|
|
||||||
out float vPhase;
|
out float vPhase;
|
||||||
|
out float vScale;
|
||||||
out vec3 vNormal;
|
out vec3 vNormal;
|
||||||
out vec4 vPosition;
|
out vec4 vPosition;
|
||||||
out vec4 vHuh;
|
out vec4 vHuh;
|
||||||
@@ -36,6 +37,9 @@ void main() {
|
|||||||
vec3 tube = 0.1 * basis * vec3( sin( theta ), cos( theta ), 0.0 );
|
vec3 tube = 0.1 * basis * vec3( sin( theta ), cos( theta ), 0.0 );
|
||||||
vNormal = ( normalMatrix * vec4( tube, 1.0 ) ).xyz;
|
vNormal = ( normalMatrix * vec4( tube, 1.0 ) ).xyz;
|
||||||
|
|
||||||
|
vScale = exp( 2.0 * fs( huh.z + 2.56 * huh.y ) );
|
||||||
|
vPosition.xyz *= vScale;
|
||||||
|
|
||||||
vPosition.xyz += tube;
|
vPosition.xyz += tube;
|
||||||
|
|
||||||
vPosition = modelMatrix * vPosition;
|
vPosition = modelMatrix * vPosition;
|
||||||
|
Reference in New Issue
Block a user