Skip to content

Conversation

@jcyuan06
Copy link

The Doppler effect is added mainly by modifying the function: float3 accretionDiskColor(float3 pos, float3 base1, float3 base2, float3 blackHoleOrigin) in BlackHoleAccretionDisk.shader.
The Doppler effect is tweakable by adjusting four configurable parameters added:

dopplerEffectIntensityRate = 
dopplerEffectIntensityFactor = 
dopplerEffectIntensityOffset = 
dopplerEffectColorFactor = 

jcyuan06 and others added 3 commits May 10, 2024 15:02
Added a parameter `schwarzschildRadius` to replace `gravity` to control the Schwarzschild radius of the black hole. Old configs are still compatible.

rayAccel = normalize(gravityVector) * gravity / (rayDistance * rayDistance);
//rayAccel = normalize(gravityVector) * gravity / (rayDistance * rayDistance);
rayAccel = normalize(gravityVector) * schwarzschildRadius*schwarzschildRadius/1.04976E9 / (rayDistance * rayDistance);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest precomputing this value before passing it to the shader.

Also there is now blackHoleRadius and schwarzschildRadius, what's the difference between both? Can one be expressed in terms of the other?

Also remove the gravity parameter if it's no longer used

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In v0.994, I switched back to gravity in the shader. Now gravity can be pre-computed using schwarzschildRadius.

blackHoleRadius is used in the original code. It's the scaled space radius of the black hole and equals to schwarzschildRadius/6000. schwarzschildRadius functions as an alternative to gravity, which equals the actual Schwarzschild radius in meters.

Copy link
Owner

@LGhassen LGhassen May 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, I just didn't want there to be multiple radius variables in the shader code. So schwarzschildRadius is basically just the radius in local space units but exposed to the user? Sounds good.

Adjustments related to `schwarzschildRadius`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants