  # Bongseok

Member

3

4 Neutral

• Rank
Newbie

• Role
Programmer
• Interests
Programming

• Github
xtozero

## Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

1. ## DX11 Precomputed Atmospheric scattering

Hello~ I finally found out Why '(nu - muS * mu) / v.x' is sun direction It's Spherical trigonometry. this article helped me a lot. https://en.wikipedia.org/wiki/Spherical_trigonometry#Derivation_of_the_cosine_rule
2. ## DX11 Precomputed Atmospheric scattering

Hi GoliathForge Thank you for your reply I have checked improved version. but I have still difficulty understanding. // Compute unit direction vectors for the zenith, the view direction omega and // and the sun direction omega_s, such that the cosine of the view-zenith // angle is mu, the cosine of the sun-zenith angle is mu_s, and the cosine of // the view-sun angle is nu. The goal is to simplify computations below. vec3 zenith_direction = vec3(0.0, 0.0, 1.0); vec3 omega = vec3(sqrt(1.0 - mu * mu), 0.0, mu); Number sun_dir_x = omega.x == 0.0 ? 0.0 : (nu - mu * mu_s) / omega.x; Number sun_dir_y = sqrt(max(1.0 - sun_dir_x * sun_dir_x - mu_s * mu_s, 0.0)); vec3 omega_s = vec3(sun_dir_x, sun_dir_y, mu_s); comments just explain what is mu, mu_s and nu. I already know these variables mean I'm curious how equation compute sun direction's x. it may be simple math but it's hard for me
3. ## DX11 Precomputed Atmospheric scattering

Hello~ I'm implementing Bruneton's precomputed atmospheric scattering and I having trouble understanding this line in inscatterS.glsl float sx = v.x == 0.0 ? 0.0 : (nu - muS * mu) / v.x; sx is sun direction's x component. but I don't know why Does anyone know why '(nu - muS * mu) / v.x' is sun direction? Thanks