Lighting Objects on the terrain

yrro

05-06-2006 14:07:10

I've been trying to get a basic directional light working for my scene, but it's not showing up on any of the models (which show lighting effects when previewed in the ogre model view app).

Here's my config file


GroupName=PLSM2

Width=1
Height=1

Data2DFormat=HeightField
LandScapeFileName=lemmings

FileSystem=Media/paginglandscape2/terrains/lemmings

NumTextureFormatSupported=19

NumTextureFormatSupported=19

TextureFormatSupported0=Image
TextureFormatSupported1=BaseTexture
TextureFormatSupported2=BaseTexture2
TextureFormatSupported3=InstantBaseTexture
TextureFormatSupported4=InstantBaseTextureEdit
TextureFormatSupported5=Splatting
TextureFormatSupported6=Splatting2
TextureFormatSupported7=Splatting2Edit
TextureFormatSupported8=Splatting4
TextureFormatSupported9=Splatting6
TextureFormatSupported10=Splatting7
TextureFormatSupported11=Splatting7Edit
TextureFormatSupported12=BaseTexture
TextureFormatSupported13=BaseTexture2
TextureFormatSupported14=InstantBaseTexture
TextureFormatSupported15=Splatting3
TextureFormatSupported16=Splatting5
TextureFormatSupported17=SplattingShader
TextureFormatSupported18=InstantBaseTextureShadowed

TextureFormat=InstantBaseTextureEdit
ImageFilename=lemmingsBaseColorMap

ScaleX=500
ScaleY=200
ScaleZ=500

Deformable=yes
SaveDeformation=no
VertexCompression=no
VertexProgramMorph=no
VertexNormals=yes
VertexLit=yes
MaxPixelError=10

NumMatHeightSplat=0

# where to put camera on load.
BaseCameraViewpoint.x=0.0f
BaseCameraViewpoint.y=500.0f
BaseCameraViewpoint.z=0.0f

Baselookat.x=0.0f
Baselookat.y=0.0f
Baselookat.z=0.0f



And here is the code to create the light.

Ogre::Vector3 LightPos(0.0f, 300.0f, 0.0f);

light = mSceneMgr->createLight("MainLight");

light->setPosition(LightPos);

light->setDiffuseColour(0.93f, 0.93f, 0.93f);


light->setType (Ogre::Light::LT_DIRECTIONAL);
light->setDirection (Ogre::Vector3 (0.0f, -1.0f, 0.0f));


Any suggestions as to what I'm doing wrong? Any advice is greatly appreciated.

tuan kuranes

06-06-2006 15:59:49

PLSM2 doesn't do lights, it use standard Scene manager code...
Try same scene, but with generic scenemanager.

Is light near enough models ?