PDA

View Full Version : How do I create a sky sphere ?



yanivsh
12-06-2015, 04:54 AM
Hi ,
I am developing on Android, using openGL ES 2.0
I have read all about sky boxes , how to texture them and pan around .
what I need though is not a box but a sphere.
how can I use a sphere instead of a box ? Is there any tutorial I can follow ? because I've googled a alot and couldn't find anything .

thank you

GClements
12-06-2015, 12:54 PM
Spheres come in two basic types: UV (lat-lon) sphere, which is topologically equivalent to a cylinder, and icosphere (a tessellated icosahedron)..

Either type can be rendered as a mesh, although getting a decent texture mapping is problematic for either type, which is largely why they aren't as widely-used as cubes. A UV sphere can also be ray-traced in the fragment shader.

If you're using a sphere because you have a texture designed for a UV sphere, I'd suggest converting it to a cube map as a pre-processing step then using a cube map or sky box instead. This allows you to filter the texture correctly, which avoids a common problem with UV spheres, namely that you get artefacts near the poles due to the highly anisotropic texture scaling.