Wireframe mode and light

Problems building or running the engine, queries about how to use features etc.
User avatar
Xadeck
Halfling
Posts: 77
Joined: Tue Jul 05, 2005 11:16 am
Location: France

Wireframe mode and light

Post by Xadeck »

I try to render an entity in wireframe mode so I set

Code: Select all

entity->setRenderDetail(SDL_WIREFRAME);
First try, it does not work.
Second try, I add a light in the scene and it works.
Second try bis: hey! when the light (which is animated) gets out of the frustum, the model is no longer rendered in wireframe mode?!?

Is it a bug or a feature ;-)?
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66

Post by sinbad »

Wireframe mode shades the object in exactly the same way as solid mode, it just only renders the wireframe instead. It doesn't suddenly disregard lights or other effects, so that's why if you can't see your object in solid mode because it's dark, you ain't gonna see it when it's wireframe either.

If you want you can change the material on the entity to one which has lighting disabled if you want to see it even in the dark.
Second try bis: hey! when the light (which is animated) gets out of the frustum, the model is no longer rendered in wireframe mode?!?
You probably set a short range on the light and it's sphere of influence excluded the object. Lights will 'wink out' if you don't set their attenuation falloffs to match the maximum range.
User avatar
Xadeck
Halfling
Posts: 77
Joined: Tue Jul 05, 2005 11:16 am
Location: France

Post by Xadeck »

sinbad wrote:Wireframe mode shades the object in exactly the same way as solid mode, it just only renders the wireframe instead. It doesn't suddenly disregard lights or other effects, so that's why if you can't see your object in solid mode because it's dark, you ain't gonna see it when it's wireframe either.

If you want you can change the material on the entity to one which has lighting disabled if you want to see it even in the dark.
Second try bis: hey! when the light (which is animated) gets out of the frustum, the model is no longer rendered in wireframe mode?!?
You probably set a short range on the light and it's sphere of influence excluded the object. Lights will 'wink out' if you don't set their attenuation falloffs to match the maximum range.
You are right. It has nothing to do with the light going out the frustum but the light being behind the object so its edges are just colored with ambient (~ black) on a ~black background with a monitor with a bad gamma (= dark) ;-)

This said, I attach a screenshot of shadow on a wireframe model. Interesting... (I admit is is a pathological case ;-)).

Image
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66

Post by sinbad »

That's because you have stencil shadows. You can't expect wireframe to look right with stencil shadowing effects.
User avatar
Xadeck
Halfling
Posts: 77
Joined: Tue Jul 05, 2005 11:16 am
Location: France

Post by Xadeck »

sinbad wrote:That's because you have stencil shadows. You can't expect wireframe to look right with stencil shadowing effects.
Oops. Will go to the store to buy a new brain.