Horizon haze technique

Anything related to Wolfire Games and/or its products
Post Reply
pshort
Posts: 2
Joined: Mon Jul 27, 2009 9:20 am

Horizon haze technique

Post by pshort » Mon Jul 27, 2009 9:30 am

Hey guys, sorry if this is the wrong place for this or if its against the rules. I've been following the blog posts for a while now and love what you guys are doing, the whole project looks really cool. I've been making my own terrian system in xna and have been getting some serious envy pangs each time i look at yours! I was wondering if you could give a little more detail (high level implimentation, no trade secrets!) on the haze band you use to mask where the land meets the skybox? I made a top and bottomless cylinder and a shader to give it a color and alpha gradient but it gets cut off by the land. at the bottom so it looks crap. I could get past this by rendering it to a different target and blending them in post processing but then we have z buffer issues where the band goes over mountains. The further i go into thinking about it the more complex the solution feels until it doesnt seem worth it... Anyway feel free to ignore me, just thought id throw a torch in the dark :P

Keep up the work, loving the blog!

Pete

David
Project Leader
Posts: 1995
Joined: Wed Nov 19, 2003 10:45 pm
Contact:

Re: Horizon haze technique

Post by David » Mon Jul 27, 2009 12:24 pm

To make sure that the horizon band doesn't intersect the terrain, I just turn off depth testing! With depth testing disabled, nothing can get cut off by anything else -- it just layers on top.

pshort
Posts: 2
Joined: Mon Jul 27, 2009 9:20 am

Re: Horizon haze technique

Post by pshort » Tue Jul 28, 2009 5:15 am

Thanks for the tip :D I definitely want to do this but I'm thinking i want selective depth testing, where the band writes over the sea / land extension and the sky but doesn't overwrite geometry near the camera such as high mountains. I'm thinking of doing something like this; generate a depth map, then in the band shader if the depth is > a certain distance value then write the band color, else not. This way the band will appear distancy ( <- A REAL WORD I SWEAR) yet omnipresent. Not sure if it will work as I havent tried it but i just get the feeling its a little heavy handed :(

Thanks for your help!
Pete

Post Reply