simonj Posted October 10, 2009 Share Posted October 10, 2009 (edited) So I'm trying to get into VEX coded shaders, since I like code more than VOPs, anyway. I'm trying to do this really simple constant shader. But it wont work. Step by step: 1: File > New operator type > VEX Type - Surface Shader Operator. 2: New window pops up, navigating to the "Code" tab and typing this: surface simpleconstant() { vector col={1,0,0}; Cf=col; } 3: Going to the Shop network view, adding my newly created Surface shade. 4: Selecting the node, pressing shift-c to make a material out of it, and adding it to an object in my scene. 5: Render with Mantra 10, Micropolygon Rendering Expected result is a box which is red. The result I get is a grey, standard shaded box. (And it's not red in the viewport either, but that has something to do with OGL parameters, right?) What am I doing wrong? Oh, and I'm using Houdini 10.0 Build 401. Thanks for any answers Edited October 10, 2009 by simonj Quote Link to comment Share on other sites More sharing options...
symek Posted October 11, 2009 Share Posted October 11, 2009 There have to be some small mistake. All steps seems to be fine. Maybe attach your scene for debugging. Quote Link to comment Share on other sites More sharing options...
simonj Posted October 11, 2009 Author Share Posted October 11, 2009 There have to be some small mistake. All steps seems to be fine. Maybe attach your scene for debugging. I swear, before I made this post I tried doing the same procedure 5-6 times, double checking each step. Now when you answered I went back to recreate the scene for debugging, and guess what? It worked. I don't know what I did different, I was following the steps I wrote here which I wrote when trying to figure out what I did wrong Anyway, thanks for your time. I'm hoping this doesn't happen again Quote Link to comment Share on other sites More sharing options...
symek Posted October 11, 2009 Share Posted October 11, 2009 don't worry, glad it work out. cheers! Quote Link to comment Share on other sites More sharing options...
simonj Posted October 12, 2009 Author Share Posted October 12, 2009 Alright, so it seems I'm not in the clear yet. This is veeery wierd. If I do this: 1: Open Houdini into a fresh document 2: Add a box 3: Create a new VEX Surface Shader Operator and assigning it to the box by the steps 1-4 in my original post 4: Add a renderer and a camera 5: Render I get a red box, as expected. However, if I make a new VEX Surface Shader Operator, still by the steps 1-4, it will not work. It is as if it never gets compiled, but it's saved to the otl and I can use it without warnings, it just doesn't work. I've attached a file consisting of one hip file and one otl file, the otl contains two materials, one constant red (which works perfectly fine for me), and one blue, which doesn't work at all. Can anyone test this and see if the same problems occur? Thanks! sj_materials.zip Quote Link to comment Share on other sites More sharing options...
symek Posted October 12, 2009 Share Posted October 12, 2009 (edited) Well, it works again, at least here. I inspected your otl file, and it seems to be fine as well. What OS you're using? Maybe some tmp/permissions/whatever issue? Are you saying, you're making two shops in the same way, and the second time always fails? You know,you can write shaders externally in your favorite text editor and compile it to otl with vcc? Edited October 12, 2009 by SYmek Quote Link to comment Share on other sites More sharing options...
simonj Posted October 13, 2009 Author Share Posted October 13, 2009 (edited) Well, if I relaunch Houdini and load in the file I posted here it works for me to. I'm on Mac OS X 10.5.7 But, if I try to change the materials to say green {0,1,0}, press apply and accept, it doesn't change color to green. So I suspect that there's something wrong with compiling. It is as if I can compile once, and never again in the same session.. I'll look into compiling with the vcc from text files, just have look up some tutorials/instructions on how to do that. Thanks for your help again! Edited October 13, 2009 by simonj Quote Link to comment Share on other sites More sharing options...
eyevex Posted October 15, 2009 Share Posted October 15, 2009 for shader writing I HIGHLY recommend cutter www.fundza.com written by Malcolm Kessen Its an incredible tool written in java so you can run it on your favorite OS. it includes nice features like saving templates, and setting up the environmet in cutter so that with a simple key combo you can compile, otl, and drop in path. just to start... It also is very tied in with renderman if you also create RSL shaders. includes functioality for many 3D script languages and renderers and to many featues to list here, the site also include a wealth of tutorials. i use it on a daily basis and have for several years now. BTW theres no cost to download. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.