Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/dgreenheck/webgpu-black-hole
/ functions
Functions
45 in github.com/dgreenheck/webgpu-black-hole
⨍
Functions
45
◇
Types & classes
6
↓ 6 callers
Function
catmullRom
* Catmull-Rom spline interpolation for smooth continuous curves. * Unlike per-segment easing, this creates fluid motion without pauses at waypoints.
camera-animation.js:14
↓ 4 callers
Method
getKeyframe
* Get keyframe by index with wrapping for seamless looping
camera-animation.js:83
↓ 4 callers
Method
showNotification
* Show a temporary notification message.
ui.js:113
↓ 3 callers
Method
update
* Main update method - called each frame.
blackhole.js:224
↓ 3 callers
Method
updateUniforms
* Update uniform values from config object. * Called when UI controls change.
blackhole.js:150
↓ 2 callers
Method
createBlackHole
* Create the black hole visualization mesh. * Uses a large inverted sphere as the render surface with a custom TSL shader.
blackhole.js:113
↓ 2 callers
Function
getBlackbodyColor
(tempK)
blackhole-shader.js:126
↓ 2 callers
Function
normalizeColorToHex
* Convert a color value to hex string. * Handles Tweakpane's color object format {r, g, b} or hex strings.
main.js:34
↓ 1 callers
Function
animate
()
main.js:359
↓ 1 callers
Method
calculateTotalDuration
* Calculate the total duration of all keyframes
camera-animation.js:76
↓ 1 callers
Function
clearConfig
* Clear configuration from localStorage.
main.js:94
↓ 1 callers
Function
createAccretionDiskColor
(uniforms)
blackhole-shader.js:239
↓ 1 callers
Function
createBlackHoleShader
(uniforms)
blackhole-shader.js:304
↓ 1 callers
Function
createNebulaField
(uniforms)
blackhole-shader.js:224
↓ 1 callers
Method
createRaymarchingShader
* Main shader creation method. * Builds the complete raymarching shader using Three.js TSL.
blackhole.js:138
↓ 1 callers
Function
createStarField
(uniforms)
blackhole-shader.js:195
↓ 1 callers
Method
getKeyframeInfo
* Get the current keyframe index and local time within that keyframe
camera-animation.js:135
↓ 1 callers
Method
initializeUniforms
* Initialize all shader uniforms with default values. * These can be updated in real-time via the UI.
blackhole.js:40
↓ 1 callers
Method
interpolateSpline
* Interpolate using Catmull-Rom spline for smooth continuous motion
camera-animation.js:162
↓ 1 callers
Function
loadConfig
* Load configuration from localStorage, merging with defaults.
main.js:51
↓ 1 callers
Method
onResize
* Handle window resize.
blackhole.js:232
↓ 1 callers
Method
regenerate
* Regenerate the black hole mesh (e.g., after config changes).
blackhole.js:239
↓ 1 callers
Function
saveConfig
* Save current configuration to localStorage. * Normalizes color values to hex strings before saving.
main.js:75
↓ 1 callers
Method
setBloomNode
(bloomNode)
ui.js:525
↓ 1 callers
Method
setupBlackHoleFolder
()
ui.js:160
↓ 1 callers
Function
setupBloom
()
main.js:249
↓ 1 callers
Method
setupBloomFolder
()
ui.js:485
↓ 1 callers
Method
setupCameraFolder
()
ui.js:35
↓ 1 callers
Method
setupConfigFolder
()
ui.js:71
↓ 1 callers
Method
setupNebulaFolder
()
ui.js:390
↓ 1 callers
Method
setupPerformanceFolder
()
ui.js:146
↓ 1 callers
Method
setupStarsFolder
()
ui.js:340
↓ 1 callers
Method
setupUI
()
ui.js:21
↓ 1 callers
Method
start
* Start the camera animation
camera-animation.js:91
↓ 1 callers
Method
stop
* Stop the camera animation and restore controls
camera-animation.js:108
↓ 1 callers
Method
toggle
* Toggle animation on/off
camera-animation.js:123
↓ 1 callers
Method
updateCamera
* Update camera position uniform from Three.js camera.
blackhole.js:211
↓ 1 callers
Function
updateFPS
()
main.js:334
↓ 1 callers
Method
updateFPS
(fps)
ui.js:520
Method
constructor
(camera, controls)
camera-animation.js:54
Method
constructor
(config, callbacks)
ui.js:11
Method
constructor
(scene, config)
blackhole.js:29
Method
getProgress
* Get current animation progress (0-1)
camera-animation.js:217
Method
playing
* Check if animation is currently playing
camera-animation.js:224
Method
update
* Update the animation (call every frame) * @param {number} deltaTime - Time since last frame in seconds
camera-animation.js:188