Using SCENE_STATIC

Discussion area about developing with Ogre2 branches (2.1, 2.2 and beyond)
Post Reply
aymar
Greenskin
Posts: 145
Joined: Fri Jun 12, 2015 6:53 pm
Location: Florianopolis, Brazil
x 16

Using SCENE_STATIC

Post by aymar »

Whenever I attach a v1::Entity created using SCENE_STATIC to a SCENE_STATIC scene node my app crashes.

If I create the same entity using SCENE_DYNAMIC in its creation and to a SCENE_DYNAMIC scene node, the app works.

Is there any special setup I need to do in order to make SCENE_STATIC work with v1::Entity, or does it even work with v1::Entity?

Thanks.

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 4211
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 802
Contact:

Re: Using SCENE_STATIC

Post by dark_sylinc »

Nope. It should work.

What is the code you're using that is crashing? Where does it crash? Any asserts? Anything useful on the logs?

aymar
Greenskin
Posts: 145
Joined: Fri Jun 12, 2015 6:53 pm
Location: Florianopolis, Brazil
x 16

Re: Using SCENE_STATIC

Post by aymar »

Nevermind, just found the bug, I wasn't creating the v1::Entity with SCENE_STATIC.

aymar
Greenskin
Posts: 145
Joined: Fri Jun 12, 2015 6:53 pm
Location: Florianopolis, Brazil
x 16

Re: Using SCENE_STATIC

Post by aymar »

Actually, now it works, but for some reason, some of my objects render in SCENE_DYNAMIC (using Hlms Pbs), but in SCENE_STATIC they'll render all white, as if in SCENE_STATIC their datablock gets reset. And this only happens with a few objects.

SCENE_STATIC:
Image

SCENE_DYNAMIC:
Image

The only objects using SCENE_DYNAMIC in those pics are the character and the terrain, everything else are SCENE_STATIC in the first pic and SCENE_DYNAMIC in the second.

Anyone knows what might be causing this?

Thanks.

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 4211
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 802
Contact:

Re: Using SCENE_STATIC

Post by dark_sylinc »

I have no idea. The Static and Dynamic flags have nothing to do with the material system so this shouldn't be happening at all, not at least for that reason.

Are you sure you're watching for Ogre exceptions and log? There may be useful information there. You said your app was crashing if you used Static_scene, which you fixed because your Entity wasn't being created with SCENE_STATIC. However when a dynamic Entity is attached to a static node, Ogre raises an exception notifying the error (which, if uncaught, will manifest as an crash).

Post Reply