aboutsummaryrefslogtreecommitdiff
path: root/assets/shaders
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-08-23 05:53:33 +0200
committerhachem <im@hachem.wtf>2026-08-23 05:53:33 +0200
commite3aa33fc9a99d8b817bda42a567a4c347e18ab32 (patch)
treeda0e7ba3ce97a3e545d95d49e366be128c6d2112 /assets/shaders
parent43cee69e40be3cb8b0341c3fc94171fe01712b8c (diff)
[add]: unified interface
Diffstat (limited to 'assets/shaders')
-rw-r--r--assets/shaders/Geodesic.slang12
1 files changed, 5 insertions, 7 deletions
diff --git a/assets/shaders/Geodesic.slang b/assets/shaders/Geodesic.slang
index 9120ac0..7acbd78 100644
--- a/assets/shaders/Geodesic.slang
+++ b/assets/shaders/Geodesic.slang
@@ -28,8 +28,9 @@ struct Disk
float disk_r1; // inner edge (clamped to the ISCO, 3 r_s, below)
float disk_r2; // outer edge
float disk_num; // turbulence strength (0 = smooth physical disk)
- float thickness; // unused by the thin-disk model; kept for UBO layout
- float disk_density; // overall disk brightness / exposure
+ float thickness; // slab half-height (anti-aliases the edge-on disk)
+ float disk_density; // disk brightness / exposure
+ float temperature; // Kelvin at the flux peak (disk colour)
};
ConstantBuffer<Disk> disk;
@@ -73,8 +74,6 @@ static const float MAX_STEP_SIZE = 2e10;
// Display mapping for the (relative) Novikov-Thorne flux -> visible colour.
// The RADIAL PROFILE is physical; the absolute temperature scale is a display
// choice (a real Sgr A* disk is far cooler / redder than this).
-static const float T_PEAK = 4800.0; // Kelvin at the flux peak (display scale)
-static const float DISK_EXPOSURE = 0.9; // overall brightness of the disk
struct Hit
{
@@ -162,7 +161,7 @@ float3 DiskEmission(float3 P, float3 rayDir)
float xr = rc / rin;
float flux = max((1.0 - sqrt(1.0 / xr)) / (xr * xr * xr), 0.0);
float Tn = pow(flux / FLUX_PEAK, 0.25); // normalised temperature, peak ~ 1
- float Temit = T_PEAK * Tn;
+ float Temit = disk.temperature * Tn;
// Keplerian orbit (prograde about +Y). Locally-measured orbital speed for a
// Schwarzschild circular geodesic: v = sqrt( M / (r - 2M) ) = 0.5 c at ISCO.
@@ -197,8 +196,7 @@ float3 DiskEmission(float3 P, float3 rayDir)
bright *= max(turb, 0.0);
}
- float exposure = DISK_EXPOSURE * max(disk.disk_density, 0.0) * 10.0;
- return colour * bright * exposure;
+ return colour * bright * max(disk.disk_density, 0.0);
}
struct Ray