Jump to content

Efficiency with VOPs


itriix

Recommended Posts

Hello everyone,

I've been playing around with different ways of creating VOP networks and i'd like to know what ARE or ARE NOT the benefits of particular methods.

Examples:

1. I'm creating custom VOPSOPs to do a variety of things. One example is a noiseVOPSOP... I want it to be able to work with any input and output, which also means their TYPES will drive the network. Originally, I created a pulldown menu on the outer level of the HDA for the user to choose the input and output type as well as the input attribute and output attribute to work on. The pulldown menu controlled a switch inside the HDA that would switch between a series of COPIES of the actual noiseVOPSOP, with each copy having a "slight" change inside that had to do with the input and output types involved.

The pulldown had:

Float Float

Float Float3

Float Vector

Int Float

Int Float3

Int Vector

Vector Float3

Vector Vector

Depending on which one was chosen, the switch would use the particular noiseVOPSOP that was set up for that particular combination of input and output types... *since i learned that input and output types in VOPS cannot be dynamic*

After using this method for a while, it SUCKED soooo much when I needed to make "global" changes to my noiseVOPSOPS... because I would have to change it on EVERY single one. However, I had been suggested that "this" was the better way of doing this. (referring to use a switch to choose between different noiseVOPSOPs that worked on particular input and output type combinations then)

Lastly, I finally couldn't take it anymore because it was too much of a hassle for me to go back and make changes to every single network, and implemented a new improved design that made use of compare and if-then block vops... essentially it went like this:

param vop: inputType

type: int

use menu:

0 Float 1 Int 2 Float3 3 Vector

I then plugged the output of this param int each of 4 compare vops... each one set respectively to TRUE based on a particular int value that corresponded to the value in the menu...

The four comparisons were like this:

vop input == 0, true (float)

vop input == 1, true (int)

vop input == 2, true (float3)

vop input == 3, true (vector)

each one of these was plugged into their respective IF - THEN BLOCK, that contained the "BULK NETWORK" all of the actual good stuff. Example:

comparison1 was plugged into if_INPUT_FLOAT's condition... *so if the input was float, it was be true* and therefore this IF would be used. Jumping inside the if, there was the main network, lastly, there was another set of comparison/if then block vops used with a param vop that handled the OUTPUT type, and the same exact idea as before was used here, to handle the output types...

Okay i finally got it set up, i have one noiseVOPSOP now instead of a million copies, and if I have to make an overall change to the network, I just need to update the "bulk network" that doesn't have to do with the type handling stuff. And i'm done! FINALLY MY QUESTION:

HOW MUCH more efficient is this way? I'm curious, how VOPS works, meaning. The fact that I have everything tucked away in If-Then Blocks, will this save time in NOT evaluating the OTHER If-Then Networks? Because I heard the "switch" in houdini isn't very efficient, in that it evaluates all of the inputs and then just switches between them, instead of ONLY evaluating the "needed" input. *EDIT* I just learned that this is only the case for the "switch vop" not the Sops Switch node.

Thanks for all your time,

Jonathan

Edited by itriix
Link to comment
Share on other sites

Just thought of another question i've been having... Is there a way to do TYPE detection? Small inconvenience, but as of now, the user has to use a pull down menu and manually set the input and output type, whereas, it would be really nice if the input and output type of the "input attribute" and "output attribute" could automatically detected

Link to comment
Share on other sites

A new question, on the lines of the "switch vop" efficiency...

I realized after I built the "new method" of doing everything inside of vops, for my custom noiseSOP, forgot to do the "special case" for P... So I was stuck trying to think of the best way to go about this with my current setup. I'm attaching a pic of what I ended up doing, but i'm thinking there should be a more efficient way, *especially if the switch vop* is evaluating all of the inputs, which seems like in this case, it would make all of my "if-then" blocks somewhat USELESS in terms of efficiency, since each one would have to be evaluated just to get the output P...

*i also have outputV that comes along with P, so that if you are using particles for example, their velocities will be updated with the noise*... but for simplicity of the topic, i'm just concerned about handling P. What i'm thinking now is that maybe i should just make my "if-then" blocks for the inputs also have a check for if the OUTPUT is P... if it's NOT P, then i will just use the specific INPUT TYPE if-then input blocks (input float, int, float3/vec).

if the output IS P, then I have another set of 3 if-then input blocks (input float, int, float3/vec)... JUST for calculating noise for P... And then ouputting the noiseP from those three special if-then input and P blocks, and switching between the particular "input if-then and P" output P to get the final P? this switch would be driven by the param: inputType which is just an int type parameter with a menu... Hmmm but actually when I think about it more, this just seems to put me right back to the same inefficiency as just having the "three input type" if - then blocks, that already handle P... Hmm. Thoughts? Ideas?

I'm not sure if this is clear what i'm trying to say. I hope it makes some sense. Please feel free to make any suggestions. I'm really interested in making sure this thing is as efficient as possible!

post-3821-125733478657_thumb.png

Edited by itriix
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...