Forums
You are not logged in.
#1 2012-01-29 20:53:38
- christopheb
- New member
- Registered: 2010-04-06
- Posts: 8
how to inject unassign shaders into the rib ?
Hi,
I am trying to inject unassigned shaders into the rib during ribgen. What is the best way to do that ?
Thanks,
Christophe.
Offline
#2 2012-01-30 13:25:50
Re: how to inject unassign shaders into the rib ?
why dont you just assign them to an object that doesnt visibily render like a locator?
Also why do you need an unassigned shader in your rib?
Is it for use in a rib filter?
Sam
-------------------------------
Sam Hodge
Offline
#3 2012-01-30 19:07:52
- christopheb
- New member
- Registered: 2010-04-06
- Posts: 8
Re: how to inject unassign shaders into the rib ?
Hey Sam, as you know ;-) we don't load all the geometries in our scenes and we assign the shaders to the geometries during ribgen (and we generate the rib geometries at the same time btw).
As you suggested, until now we are assigning the shaders to invisible planes. It works well except when you include them in a rib archive. The rib archive bounding box includes the invisible planes which is not good when the geometries are not near them. You end up with a much bigger bounding box then necessary.
So I was hoping there would be a 'magic' attribute that would force the injection of the shader into the rib.
Christophe.
Offline
#4 2012-01-31 06:01:23
- olivier
- 3Delight Developer
- Registered: 2007-01-09
- Posts: 1930
Re: how to inject unassign shaders into the rib ?
How about using some invisible object right in the middle of the scene instead of your planes? Something like a sphere of radius 0 or a plane with 4 identical vertices should not show up no matter where you put it.
Offline
#5 2012-01-31 14:57:57
- christopheb
- New member
- Registered: 2010-04-06
- Posts: 8
Re: how to inject unassign shaders into the rib ?
finding the middle of the scene requires extra work and is not always trivial (specially if the geometry is moving). I'll have a try with a radius 0 or 4 identical vertices, but I am pretty sure it will affect the rib archive bounding box.
An attribute on the shader would be the most flexible and robust approach.
Christophe.
Offline
#6 2012-01-31 18:12:03
- olivier
- 3Delight Developer
- Registered: 2007-01-09
- Posts: 1930
Re: how to inject unassign shaders into the rib ?
Yes, of course it will affect the bounding box. I meant it would not show up in the image.
Offline
#7 2012-01-31 18:27:53
- christopheb
- New member
- Registered: 2010-04-06
- Posts: 8
Re: how to inject unassign shaders into the rib ?
No worries.
Can we have an attribute on the shader ? pretty please :).
Offline
#8 2012-01-31 19:44:08
Re: how to inject unassign shaders into the rib ?
christopheb wrote:
Hi,
I am trying to inject unassigned shaders into the rib during ribgen. What is the best way to do that ?
Just out of curiosity, is there a reason why you can't use the available shader connection techniques ?
-- aghiles
Offline
#9 2012-01-31 20:35:18
- christopheb
- New member
- Registered: 2010-04-06
- Posts: 8
Re: how to inject unassign shaders into the rib ?
Because the geometries are not in the scene so we don't have anything to connect to.
For example:
Say we have a scene that contains lots of jeeps. Each jeep is made of 100 geometries. We have in house tools that just load the bounding box of each jeep (which is very memory light weight) and we load one palette of shaders common to all jeeps. We store in a file the connections between the shaders and the different geometries of the jeep. During ribgen we read the file and assign the shaders to the different geometries (and also inject the geometries in the rib).
Having the shaders live in the scene allow the lighters to modify the parameters and do interactive renders with the modified values.
Christophe.
Offline
#10 2012-01-31 23:28:52
Re: how to inject unassign shaders into the rib ?
One way to do the connections, during render time, is to use an Ri Filter. The Ri filter will catch eah geometry and would assign the shader at that level (the Ri filter would read that shader/geo connection file). Not sure if that's feasible in your case but I know this has been done.
-- aghiles
Offline
#11 2012-02-01 06:14:52
- olivier
- 3Delight Developer
- Registered: 2007-01-09
- Posts: 1930
Re: how to inject unassign shaders into the rib ?
christopheb wrote:
No worries.
Can we have an attribute on the shader ? pretty please :).
I'm not sure. IIRC, that would be a pretty big change in how the export works. It's more like adding a whole new "export shaders by themselves" feature than a simple attribute as right now, I think we never even see the shaders which are not connected.
So connecting them to an object which would have no effect might still be the best solution. Is there any problem with this besides the bounding box of the archives you write? Also, if you're using this to integrate objects in the scene for rendering, why are you exporting another archive from that scene? Is it hypershade networks or renderman shaders you want to export?
Offline
#13 2012-02-01 15:06:03
- christopheb
- New member
- Registered: 2010-04-06
- Posts: 8
Re: how to inject unassign shaders into the rib ?
olivier wrote:
christopheb wrote:
No worries.
Can we have an attribute on the shader ? pretty please :).I'm not sure. IIRC, that would be a pretty big change in how the export works. It's more like adding a whole new "export shaders by themselves" feature than a simple attribute as right now, I think we never even see the shaders which are not connected.
So connecting them to an object which would have no effect might still be the best solution. Is there any problem with this besides the bounding box of the archives you write? Also, if you're using this to integrate objects in the scene for rendering, why are you exporting another archive from that scene? Is it hypershade networks or renderman shaders you want to export?
Olivier, you got it, there is no other problem beside the bounding box of the archive we write. If that can be solved then we are rolling.
I am not sure I get your second question. I'll try to explain one workflow. Say we are rendering different shots of a big city. From a master scene we would export the different part as rib archive which would contain the shaders and geometry. We then assemble the different parts for each shot with rib archive nodes.
We are exporting renderman shaders.
Last edited by christopheb (2012-02-01 15:29:32)
Offline
#14 2012-02-01 15:12:00
- christopheb
- New member
- Registered: 2010-04-06
- Posts: 8
Re: how to inject unassign shaders into the rib ?
ogre wrote:
Can you connect one of your model's 'center' attribute to 'translate' of your dummy geo ? This way you BBox doesnt grow on animated geometry
That might be able to work if the model is part of the rib archive we are exporting. The dummy geo can be shared between multiple models.
i.e: all the wheels of all the jeeps share the same shader.
Offline
#15 2012-02-02 06:56:44
- olivier
- 3Delight Developer
- Registered: 2007-01-09
- Posts: 1930
Re: how to inject unassign shaders into the rib ?
christopheb wrote:
ogre wrote:
Can you connect one of your model's 'center' attribute to 'translate' of your dummy geo ? This way you BBox doesnt grow on animated geometry
That might be able to work if the model is part of the rib archive we are exporting. The dummy geo can be shared between multiple models.
i.e: all the wheels of all the jeeps share the same shader.
But there has to be something in that archive. It doesn't matter what you attach the dummy geo to. As long as it gets exported in the archive too then the dummy geo will not make the bounding box any larger.
The other way would be to have some kind of geo which has no effect on the bounding box. I can't think of any obvious way to do that besides having 3dfm explicitly ignore it...
Offline
#16 2012-02-02 13:16:40
Re: how to inject unassign shaders into the rib ?
There are a few ways to address this problem that I can think of, but they all require some modification in 3dfm. I suggest that you file an issue in the bug tracker regarding this.
Offline
#17 2012-02-02 14:26:01
- christopheb
- New member
- Registered: 2010-04-06
- Posts: 8
Re: how to inject unassign shaders into the rib ?
Ok will do. Thanks for all the replies !!
Offline

