Skip to content

Commit b3bc703

Browse files
cjw6kclaude
andcommitted
chore: Remove sun texture, make Sun fully procedural
Sun shader no longer needs a texture - it's fully procedural with animated surface turbulence, plasma effects, and multi-layer corona. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 4cbc065 commit b3bc703

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed
-803 KB
Binary file not shown.

tidal-harmonics/src/components/canvas/Sun.tsx

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import { useRef, useMemo } from 'react';
2-
import { useFrame, useLoader } from '@react-three/fiber';
3-
import { TextureLoader, AdditiveBlending, BackSide } from 'three';
2+
import { useFrame } from '@react-three/fiber';
3+
import { AdditiveBlending, BackSide } from 'three';
44
import type { ShaderMaterial } from 'three';
55
import { useScene } from '@/hooks/useScene';
66
import { useCelestialPositions } from '@/hooks/useCelestialPositions';
7-
import { TEXTURE_URLS } from '@/lib/constants';
87

98
// Simplex noise for surface turbulence
109
const noiseFunction = `
@@ -99,7 +98,6 @@ const sunVertexShader = `
9998
`;
10099

101100
const sunFragmentShader = `
102-
uniform sampler2D map;
103101
uniform float time;
104102
105103
varying vec2 vUv;
@@ -109,8 +107,7 @@ const sunFragmentShader = `
109107
${noiseFunction}
110108
111109
void main() {
112-
// Base texture
113-
vec3 texColor = texture2D(map, vUv).rgb;
110+
// Fully procedural - no texture needed
114111
115112
// Animated surface turbulence - multiple layers for complexity
116113
vec3 noisePos = vPosition * 2.0 + vec3(time * 0.05, time * 0.03, time * 0.04);
@@ -165,8 +162,8 @@ const sunFragmentShader = `
165162
// Apply subtle edge variation and pulse
166163
surfaceColor *= edgeFactor * deepPulse;
167164
168-
// Blend with original texture for photorealistic detail
169-
vec3 finalColor = mix(surfaceColor, texColor * 1.3, 0.25);
165+
// Final surface color (fully procedural)
166+
vec3 finalColor = surfaceColor;
170167
171168
// Final intensity boost - make it HOT
172169
finalColor *= 1.5 * pulse;
@@ -260,15 +257,13 @@ const coronaFragmentShader = `
260257
export function Sun() {
261258
const { scale } = useScene();
262259
const { sun } = useCelestialPositions();
263-
const texture = useLoader(TextureLoader, TEXTURE_URLS.sun.surface2k);
264260
const materialRef = useRef<ShaderMaterial>(null);
265261

266262
const uniforms = useMemo(
267263
() => ({
268-
map: { value: texture },
269264
time: { value: 0 },
270265
}),
271-
[texture]
266+
[]
272267
);
273268

274269
// Multiple corona layers for soft falloff - increased intensity for dramatic effect

tidal-harmonics/src/lib/constants.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ export const TEXTURE_URLS = {
5151
moon: {
5252
surface2k: `${BASE}textures/moon/moon_2k.jpg`,
5353
},
54-
sun: {
55-
surface2k: `${BASE}textures/sun/sun_2k.jpg`,
56-
},
5754
} as const;
5855

5956
// Julian Date constants

0 commit comments

Comments
 (0)