Shadow problem.

ahmadi

23-08-2006 19:30:13

Hi,
my mesh after exporting have not any shadowing
if i load a ogre standard mesh instead it, then i have shadow.
what is wronge. im using .mesh file after exporting.
some guys say me that my mesh have not edgelist but its my setting


and its my ogre3d result:

Lioric

23-08-2006 21:57:18

Did you tested selecting the "Build Edge List" in the "Object" panel (with the object selected, click on the "Object" button of the toolbar, or via the menu "oFusion/Object")

What shadow type are you using?

Do you have shadow cast and receive enabled on the same object?

ahmadi

23-08-2006 22:30:36

Did you tested selecting the "Build Edge List" in the "Object" panel (with the object selected, click on the "Object" button of the toolbar, or via the menu "oFusion/Object")
ok, but i can not sense any change in my ogre3d viewport.!

What shadow type are you using?

im using SHADOWTYPE_STENCIL_MODULATIVE.

Do you have shadow cast and receive enabled on the same object?

yes, im sure , because if i use Ogre3d/media/Cube.mesh, then i have correct shadow.

Evak

23-08-2006 23:14:01

I've never managed to get the shadows to work correctly straight from Ofusion. Wasn't even sure if it was supposed to turn the technique on by default. All I did was code it into my app instead.

ahmadi

23-08-2006 23:24:21

I've never managed to get the shadows to work correctly straight from Ofusion. Wasn't even sure if it was supposed to turn the technique on by default. All I did was code it into my app instead.
what you mean from code?, and how you coded? please give me your code, if its not problem for you. and you are working open source

Evak

23-08-2006 23:34:37

well were using a custom built Ogre wrapper for Blitzmax so my code probably won't help.


here's a simple WASD flying cam with mouselook. Loads two OSM's Env.osm contains the lighting setup, and Allblox loads the pieces you interact with. The line that turns on the shadows is pretty obvious and I expect its not much different in other languages.

SuperStrict

Framework pub.win32
Import brl.system
Import brl.standardio
Import brl.math
Import brl.random
Import brl.filesystem
Import brl.linkedlist
Import brl.retro

Include "sow.bmx"


'initOgre(1,LL_BOREME) 'use dialog settings, logging level
SOW_initOgre(False,LL_BOREME,True)

sow_initialiseResources()


Global ems:Int,lms:Int
OgreSetShadowTech(SHADOWTYPE_STENCIL_MODULATIVE)
Global cam:TCamera=TCamera.Create("Camera1")
cam.SetPosition(0,1.8,0)
cam.PointAt(50,0,0)


OfusionLoad("Env.OSM")
OfusionLoad("AllBlox.OSM")


While True

ems=MilliSecs()-lms
lms=MilliSecs()


If OgreKeyDown(KC_W) Then cam.Translate(0,0,-.1)
If OgreKeyDown(KC_S) Then cam.Translate(0,0,.1)
If OgreKeyDown(KC_A) Then cam.Translate(-.1,0,0)
If OgreKeyDown(KC_D) Then cam.Translate(.1,0,0)
If Ogrekeydown(KC_ESCAPE)<>0 Then End
cam.Yaw(-OgreMouseRelativeX()*0.1)
cam.pitch(OgreMouseRelativeY()*0.1)

OgreRenderWorld(ems/1000.0)


Wend

ahmadi

23-08-2006 23:41:15

I dont use .OSM file, and im working on .mesh file, your code can not help me.
also what you mean from BlitzMap?
Thanks

Evak

23-08-2006 23:48:08

you have to turn on edge lists to get any shadows working with your Ofusion exported meshes.

You can check the global create edge lists in the export dialogue to have everything cast shadows.

Or, you can do it per object by going to the ofusion menu/object and checking the box for build edge list (the top checkbox).

The only other thing to do is make sure you have cast shadows enabled on your lights, and that your mesh can cast and recieve shadows.

right click on your mesh and choose properies from the menu that appears, you will see the check boxes for cast and recieve shadows on the right hand side.

ahmadi

24-08-2006 11:54:16

you have to turn on edge lists to get any shadows working with your Ofusion exported meshes.

You can check the global create edge lists in the export dialogue to have everything cast shadows.

Or, you can do it per object by going to the ofusion menu/object and checking the box for build edge list (the top checkbox).

The only other thing to do is make sure you have cast shadows enabled on your lights, and that your mesh can cast and recieve shadows.

right click on your mesh and choose properies from the menu that appears, you will see the check boxes for cast and recieve shadows on the right hand side.

i did all things that you said but also i have not any shadow.
also dont forget i dont use .OSM file, and i have a simple mesh, then i use .mesh file, after exporting

Evak

24-08-2006 16:23:00

also dont forget i dont use .OSM file, and i have a simple mesh, then i use .mesh file, after exporting

If you don't use Ofusion, which tells ogre which meshes cast shadows you need to do it in code.


ent = mSceneMgr->createEntity( "Ninja", "ninja.mesh" );
ent->setCastShadows( true );
mSceneMgr->getRootSceneNode()->createChildSceneNode( )->attachObject( ent );


and make sure that you have a shadow technique set in code too,

mSceneMgr->setShadowTechnique( SHADOWTYPE_STENCIL_ADDITIVE );

Without using the scene loader and ofusion your ignoring 70% of what makes ofusion so useful, which is kind of a shame :(

It sounds to me like you need to go through the basic tutorials in the wiki to figure out how these things work without using OSM.

The tutorials in the URL below should get you started and seem to be really good.

http://www.ogre3d.org/wiki/index.php/Ogre_Tutorials