Ogre2 'Tindalos': Dynamic resources

What it says on the tin: a place to discuss proposed new features.
Post Reply
Ayudo
Halfling
Posts: 88
Joined: Fri Mar 18, 2005 12:25 am
Location: munich, germany
Contact:

Ogre2 'Tindalos': Dynamic resources

Post by Ayudo »

I would welcome a cleaner dynamic resource strategy.

With dynamic resources I mean materials, meshes, animations...

How about:

FooPtr foo = Ogre::FooManager::getSingelton().getFoo("Name");
foo.edit();
foo.parameter1 = changedvalue;
foo.parameter2 = changedvalue2;
foo.update();

What do you think?
User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US
x 22

Post by xavier »

Not sure what you are asking for -- could you be more specific? There is nothing static about Ogre resources, you can create whatever you want, however you want, currently.
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.
User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 2
Contact:

Post by Kencho »

I think he is talking about tweaking already loaded resources and reload them in run time without having to unload/load them manually.
Image
User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US
x 22

Post by xavier »

I guess I am missing the need to "reload" them -- if a resource is already resident in memory, and you change its data, what needs to be updated? If it's a hardware buffer (i.e. pixel, vertex or index) then you have to lock it anyway to change it, which will cause a resend of the changed data when you unlock the buffer. Anything else that is CPU-side only, when you change the data, it changes immediately, so what's to update? "Script"-based data such as materials, when you change their properties, the data is changed immediately.

A specific example of what the OP has in mind is in order here, I think...
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.
User avatar
Kencho
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4011
Joined: Fri Sep 19, 2003 6:28 pm
Location: Burgos, Spain
x 2
Contact:

Post by Kencho »

I was just explaining what I understood in his words, not supporting the idea 8)
Image
User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

You can already create all the resources dynamically: textures, meshes, etc. There are plenty of examples of that in the demos.
Post Reply