mirror of
https://github.com/FMS-Cat/condition.git
synced 2025-08-17 19:06:42 +02:00
aesthetics: mm
This commit is contained in:
@@ -148,14 +148,7 @@ export class Trails {
|
|||||||
const material = new Material(
|
const material = new Material(
|
||||||
trailsRenderVert,
|
trailsRenderVert,
|
||||||
trailsRenderFrag,
|
trailsRenderFrag,
|
||||||
{
|
|
||||||
defines: {
|
|
||||||
'USE_CLIP': 'true',
|
|
||||||
'USE_VERTEX_COLOR': 'true'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
material.addUniform( 'colorVar', '1f', 0.1 );
|
|
||||||
material.addUniformTexture( 'samplerRandomStatic', options.textureRandomStatic );
|
material.addUniformTexture( 'samplerRandomStatic', options.textureRandomStatic );
|
||||||
|
|
||||||
if ( process.env.DEV ) {
|
if ( process.env.DEV ) {
|
||||||
|
20
src/main.ts
20
src/main.ts
@@ -253,16 +253,16 @@ light.color = [ 60.0, 60.0, 60.0 ];
|
|||||||
light.entity.transform.lookAt( new Vector3( [ -1.0, 2.0, 8.0 ] ) );
|
light.entity.transform.lookAt( new Vector3( [ -1.0, 2.0, 8.0 ] ) );
|
||||||
dog.root.children.push( light.entity );
|
dog.root.children.push( light.entity );
|
||||||
|
|
||||||
const light2 = new LightEntity( {
|
// const light2 = new LightEntity( {
|
||||||
root: dog.root,
|
// root: dog.root,
|
||||||
shadowMapFov: 90.0,
|
// shadowMapFov: 90.0,
|
||||||
shadowMapNear: 1.0,
|
// shadowMapNear: 1.0,
|
||||||
shadowMapFar: 20.0,
|
// shadowMapFar: 20.0,
|
||||||
namePrefix: process.env.DEV && 'light2',
|
// namePrefix: process.env.DEV && 'light2',
|
||||||
} );
|
// } );
|
||||||
light2.color = [ 50.0, 30.0, 40.0 ];
|
// light2.color = [ 50.0, 30.0, 40.0 ];
|
||||||
light2.entity.transform.lookAt( new Vector3( [ -4.0, -2.0, 6.0 ] ) );
|
// light2.entity.transform.lookAt( new Vector3( [ -4.0, -2.0, 6.0 ] ) );
|
||||||
dog.root.children.push( light2.entity );
|
// dog.root.children.push( light2.entity );
|
||||||
|
|
||||||
const camera = new CameraEntity( {
|
const camera = new CameraEntity( {
|
||||||
root: dog.root,
|
root: dog.root,
|
||||||
|
@@ -62,7 +62,7 @@ float ambientOcclusion( vec2 uv, vec3 position, vec3 normal ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ao = ao / float( AO_ITER );
|
ao = ao / float( AO_ITER );
|
||||||
return ao;
|
return pow( ao, 2.0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
// == main procedure ===============================================================================
|
// == main procedure ===============================================================================
|
||||||
|
@@ -60,6 +60,7 @@ void main() {
|
|||||||
|
|
||||||
vec3 col = pow( saturate( tex.xyz ), vec3( 0.4545 ) );
|
vec3 col = pow( saturate( tex.xyz ), vec3( 0.4545 ) );
|
||||||
col.x = linearstep( 0.0, 1.2, col.x + 0.2 * uv.y );
|
col.x = linearstep( 0.0, 1.2, col.x + 0.2 * uv.y );
|
||||||
|
col.z = linearstep( -0.1, 1.0, col.z );
|
||||||
col = colorMap( col );
|
col = colorMap( col );
|
||||||
|
|
||||||
fragColor = vec4( col, 1.0 );
|
fragColor = vec4( col, 1.0 );
|
||||||
|
@@ -266,7 +266,8 @@ void main() {
|
|||||||
#ifdef IS_FIRST_LIGHT
|
#ifdef IS_FIRST_LIGHT
|
||||||
// color = 0.5 + 0.5 * isect.normal;
|
// color = 0.5 + 0.5 * isect.normal;
|
||||||
// color = vec3( calcDepth( tex0.xyz ) );
|
// color = vec3( calcDepth( tex0.xyz ) );
|
||||||
// color = vec3( 0.8 ) * ( 1.0 - texture( samplerAo, isect.screenUv ).xyz );
|
// color = vec3( 0.5, 0.9, 0.6 ) * ( 1.0 - texture( samplerAo, isect.screenUv ).xyz );
|
||||||
|
// color = vec3( 0.5, 0.9, 0.6 ) * ( texture( samplerAo, isect.screenUv ).xyz );
|
||||||
#endif
|
#endif
|
||||||
// xfdA = shadeGradient( isect );
|
// xfdA = shadeGradient( isect );
|
||||||
|
|
||||||
|
@@ -38,5 +38,5 @@ void main() {
|
|||||||
fragPosition = vPosition;
|
fragPosition = vPosition;
|
||||||
fragNormal = vec4( vNormal, 1.0 );
|
fragNormal = vec4( vNormal, 1.0 );
|
||||||
fragColor = vec4( vColor.xyz, 1.0 );
|
fragColor = vec4( vColor.xyz, 1.0 );
|
||||||
fragWTF = vec4( vec3( 0.5, 0.5, 0.0 ), MTL_PBR );
|
fragWTF = vec4( vec3( 0.8, 0.8, 0.0 ), MTL_PBR );
|
||||||
}
|
}
|
||||||
|
@@ -72,8 +72,7 @@ void main() {
|
|||||||
// == assign varying variables ===================================================================
|
// == assign varying variables ===================================================================
|
||||||
vDice = random( computeUV.xy * 182.92 );
|
vDice = random( computeUV.xy * 182.92 );
|
||||||
|
|
||||||
vColor.xyz = 0.8 * mix( catColor( 2.0 + 40.0 * vDice.x ), vec3( 0.9 ), 0.0 );
|
vColor.xyz = vec3( 0.8 );
|
||||||
vColor.xyz = vec3( 0.2 );
|
|
||||||
|
|
||||||
vLife = tex0.w;
|
vLife = tex0.w;
|
||||||
|
|
||||||
|
@@ -34,7 +34,7 @@ mat2 rotate2D( float _t ) {
|
|||||||
void main() {
|
void main() {
|
||||||
if ( vColor.a < 0.0 ) { discard; }
|
if ( vColor.a < 0.0 ) { discard; }
|
||||||
|
|
||||||
float emissive = 7.0;
|
float emissive = 5.0;
|
||||||
// emissive *= 0.5 + 0.5 * sin( TAU * vRandom.z + 20.0 * time );
|
// emissive *= 0.5 + 0.5 * sin( TAU * vRandom.z + 20.0 * time );
|
||||||
|
|
||||||
fragPosition = vPosition;
|
fragPosition = vPosition;
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
const float HUGE = 9E16;
|
const float HUGE = 9E16;
|
||||||
const float PI = 3.14159265;
|
const float PI = 3.14159265;
|
||||||
const float TAU = 6.283185307;
|
const float TAU = 6.283185307;
|
||||||
|
const float COLOR_VAR = 0.1;
|
||||||
|
|
||||||
#define saturate(x) clamp(x,0.,1.)
|
#define saturate(x) clamp(x,0.,1.)
|
||||||
#define linearstep(a,b,x) saturate(((x)-(a))/((b)-(a)))
|
#define linearstep(a,b,x) saturate(((x)-(a))/((b)-(a)))
|
||||||
@@ -90,10 +91,10 @@ void main() {
|
|||||||
|
|
||||||
vColor.xyz = (
|
vColor.xyz = (
|
||||||
vRandom.y < 0.8
|
vRandom.y < 0.8
|
||||||
? pow( catColor( TAU * ( ( vRandom.x * 2.0 - 1.0 ) * colorVar + 0.6 + colorOffset ) ), vec3( 2.0 ) )
|
? pow( catColor( TAU * ( ( vRandom.x * 2.0 - 1.0 ) * COLOR_VAR + 0.0 ) ), vec3( 2.0 ) )
|
||||||
: vec3( 0.4 )
|
: vec3( 0.4 )
|
||||||
);
|
);
|
||||||
vColor.xyz = blurpleGradient( vLife );
|
// vColor.xyz = blurpleGradient( vLife );
|
||||||
// vColor.xyz = catColor( 3.0 + 4.0 * vLife );
|
// vColor.xyz = catColor( 3.0 + 4.0 * vLife );
|
||||||
|
|
||||||
vColor.w = ( velp.w < 0.5 && vel.w < 0.5 && 0.0 < vLife ) ? 1.0 : -1.0;
|
vColor.w = ( velp.w < 0.5 && vel.w < 0.5 && 0.0 < vLife ) ? 1.0 : -1.0;
|
||||||
|
Reference in New Issue
Block a user