Create a new VOP Network for OSL

   8436   5   1
User Avatar
Member
16 posts
Joined: 2月 2009
Offline
Hi masters,

I'm trying to integrate the OSL into Houdini, but I do not know how to implement this in VOP or VEX. I would like user could initialize an OSL VEX Builder Network, and in that network, user could construct the graph by OSL node (not Mantra or RSL nodes) as the P1.png and P2.png demonstrates.

I found the VOPNET in the HDK, but I'm not sure how to extend this class to create an OSL VopNet, there is no any document even comments :cry: .

So is that possible I finish this task ? Thanks !

Attachments:
P2.png (12.3 KB)
P1.png (13.1 KB)

User Avatar
Member
192 posts
Joined: 11月 2008
Offline
this seems very possible by leveraging the existing vex/rsl infrastructure. we've done something similar while implementing the rman 16 plausible shading framework in vops.

for our purposes, we were able to create a minimal number of nodes as vop otls that did basic things, but the main functionality came from running a python script rather than hrmanshader that post processed the houdini created rsl code to inject it into rsl2.0 physically plausible shaders.

it seems possible to me that you could break down the differences in rsl and osl syntax (seems minimal) and create a script that filtered the houdini-created rsl to convert it to osl. your python script could then run the compiler on your filtered script.

just an idea… good luck!
User Avatar
Member
16 posts
Joined: 2月 2009
Offline
brianBurke
this seems very possible by leveraging the existing vex/rsl infrastructure. we've done something similar while implementing the rman 16 plausible shading framework in vops.

for our purposes, we were able to create a minimal number of nodes as vop otls that did basic things, but the main functionality came from running a python script rather than hrmanshader that post processed the houdini created rsl code to inject it into rsl2.0 physically plausible shaders.

it seems possible to me that you could break down the differences in rsl and osl syntax (seems minimal) and create a script that filtered the houdini-created rsl to convert it to osl. your python script could then run the compiler on your filtered script.

just an idea… good luck!

Hi friend,

Thank you very much for your kindly help. At present I just created several VEX Builder Operator from the File menu, then filled the node with VEX code with OSL code fragment, and seems maybe this is a choice.

For example, this simple network produces the code like this, seems not difficult to translate it to OSL.

surface
vopsurface1()
{
vector oColor;
vector oP;
vector oN;
vector oColor1;
vector oColor2;
vector sum;

// Code produced by: oslEmission1
oColor = emission(0.123);

// Code produced by: oslGlobal1
oP = P;
oN = N;

// Code produced by: oslDiffuse1
oColor1 = diffuse(oN);

// Code produced by: oslWard1
oColor2 = ward(oN, 0.45600000000000002, -0.45600000000000002);

// Code produced by: add1
sum = oColor + oColor1 + oColor2;

// Code produced by: output1
vector tempCf = sum;
Cf = tempCf;
}


But I still want Houdini could expose the VOPNET_Node and VOP so that user could do almost anything ! I even just need the UI of Houdini, and the other stuff could be handled by myself. :shock:

Attachments:
OSL Network.png (35.3 KB)

User Avatar
Member
401 posts
Joined:
Offline
I even just need the UI of Houdini, and the other stuff could be handled by myself.

No offense: but if you're really just after the UI and Houdini is not the right hammer for your screw:
Why not use some other node frame work?
Like:
http://www.nodebox.net/code/index.php/Home [nodebox.net]
this is not a science fair.
User Avatar
Member
4271 posts
Joined: 7月 2005
Offline
Or Coral

http://code.google.com/p/coral-repo/ [code.google.com]

(Which is awesome, except the no undos part)
if(coffees<2,round(float),float)
User Avatar
Member
16 posts
Joined: 2月 2009
Offline
Hello friends,

I used to create the similar tools by Java and works well, but now my work is to integrate our renderer into Houdini with the OSL feature, so prefer an unified workflow in Houdini. If SideFX could spend more time on document that would be great.
  • Quick Links