Guest Swann Posted March 28, 2008 Share Posted March 28, 2008 (edited) Hello Masters, I tried to make tiling texture based on renderman shader but I can't find repeat function in Vops, In renderman it looks like this ss = repeat(s, freq); tt = repeat(t, freq); So how to make repeated pattern in Vops ? How I have to rebuil my shader to achieve this task ? Line_and_Ring.hipnc Edited March 28, 2008 by SWANN Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted March 28, 2008 Share Posted March 28, 2008 I tried to make tiling texture based on renderman shader but I can't find repeat function in Vops. I'm fairly certain that there is no function called "repeat" in RSL. This must be a user function. Please check the #include files in the source code you're copying from -- the function is likely in an external module. However, given the way you're using it in the code snippet, I suspect it looks something like this: float repeat(float var, freq) { return mod(var*freq,1); } And in VEX, that would looke like this: #include <prman.h> float repeat(float var, freq) { return prman_mod(var*freq,1); } Please note the #include line in that last snippet -- it includes the header that contains the definition of the prman_mod function. If doing this as an InLine VOP, then remember to add "prman.h" to the includes there as well. HTH. Quote Link to comment Share on other sites More sharing options...
Guest Swann Posted March 28, 2008 Share Posted March 28, 2008 (edited) If doing this as an InLine VOP, then remember to add "prman.h" to the includes there as well. basicaly I have to just put this code #include <prman.h>float repeat(float var, freq) { return prman_mod(var*freq,1); } into inlineVOP and in include files direct him to ../houdini/vex/include/prman.h, and it should work ? well as you can see in the attached picture, somewhere in my thinking is error Need MORE Light Mario, light from your candle is not enought. Thanks Edited March 28, 2008 by SWANN Quote Link to comment Share on other sites More sharing options...
Guest Swann Posted March 28, 2008 Share Posted March 28, 2008 (edited) Ok, thanks to my another mistery source of information I got solution. Follow the rabbi... ups, Yellow nodes my friends. Thanks SYmek. Line_and_Ring.hipnc Edited March 28, 2008 by SWANN Quote Link to comment Share on other sites More sharing options...
Guest Swann Posted March 28, 2008 Share Posted March 28, 2008 Another question, how to modify size of those rings more randomly ? Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted March 28, 2008 Share Posted March 28, 2008 basicaly I have to just put this codeinto inlineVOP and in include files direct him to ../houdini/vex/include/prman.h, and it should work ? well as you can see in the attached picture, somewhere in my thinking is error Need MORE Light Mario, your candle is not enought. My suggestion was based on the RSL code you posted, not on looking at the hipfile. Since you were translating RSL *code*, not VOPs, I thought that would be enough info to go on... (BTW, did you check for include files and find the actual definition of that "repeat" function?) Anyway... I just opened the hipfile, so let me see if I can turn up the volume on my candle... 1. You're assigning texture UVs to the grid (UVProject SOP) but they are being blissfully ignored by your shader, which uses {s,t}. I added a ShadingLayerParameter VOP to bring these into your shader. 2. Looking at your last post, I see that you're using the Modulo VOP. This is *not* the same as PRMan's mod() function. VEX's % operator, which the ModVOP is a wrapper for, calculates the "remainder after division" (same as '%' or fmod() in C/C++). PRMan's mod() calculates the actual modulo. This won't be a problem while your texture UV's (assuming you used them) stay positive. As soon as either U or V straddle the 0-line or go negative you'll see the difference. This is why I pointed you to the prman_mod() function (in $HH/vex/include/prman.h), and not VEX's '%' operator (which, again, is what the ModVOP is). 3. The problem you had when attempting to set the code I gave you inside the InlineVOP, was that you included the line "#include <prman.h>" in the actual body. Don't. That's what the "Include Files" parameter of the InlineVOP is for. As you will see from the modified hipfile I'm attaching here, implementing the code I gave you as an InlineVop really *is* as simple as copy/pasting what I gave you (minus the include line, which goes in as a separate parameter). Hope that's a little more light to see by. Here's the modified hip file. Line_and_Ring_mgm1.hipnc PS: This is not necessarily directed at you, SWANN, but a general comment since I keep seeing this in a lot of posts: I find that images of VOP networks, generally manage to convey a grand total of zero information -- and making them really big doesn't improve the situation much. Since you *have* to download and open the hipfile to have any hope of knowing what is going on anyway, might as well skip the VOP image altogether. Alternatively, if possible, include the 4 lines of code that the monster VOP network actually represents. Quote Link to comment Share on other sites More sharing options...
Guest Swann Posted March 28, 2008 Share Posted March 28, 2008 Hope that's a little more light to see by. Here's the modified hip file. Follow the file ! Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted March 28, 2008 Share Posted March 28, 2008 Follow the file ! You're welcome! 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.