shadows?

merch

21-03-2006 05:19:42

hi,

im wanting the entitys created in the OSM to cast shadows just like they would if i created them manualy and made shadows true

e->setCastShadows(true);

can anyone tell me how i can do this

celic

21-03-2006 10:25:53

you should enable shadows in your materials

http://www.ogre3d.org/docs/manual

merch

21-03-2006 14:24:14

still cant get them too work

shadows are working correctly using mesh's from the samples
and using the materials exported from max.



so im guessing there is something wrong im doing in max before exporting to OSM. Are there indepth tutorial of how to make things cast shadows?

Lioric

21-03-2006 16:27:10

Enable "Cast Shadows" attribute for each light you need in the max modifier panel

In the oFusion "Scene Settings" panel set the shadow technique you want

You can manually enable "Cast shadows" of each object in the properties panel (right click, properties)

And you can control if a Ogre material material receives shadows in the material editor

merch

21-03-2006 17:09:16

Enable "Cast Shadows" attribute for each light you need in the max modifier panel

i dont have any lights in max, my lights are all in ogre

mLight = mSceneMgr->createLight( "Light2" );
mLight->setType( Light::LT_SPOTLIGHT );
mLight->setCastShadows(true);
mLight->setDiffuseColour(mMinLightColour);
mLight->setSpecularColour( 0.5, 0.5, 0.5 );
mLight->setDirection( -1, -1, 0 );
mLight->setSpotlightRange( Degree(0), Degree(90) );


In the oFusion "Scene Settings" panel set the shadow technique you want

i have this set to stencil aditive, with one texture count of size 512

You can manually enable "Cast shadows" of each object in the properties panel (right click, properties)

all my objects have this enabled



And you can control if a Ogre material material receives shadows in the material editor

my material code looks like this is this correct?

material Wood_Bark2
{
technique
{
receive_shadows on
pass
{

ambient 0 0 0 1
specular 0 0 0 1 1

texture_unit
{
texture Treebark.jpg
}
}
}
}


this stuff is doing my head in
its still not working the objects still wont cast shadows but they are reciving them correctly

Lioric

21-03-2006 20:25:55

The tools are there to be used, use them

Create omni or spot lights in your max scene, activate the shadow casting for them
Activate the oFusion viewport to see if the shadows are displayed there
Enable "Generate Edge list" for your objects, in the object properties panel
You can create a plane to test for the object's shadows to be casted on it
Test with different shadow techniques

Seems you are using the "Adv Lighting tab", you should use the "General" tab to set the shadow properties of each object

merch

21-03-2006 22:36:50

my lights are on an animation track so if there is any way i can use an omni light from max that can be put on the same track that would be useful.

even so when i use lights in max and export it no shadows are created in both ogre and the ofusion viewport in max

i cant seem to find this "Generate edge list" in my objects properties. i am using max 7 btw

as for the adv lighting tab here is my general tab too with shadows turned on

[url=http://img230.imageshack.us/img230/5740/shad23el.jpg

thank you for the continued help in this matter

Lioric

21-03-2006 23:37:57

You can create the animation tracks in max too, but if you are creating the animation tracks on your application for some reason, you can use the "SetAssociateNode" method to set your light (or any other node) the target for the animation track, so this light (or node) will be animated with your track

The "Build Edge List" is in the object properties panel, via oFusion menu or if with the "Object" button you have created the oFusion toolbar

Can you test with a simple scene, create some primitive objects over a plane, add some lights, set the shadow technique in the scene settings panel (from the oFusion tools) and activate cast shadows for the lights

merch

23-03-2006 03:17:21

seem to have gotten it working.

but i can only apply the Build Edge List to some of my objects when applying it too one of the tree objects in max (AEC Extended Foliage)

ogre crashes i guess this is because of all the leaves are casting shadows and ogre can not cope

BlasterN

23-03-2006 10:19:30

try to export to 3ds and import.

And instead of use leaves meshes use a transparent texture.

dhymers

05-05-2006 22:37:11

I have some 'billboard' style trees that use .tga alpha channels for transparancy, I can't seem to get them casting shadows correctly in the oFusion render window.

Ogre mat. basic properties 'transparancy cast shadows' is checked.
Stencil modulative shadows produces just the geometry shadow and no shadow is displayed on Texture modulative.

I have tried combinations of setting the Pass and Texture unit's blend modes to Alpha blend etc ..

The max light is set to shadow map, have tried raytraced.

Sounds like a bit of a scattergun approach but I can't find an answer ...

Lioric

06-05-2006 16:49:33

Alpha blended texture shadows depends on several factors of your scene, i.e point lights wont work with texture shadows, and depends on your hardware support

See the Ogre engine documentation about shadows