jeudi 21 avril 2016

Atmospheric scattering on GPU : part III

Just completed my atmospherics scattering shaders inspired from Sam O'Neil work, to render the skydome as it should appear as seen from the planet's surface.

Some screens:










lundi 18 avril 2016

Atmospheric scattering on GPU : part II

I continue to follow the example of GPU atmospheric scattering by S. O'Neil. This time the integrator is applied to represent planet's terrain seen through the atmosphere. So the rayleigh and mie scattering is added to the existing planet's terrain shaders. The scattering resulting color factors c0 and c1 are blended to the lit and texture colored pixel value computed in the terrain details pixel shader, as in the following formula:

final_color.xyz = input.c0 + ( lit_color * pixel_color * input.c1 );


The result is a nice blue veil over planet's terrain, brighter on the horizon, as in those screensgrab bellow:













I now bet that Elite Dangerous team also used Sam O'Neil work for their earth like planet renderer !!!!




mercredi 13 avril 2016

atmospheric scattering on GPU

I just began to implement atmospheric scattering for my procedural planets. I started by trying to port on GPU my old CPU atmospheric scattering inspired from S.O'Neil samples, using a precomputed lookup table, which is here provided as a vertex texture.

Unfortunately this is a failure, it doesn't work at all ! After some reasearch on google I came quickly on an example of GPU implementation of this atmospheric scattering, by S.O'Neil himself. 

The main advantage of this is that the author added some mathematical simplification to his model, which involves that there's no more need of the precomputed lookup table. More generally, the code is simpler than my atmosphere scattering CPU to GPU port. Last but no least, once adapted to my engine framework, this new one works ! Here are some screengrabs bellow :