Sun light in SkyX?


06-06-2012 14:23:56

I'm switching to skyX and I'm trying to figure out how to light my scene with SkyX.
I have figured out how to get the sun direction:

But can I get other sunlight information like color / intensity? Or do I just have to make it up myself?


09-06-2012 18:39:02

I've been looking a little at the hydrax/skyx demo (which is a little outdated though, now with SkyX 0.3 and all, so there may be some other details...), and it seems like you are supposed to set the sun color yourself through some gradients, and then get the actual color like this:

Ogre::Vector3 lightDir = mSkyX->getController()->getSunDirection();

// Calculate current color gradients point
float point = (-lightDir.y + 1.0f) / 2.0f;

Ogre::Vector3 sunPos = mCamera->getDerivedPosition() - lightDir*mSkyX->getMeshManager()->getSkydomeRadius(mCamera)*0.1;

Ogre::Vector3 sunCol = mSunGradient.getColor(point);

(Some code cleaned up for simplicity.)
(The gradient itself is defined in the beginning of the demo.)

Maybe you can check out those sources for more clues?