vex beginner

   23371   20   2
User Avatar
Member
88 posts
Joined: March 2006
Offline
Can someone please show me a simple step by step for compiling a simple vex code to implimenting it into the inline vop to applying it to some geometry. From what I gather you just need to run vcc test.vfl but I can't seem to make anything happen with it. Much appreciated.
User Avatar
Member
135 posts
Joined: July 2005
Offline
hey Bobster

You can try this websites… this shows pretty much how everything is written out…


http://odforce.net/tips/shaderwriting1.php [odforce.net]

http://odforce.net/wiki/index.php/VEXUsageTips [odforce.net]

http://odforce.net/wiki/index.php/VEX [odforce.net]

http://odforce.net/happy_rendering_with_vex/ [odforce.net]

these should help and also the help section in Houdini would help as well as give you examples on how it all works…

Good luck man…..

PS…If you can get the Houdini book it;s good as well…
3D Mind body and Soul Great illusions are done by great artists…
User Avatar
Member
941 posts
Joined: July 2005
Offline
bobster
Can someone please show me a simple step by step for compiling a simple vex code to implimenting it into the inline vop to applying it to some geometry. From what I gather you just need to run vcc test.vfl but I can't seem to make anything happen with it. Much appreciated.

Building From VEX code:

1. Write your code:
#pragma opname test
#pragma oplabel “Test Compilation”
#pragma label Cd “Surface Color”
#pragma hint Cd color

