Jump to content

View more

View more

Image of the Day

雑魚は多めにして、爽快感重視にしつつ・・・(´・ω・`)
早いとこ、ベースを作って、完成にもっていかないとね。
タイトルもまだ迷ってるだよなぁ。 
#indiedev  #indiegame #screenshotsaturday https://t.co/IwVbswGrhe
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Precomputed Atmo Scattering sphere intersection formula

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
No replies to this topic

#1 Vereor   Members   

103
Like
0Likes
Like

Posted 27 January 2012 - 03:14 AM

Recently I've implemented Eric Bruneton's Precomputed Atmospheric Scattering as I'm sure many other people have in the past as well. I'm only really having one issue adapting it to my usage and that is that I'm using spherical terrain and I want to modify the scattering to take the terrain into consideration.

In particular, I'm unsure what this formula is actually calculating:

float t = -r * mu - sqrt(r * r * (mu * mu - 1.0) + Rg * Rg);

where:
c = camera position relative to the planet's center
r = length(c)
mu = dot(x,v)/r
Rg = radius of the planet, in KM

And what I'm attempting to do, is modify T based on the depth of terrain as sampled from the depth buffer. What I currently have, is the point of the terrain which is directly facing the sun ends up overbright, almost white, which washes out the diffuse colours. If I revert to the basic T formula as shown above, the terrain facing the sun is a typical blue colour which is not overbright but of course it doesn't reflect the changes in terrain.

Short version: Can anyone help me work out what T is actually calculating so I can adjust it to incorporate altitude changes of my terrain?

I've attached an example of my current (clearly broken) method, bottom left area shows terrain without atmosphere effect applied.

Attached Thumbnails

  • 2012.1.27-20.11.0.2.0.game0.Png





Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.