feat: cursor-steered headlights light the hero name, plates and world
This commit is contained in:
@@ -10,6 +10,7 @@ import type { RenderQualitySettings } from '@/scene/render-quality';
|
||||
import type { SectionId } from '@/content/types';
|
||||
import { signAccentFor } from './sign';
|
||||
import { WORLD_DEPTH, WORLD_FAR_Z } from './metrics';
|
||||
import { BEAM_PARS, beamUniforms } from './headlights';
|
||||
|
||||
/** Roadside districts: each chapter raises its own landscape out of the ground
|
||||
* (server rows for Infrastructure, a workshop and cranes for Builds, a container
|
||||
@@ -201,7 +202,7 @@ export function createDistricts(
|
||||
resources.own(
|
||||
'material',
|
||||
new THREE.ShaderMaterial({
|
||||
uniforms: { ...shared, ...service, uRise: rise, uPieceHeight: height },
|
||||
uniforms: { ...shared, ...service, ...beamUniforms, uRise: rise, uPieceHeight: height },
|
||||
vertexShader: VERTEX,
|
||||
fragmentShader: `
|
||||
uniform vec3 uAccent;
|
||||
@@ -209,6 +210,7 @@ export function createDistricts(
|
||||
varying float vDepth;
|
||||
varying float vRise;
|
||||
varying float vHeight;
|
||||
${BEAM_PARS}
|
||||
${serviced ? SERVICE_PARS : ''}
|
||||
void main() {
|
||||
${FADES}
|
||||
@@ -233,6 +235,9 @@ export function createDistricts(
|
||||
float power = mix(1.0, mix(0.1, 1.0, relit), dimmed);
|
||||
color += mix(uAccent, uServiceColor, dimmed * relit) * (rim * 0.22 + crown * 0.05) * power;` : `
|
||||
color += uAccent * (rim * 0.22 + crown * 0.05);`}
|
||||
// HIGH BEAM: the headlights rake the facades they face.
|
||||
vec3 toLamp = normalize(uBeamOrigin - vWorld);
|
||||
color += vec3(1.0, 0.84, 0.66) * headlightBeam(vWorld) * (0.25 + 0.75 * abs(dot(n, toLamp))) * 0.35;
|
||||
gl_FragColor = vec4(color, 1.0);
|
||||
#include <tonemapping_fragment>
|
||||
#include <colorspace_fragment>
|
||||
|
||||
Reference in New Issue
Block a user