Jump to content
  • Advertisement
Sign in to follow this  
filousnt

Rendering Natural Waters

This topic is 3835 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am currently trying code water color equations from [S. Premoze and M. Ashikhmin / Rendering Natural Waters] : http://citeseer.ist.psu.edu/cache/papers/cs/26265/http:zSzzSzwww.cs.sunysb.eduzSz~ashzSzwaterCGF.pdf/premoze01rendering.pdf but resulting color doesn't look like ocean color. First, i use Kd (Diffuse attenuation coefficient for downwelling irradiance) and b at λ0 = 514 nm (Total scattering coefficient) for water Type I. I use 3 samples from the spectrum at R(650nm) G(570nm) B (475nm). // 3 samples from spectrum float3 Lambda = float3( 650, 570, 475 ); // from table 2 for water type I float3 Kd = float3( 36, 8.9, 1.8 ); // Absorption coefficient float3 aL = Kd; // Total scattering coefficient b at lambda = 514 nm for water type I // from table 3 float bL0 = 0.037; // we get b(lambda) from b(lambda0) float m = -0.00113; float i = 1.62517; // Total scattering coefficient float3 bL = bL0 * ( m * Lambda + i ) / ( m * 514 + i ); // we get bb(lambda) from b(lambda) // Backscattering coefficient float3 bbL = 0.01829 * bL + 0.00006; // Beam attenuation coefficient float3 c = aL + bL; Next, i use equation (21) to get water color. My viewer is always above water surface. L(0,θ,φ) = L(Z,θ,φ) e(−cR) + Ldf(0)(1 − e((−c+Kd cos θ)R)) Ldf(0) comes from a HDR sky cubemap value range from [0.2-1.6]. For R = -Z / cos theta, i use Z & theta as draw in figure below. For L(Z,θ,φ) i use 1.0 . Ray AC is the refraction ray. Free Image Hosting at www.ImageShack.us Any suggestion, explanation on equations or working piece of code is welcome. thx

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!