Material sharing
2 posters
Material sharing
Hi,
I'd like to have just one material with one texture atlas and share it with my models on scene to save texture bandwidth. If I do this with blender, does sio2 optimize the rendering flow setting only that material once for all the objects that uses it?
I'd like to have just one material with one texture atlas and share it with my models on scene to save texture bandwidth. If I do this with blender, does sio2 optimize the rendering flow setting only that material once for all the objects that uses it?
william- Posts : 15
Join date : 2009-09-09
Re: Material sharing
Just name your object alphabetically... like lets say that box1, tree1, house1 are using the same material simply name your objects like:
a_box1
a_tree1
a_house1
So you can manually sort the rendering state... its just more convenient for the device...
a_box1
a_tree1
a_house1
So you can manually sort the rendering state... its just more convenient for the device...
Re: Material sharing
So instead of calling sio2ResourceRender(...), I've got to set the material by myself and then render the objects one by one with sio2ObjectRender?
william- Posts : 15
Join date : 2009-09-09
Re: Material sharing
No the exporter will sort the object alphabetically and they will also be loaded alphabetically... the only thing you have to do is set your object name in blender that's it and render with sio2ResourceRender...
I know its not ideal, but at least its better than to sort all the rendering list everytime a frame is rendered... and like that you can have control on the order which is kinda cool and can really optimize the rendering loop this way... cause all the object will be rendered (if visible) in the alphabetical order that you specify which apply to the proper type: solid, transparent, alpha.
I know its not ideal, but at least its better than to sort all the rendering list everytime a frame is rendered... and like that you can have control on the order which is kinda cool and can really optimize the rendering loop this way... cause all the object will be rendered (if visible) in the alphabetical order that you specify which apply to the proper type: solid, transparent, alpha.
Re: Material sharing
This is cool! the objects get sorted, Anyway i've taken a look at your sources and I've seen that the material and texture is set everytime an object is rendered: maybe I'm wrong but doing so, doesn't we have a state change every time an object gets rendered?
It would be nice if the renderer sorts the objects per material, then set material+texture and then loop through objects and render them without the state change. What do you think about this?
It would be nice if the renderer sorts the objects per material, then set material+texture and then loop through objects and render them without the state change. What do you think about this?
william- Posts : 15
Join date : 2009-09-09
Re: Material sharing
Like everything else in SIO2 structures will be binded once as long as they are needed... for the machine state they are only changed if needed... nothing is binded twice and nothing no state change will be changed twice... basically the name trick is just to give access to the user to create its own customized rendering list... instead SIO2 will take care of the machine states and rendering optimization...
Check sio2_state.cc for more info, as well as all the rendering functions...
Check sio2_state.cc for more info, as well as all the rendering functions...
Re: Material sharing
Sweet.
Thank you sio2 and keep up the good work
Thank you sio2 and keep up the good work
william- Posts : 15
Join date : 2009-09-09
Similar topics
» Possible solution: Bone Animation sharing among instance objects
» sio2ObjectDuplicate loses material?
» Duplicate / clone SIO2Object with new material
» Material and Texture
» Material colors and lighting
» sio2ObjectDuplicate loses material?
» Duplicate / clone SIO2Object with new material
» Material and Texture
» Material colors and lighting
Permissions in this forum:
You cannot reply to topics in this forum