surface test ( vector Cd = 1 { Cf = Cd; }
and save it to a file (say, “test.vfl”).

2. Compile and create an OTL (which builds a dialog for our shader, using those #pragmas that we put in there, as well as the default data-type UI).
Go to where you saved “test.vfl” and type:
vcc -l test.otl test.vfl
If compilation succeeded, then you should see an OTL file called “test.otl” alongside your original source file “test.vfl”.

3. Start Houdini and go to “File>Install Operator Type Library…” and load the otl we just created (test.otl). Go to /shop and TAB>“te” – you should see the “Test Compilation” shader in the tab menu. Use it as you would any other shader (e.g: drag-and-drop onto your object in the viewport).


Adding Inline Code Using the Inline VOP:

The contents of the InlineVOP are inserted into the body of the context function (e.g: the body of the actual shader in the surface-shading context). The only caveat is that you should precede any local variable names with a dollar sign ($) – this is to avoid name clashes when Houdini builds the vex code. So:

1. Start Houdini and go into /vex (or the “VEX Builder” desktop if you prefer). TAB-add a “VEX Surface Shader” operator. Call it “inlinetest”, and set its “SHOP Type Name” parameter to “Inline Test”. Go into it (press Enter).
You'll see an Output VOP called “ouput1” in there – ignore it for now.

2. Add a Parameter VOP (TAB>“par”>Enter) with:
Parameter Type -> Color
Parameter Name -> “Cd” (no quotes)
Parameter Label -> “Surface Color” (no quotes)
Color>Color Default -> 1 1 1

3. Add an Inline VOP with:
Output 1 Type -> Vector
Output 1 Name -> “col”, “col” (no quotes)

4. Connect the “Cd” output of the ParameterVOP to the first input of the Inline VOP (labeled “next”). Select the inline vop, click on the “Inline VEX Code” field, and type Alt+e to bring up the text editor.

5. In the test editor's top pane, type:
$col = $Cd;
and hit Accept to dismiss the editor and accept its contents.

6. Connect the “col” output of the InlineVOP to the “Cf” input of the OutputVOP (all shaders have a fixed Output VOP – you don't add that one yourself, it's added for you).

7. RMB on any one of the VOPs you just created and from the popup menu select “Create New Shop From VOP Network”. Now go to /shop and you should see a new “inlinetest1” shop. Use as you would any other shader.

HTH.

…waiting for renders to finish…
Mario Marengo
Senior Developer at Folks VFX [folksvfx.com] in Toronto, Canada.
User Avatar
Member
7714 posts
Joined: July 2005
Online
Next time you wait, you can add it to odwiki too.
User Avatar
Member
88 posts
Joined: March 2006
Offline
Wow, thank you very much Mario. Much appreciated.
User Avatar
Member
135 posts
Joined: July 2005
Offline
that;s great Mario thanks for the info….
3D Mind body and Soul Great illusions are done by great artists…
User Avatar
Member
941 posts
Joined: July 2005
Offline
bobster
Wow, thank you very much Mario. Much appreciated.

You're very welcome. Happy VEXing!

@Edward: yeah, I should…

Cheers.
Mario Marengo
Senior Developer at Folks VFX [folksvfx.com] in Toronto, Canada.
User Avatar
Member
7714 posts
Joined: July 2005
Online
I've taken the liberty of adding it to the odwiki here:
http://odforce.net/wiki/index.php/CompilingVEXCode [odforce.net]
User Avatar
Member
7025 posts
Joined: July 2005
Offline
What I can't understand is why the fairly extensive docs I wrote for H4 (first version of VEX) have disappeared from the Houdini docs, since they took you through all this stuff, shader concepts and examples of writing all the different types of VEX ops and shaders. If they sucked, maybe someone should have said so and had them fixed

Cheers,

Peter B
User Avatar
Member
941 posts
Joined: July 2005
Offline
edward
I've taken the liberty of adding it to the odwiki here:
http://odforce.net/wiki/index.php/CompilingVEXCode [odforce.net]

Thanks a lot Ed!

@peter: If you still have them kicking around, maybe you can add them to the wiki as well? – I'm sure they're good, and VEX hasn't changed all that much so they couldn't have become obsolete

Cheers.
Mario Marengo
Senior Developer at Folks VFX [folksvfx.com] in Toronto, Canada.
User Avatar
Member
1 posts
Joined: March 2007
Offline
pbowmar
What I can't understand is why the fairly extensive docs I wrote for H4 (first version of VEX) have disappeared from the Houdini docs, since they took you through all this stuff, shader concepts and examples of writing all the different types of VEX ops and shaders.

Are these docs still available somewhere? Sounds useful to me!
User Avatar
Member
56 posts
Joined: March 2007
Offline
Hey welcome to the forum!
I think these may be the ones:

http://www.soulvector.com/pages/tutorials/houdini/ [soulvector.com]

Scroll down to the Vex* docs.

Alvin
User Avatar
Member
7025 posts
Joined: July 2005
Offline
Hmm, those aren't the ones I was thinking of, but they're very good and certainly should be read. The German one I've never seen before!

When I have some time I'll try to dig up the old one that used to ship with Houdini…

Cheers,

Peter B
User Avatar
Member
53 posts
Joined:
Offline
Hi

Is this what you mean?

http//oldsite.vislab.usyd.edu.au/users/manuals/sfx/houdini/vex/index.html

Regards,

Philip
User Avatar
Member
7025 posts
Joined: July 2005
Offline
Nope They're PDF files…
User Avatar
Member
56 posts
Joined: March 2007
Offline
Argh there're MORE Vex tutorials?! Please find them and post here Mr Bowmar!!!!

Alvin
User Avatar
Member
7025 posts
Joined: July 2005
Offline
Is that a Singapore flag living in Santa Monica?
User Avatar
Member
56 posts
Joined: March 2007
Offline
Heheh yes! I'm the new Intern at SESI LA but I hail all the way from Singapore Very chilly here

Regards,
Alvin
User Avatar
Member
7025 posts
Joined: July 2005
Offline
I lived there 4.5 years, I know alllll about it Have fun at SESI!!
User Avatar
Member
56 posts
Joined: March 2007
Offline
Oh yeah I just remembered! You were here for a bit, Steven mentioned that to me. Well here's hoping to see the PDFs you wrote soon :-)

Alvin
  • Quick Links