Page 1 of 1

OGRE: Earth project containing several shaders

Posted: Sat Sep 01, 2012 12:38 pm
by DarkDragon
Hello,

I've done this quite a while ago, when STARGATE and Artus (those guys) asked me for help. I've updated it, so it works with PB 4.61 final now. It contains a shader for normal maps, specular maps and a fake atmospherical scattering (just the glow effect). The clouds are moving independently from the earth rotation. The images are modified versions of the blue marble and blue marble next generation project found at NASA visible earth (details inside readme.txt).

Screenshot:
Image

Download:
http://www.bradan.eu/files/OGREEarthmapping.zip

It also contains a sourcecode for generating the normal map out of the topology map.

For porting it to PB 5.0 you may need to remove the node-type parameter (the last one) in those two lines:

Code: Select all

    AttachNodeObject(0, EntityID(0), #PB_Node_Entity)
    AttachNodeObject(0, EntityID(1), #PB_Node_Entity)

Re: OGRE: Earth project containing several shaders

Posted: Sun Sep 02, 2012 2:02 am
by Zebuddi123
Hi DarkDragon Well i think that looks amazing turned it into my screen saver allready really really good !!!. one point i have noticed that the land depth wise is where the clouds should be that's what it looks like to me

ive had a look through the code to see if i could adjust it but i got say i aint got a clue with how all this kind stuff is put together but you've started that little itch. I tried renaming clouds.png to texture.png and visa versa but that looked ok but lost the depth as i assume the the depth param or something needs changing.


But Really great, thank you.

Zebuddi. :P

Re: OGRE: Earth project containing several shaders

Posted: Sun Sep 02, 2012 8:14 am
by DarkDragon
Thank you for your answer.
Zebuddi123 wrote:one point i have noticed that the land depth wise is where the clouds should be that's what it looks like to me

ive had a look through the code to see if i could adjust it but i got say i aint got a clue with how all this kind stuff is put together but you've started that little itch. I tried renaming clouds.png to texture.png and visa versa but that looked ok but lost the depth as i assume the the depth param or something needs changing.
I don't think I've understood you completely. You want to control the cloud height over the earth? Have a look into the file "data/Earth.material" with a text editor. There you search the "pass"-block with the comment "For the clouds" right before. It should look like this:

Code: Select all

      // For the clouds
      pass
      {
         depth_write off
         depth_func less_equal
         depth_bias 0.1
         scene_blend alpha_blend
         lighting on
         iteration once_per_light
         
         vertex_program_ref hemisphereVS
         {
           param_named      hemisphereScale    float                 1.025
         }

         fragment_program_ref cloudPhongPS
         {
         }

         texture_unit
         {
           scroll_anim -0.01 0
           texture clouds.png -1
           filtering anisotropic
           max_anisotropy 16
         }
      }
And there you can specify a different hemisphereScale. Replace the 1.025 by 1.5 and the clouds are outside the atmosphere, replace it by 1.0 and they are flat on the earth. Smaller than 1.0 would mean inside the earth :P . You could also specify the cloud speed in the line starting with "scroll_anim".

And well, the earth itself just has a fake depth. The lighting is calculated for mountains with different orientation than the flatlands. That's all.

Re: OGRE: Earth project containing several shaders

Posted: Sun Sep 02, 2012 5:39 pm
by Zebuddi123
Thanks DarkDragon you`ve definitely got me interested in this, and i`ve got a free copy of Autodesk 3ds Max Design 2013 to have a play with from searching for information about 3d rendering and 3d game engines etc

anyone interested

http://students.autodesk.com/

Zebuddi. :D

Re: OGRE: Earth project containing several shaders

Posted: Sun Sep 02, 2012 7:13 pm
by applePi
thanks DarkDragon for the beautiful demo, and the clouds ... explanation. and thanks Zebuddi123 for the free Autodesk student editions links i will download a copy.

Re: OGRE: Earth project containing several shaders

Posted: Mon Sep 03, 2012 4:25 pm
by [blendman]
great exemple !
Thank you very much !

Re: OGRE: Earth project containing several shaders

Posted: Mon Sep 03, 2012 10:36 pm
by Fred
Very good !

Re: OGRE: Earth project containing several shaders

Posted: Tue Sep 04, 2012 5:31 am
by zxtunes.com
Super!

which for me is particularly surprising all running smoothly and almost does not consume CPU.

perhaps it is time to reconsider its attitude to OGRE.