aromanro / SolarSystem

A solar system simulator with Verlet, using OpenGL for displaying.
https://compphys.go.ro/newtonian-gravity/
GNU General Public License v3.0
59 stars 14 forks source link

Add bump mapping #5

Closed aromanro closed 4 years ago

aromanro commented 4 years ago

If I recall correctly, for some planets I found bump mapping textures. It would be nice to add bump mapping at least for one (preferably Earth). Just add an optional parameter for each planet/moon for the bump mapping texture and if one is available for a planet/moon, do bump mapping https://en.wikipedia.org/wiki/Bump_mapping.

aromanro commented 4 years ago

Just checked, there are bump maps and normal maps https://en.wikipedia.org/wiki/Normal_mapping available for some of the planets/moons.

aromanro commented 4 years ago

Done. There might be some issues with some normal maps out there (not all I found seem to be ok) but bump mapping / normal mapping works now. If a bump map / height map is provided (8 bpp gray image), a normal map is computed using Sobel.