Sun light in SkyX?

Captain_Deathbeard

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:
skyX->getController()->getSunDirection()

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

heavydist

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;
mHydrax->setWaterColor(mWaterGradient.getColor(point));

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

Ogre::Vector3 sunCol = mSunGradient.getColor(point);
mHydrax->setSunColor(sunCol);


(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?