I created billboards of clouds that always face the camera in OpenGL. Now I want to add some lighting effects and maybe simulate a scattering light effect.

I experimented with phong shading but my main problem was that I do not have any pre-calculated normals so I simulated some normals in the fragment shader for different fragments. I simply calculated the normal to the fragment as the vector from the position of the fragment to the camera position. I added another vector to that normal to make the normals on the side point to the side, creating a sort of "sphere feeling".

This resulted in an okay lighting but it gets weird with certain angles. Especially when running it on an Android phone.

Are there any good ways I can simulate scattering or realistic lighting in general for these cloud billboards?

  • 1
    \$\begingroup\$ This is a very large topic. Depending on how far you want to go, there are elaborate methods to compute or approximate scattering in a volumetric fashion (e.g. the approach taken in Horizon Zero Dawn), or simpler tricks for lower-fidelity results. You might want to try to do a search for particle lighting / volumetric / cloud rendering techniques to survey what's available, then edit your question to refine it down to a specific target quality / complexity within that space. \$\endgroup\$
    – LudoProf
    Apr 15 at 19:30


You must log in to answer this question.

Browse other questions tagged .