Things are progressing quite well in my project, but the lighting doesn't look like it should at all, the screenshots below show it. It looks like even though two models are right next to eachother, one gets lit and the other doesn't. My second problem is that none of the sprites I add get lit by lights, even if I set them to be.
Wrongly lit hallway, and sprite
More lighting errors
Is there something I can do to get Sprites to be lit by lights, and avoid the errors I'm having when lighting the models?
Lighting problems, what am I missing?
-
Interrupt
- Halfling
- Posts: 83
- Joined: Wed Jun 29, 2005 8:15 am
- Mr.Bloodworth
- Halfling
- Posts: 91
- Joined: Fri Mar 25, 2005 3:19 am
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact:
-
Interrupt
- Halfling
- Posts: 83
- Joined: Wed Jun 29, 2005 8:15 am
The scene is being made up of seperate models that are being added into a Static Geometry object.
I'm creating it like this:
I add a model into it by attaching it into a Scene Node:
sMeshes->addSceneNode(thisSceneNode);
Making the lights:
Maybe that will help things.
About Billboards, what would be the best way to light them? I'd like to light them dynamically, but I could compute their color by iterating through the lights near them if nothing else.
I'm creating it like this:
Code: Select all
StaticGeometry* sMeshes = mSceneMgr->createStaticGeometry("DungeonBlock");
sMeshes->setRegionDimensions(Vector3(2500,2500,2500));
sMeshes->setOrigin(Vector3(0,0,0));
sMeshes->addSceneNode(thisSceneNode);
Making the lights:
Code: Select all
Light* pLight = mSceneMgr->createLight(lightName);
pLight->setType( Light::LT_POINT);
pLight->setAttenuation(900, 1.0, 0.00016, 0.00000012);
pLight->setDiffuseColour(ColourValue(0.9,0.6,0,1));
About Billboards, what would be the best way to light them? I'd like to light them dynamically, but I could compute their color by iterating through the lights near them if nothing else.
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact:
The lighting errors on your static geometry are likely to be caused by incorrect normals. Easiest way to prove this is to remove the static geometry influence for the moment and just add your blocks as entities - do they get lit the same way then?
About billboards - the simplest way would be to write a vertex shader which lights the billboard based on distance rather than vertex normal. Otherwise, you pretty much are limited to calculating it yourself in code, since no choice of normal will look quite right.
About billboards - the simplest way would be to write a vertex shader which lights the billboard based on distance rather than vertex normal. Otherwise, you pretty much are limited to calculating it yourself in code, since no choice of normal will look quite right.