Skip to content

Commit 1923b1d

Browse files
committed
Reset the accretion disk turbulence on type change
1 parent e064d85 commit 1923b1d

3 files changed

Lines changed: 4 additions & 1 deletion

File tree

js/app/ui/gui.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,8 @@ function setupGUI() {
610610
onChange: function() {
611611
updateDependentVisibility();
612612
updateShader();
613+
observer.turbulenceTimeOffset = -observer.time;
614+
shader.needsUpdate = true;
613615
},
614616
help: 'Thin disk: Novikov-Thorne (quasars/XRBs). Thick torus: ADAF/RIAF (M87*/Sgr A*). Slim disk: super-Eddington.'
615617
});

shaders/raytracer/core/defines.glsl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ const float SPECTRUM_TEX_RATIO_RANGE = 6.48053329012;
2929

3030
uniform vec2 resolution;
3131
uniform float time;
32+
uniform float turbulence_time_offset;
3233
uniform float turbulence_loop_enabled;
3334
uniform float turbulence_loop_seconds;
3435

shaders/raytracer/output/trace_ray.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ vec4 trace_ray(vec3 ray) {
7979
float phi = 0.0;
8080

8181
float t = time;
82-
float turb_t = loopable_turbulence_time(time);
82+
float turb_t = loopable_turbulence_time(time + turbulence_time_offset);
8383
float dt = 1.0;
8484
bool shadow_capture = false;
8585

0 commit comments

Comments
 (0)