peliosis Posted July 18, 2006 Share Posted July 18, 2006 I'm learning to code vex shaders. How to preview the code most efficiently, I'd like it to update as soon as it's compiled. I'm proceeding as follows: -write vfl file -compile with vcc to /houdini/vex/surface -preview with generic surface shop now when I recompile a shader it doesn't update in shop preview window, which forces me to use mantra as previewer which is not so convenient. As I'm a total noob in this field, could you describe the most common way of working on (non vop) shaders? Quote Link to comment Share on other sites More sharing options...
SvenP Posted July 18, 2006 Share Posted July 18, 2006 I used Cutter for a while but now i am writting directly into the type properties. Step 1 : File menu / New operator type for example surface shader operator I usually install the library to /home/houdini8.x/ and create a new otl for every shader Step 2 : In the opening operator type properties window click accept Step 3 : Go to shops and add your shader to the scene rightclick on the shader and select type properties go to the vexcode tab Step 4 : edit your shader with testcompile you can check if the shader compiles without errors with apply you apply your changes and your shaderball/ objects instantly use the changed shader. with accept you accept your changes and close the window With alt+e you can open an external editor to edit your code if you dont like the inbuilt one I hope this helps a bit Sven Quote Link to comment Share on other sites More sharing options...
thomas.waldinger Posted July 18, 2006 Share Posted July 18, 2006 another way would be to set a hotkey for 'otrefresh' f.e. alias F10 otrefresh and just hit that every time you recompiled your shader. Quote Link to comment Share on other sites More sharing options...
peliosis Posted July 18, 2006 Author Share Posted July 18, 2006 Thank you very much! In the meantime I got another solution: Ptakun encouraged me to use inline vop which also works great. With this new operator I'm confused how to expose parameters in UI? Get properties from vex code is checked, when i write : #pragma export freq(2) It founds an error, i tried vcc -u option but what to do with additional .ds file? It's not well documented, could you give me some more hints? Quote Link to comment Share on other sites More sharing options...
SvenP Posted July 18, 2006 Share Posted July 18, 2006 I am not 100 % shure if youre talking about inline vop or a complete shader now for inline vop just add a parameter vop wire it with the inline vop and prefix the parameter name with $ for example $parm1. for a regular shader pragmas give the compiler only additional information and are optional but you have to declare your parameter elsewhere. example : #pragma label testparm "My parm" // display the label My parm for the parameter testparm #pragma hint mycol color // tell the compiler that mycol is a color and not a simple vector #pragma group mygroup testparm mycol // tell the compiler to group testparm and mycol into one tab surface mysurface(float testparm=2; vector mycol={1,1,1}; ) // declare a parameter testparm of type float with a default of 2 { // Whatever your shader does } Quote Link to comment Share on other sites More sharing options...
peliosis Posted July 18, 2006 Author Share Posted July 18, 2006 Thank you for a hint Thomas, I'm coming to conquer hscript:) Sven, sorry for not being clear enough. I was talking about complete shader. I got it working now. The problem was that parameters didn't appear in UI, because I did not declare them in the shader name line, I was writing: surface mysurface() instead of surface mysurface(vector diff=1; vector amb=1; etc) Now everything is ok. I don't understand dialog script .ds files yet, are they responsible for UI? Do I need to care about them while writing a shader as new surface operator? 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.