Can somebody help me in understanding how to pass object information to a shader in Softimage?
Here is what I want to do:
I have an object in the scene (say a teapot).
I create a new geoshader primitive.
I connect a geoshader to the geoshader primitive.
I open the geoshader node.
Here is where i am stuck (like a bug on fly paper).....
I want to create a input field were a user could write in a field the name of the teapot object or pick it from the scene explorer and the field would be automatically filled. The shader would then automatically take some information from that object i.e
teapot.no_polygons->geoshader.no_polygons;
teapot.no_vertices->geoshader.no_vertices;
etc.
Most example I have are direct manipulation of the scene in Mental Ray standalone. I have no example on how to select an object and provide object attributes/parameters within Softimage Shader code (C++).
Can someone help me with an example (even partial ccp code is fine to show me the process)
Thanks!
Passing object data to a shader
-
Daniel Brassard
- Posts: 878
- Joined: 18 Mar 2010, 22:38
- Location: St. Thomas, Ontario
Passing object data to a shader
$ifndef "Softimage"
set "Softimage" "true"
$endif
set "Softimage" "true"
$endif
-
BenR
- Posts: 92
- Joined: 11 Jun 2009, 18:52
Re: Passing object data to a shader
If I understand what you are trying to do, you will want to use a UserDataBlob to pass the information to your geoshader. Take a look at the Wireframe sample in the SDK.
Ben
Ben
-
Daniel Brassard
- Posts: 878
- Joined: 18 Mar 2010, 22:38
- Location: St. Thomas, Ontario
Re: Passing object data to a shader
Thanks BenR, I'll look into it. Cheers!
Dan
Dan
$ifndef "Softimage"
set "Softimage" "true"
$endif
set "Softimage" "true"
$endif