evening all,
is it true to say that any point attribute (say “life”, “numhit”, “id”) can be passed into a vex shader?
I have manged to pass floats and vectors (having found that once they are named as parameters in the parameter list they are in) but seem to be struggling with other attributes.
In the attribute spread sheet things like “numhit” and “id” look like ints and ive declared them as int parameters, but they dont seem to be bound and i dont seem to get values from them.
should they be passing? or are some attributes nonpassable?????
thanks for any help, much appriciated (one week to my deadline and all, ha)
ben
__ passing attribute passing
6751 8 1- ben.toogood
- Member
- 16 posts
- Joined: 7月 2005
- Offline
- ben.toogood
- Member
- 16 posts
- Joined: 7月 2005
- Offline
- EigenAlex
- Member
- 639 posts
- Joined: 7月 2005
- Offline
Hi Ben, you can pass any arbitrary attribute to your shaders depending on how your VEX shader is set up. You just have to ensure your attribute names to matches that declared in your VEX shader.
You can use Attribute SOP to rename your attributes and Attribute Create SOP to create any arbitrary attributes.
I don't believe there are any default shaders shipped with Houdini that will recognize attributes such as “numhit” “id” etc. However, depending on the type casting (vector, float, etc.) of the variable in your shader, you may rename those attributes to that of the shader.
You can use Attribute SOP to rename your attributes and Attribute Create SOP to create any arbitrary attributes.
I don't believe there are any default shaders shipped with Houdini that will recognize attributes such as “numhit” “id” etc. However, depending on the type casting (vector, float, etc.) of the variable in your shader, you may rename those attributes to that of the shader.
- ben.toogood
- Member
- 16 posts
- Joined: 7月 2005
- Offline
- EigenAlex
- Member
- 639 posts
- Joined: 7月 2005
- Offline
- ben.toogood
- Member
- 16 posts
- Joined: 7月 2005
- Offline
thanks again alex,
ive had success in using the numhit attr in a pop VEXop, and it work lovely. but
i would really like to work at the shop surface context, switching sprites based on hit ( both time and number). these attributes pass into the sop context and i can see them in the parameter spreadsheet and when i middle mouse on my nodes.
when i have a surface shader that checks (isbound “numhit”) though i get 0, unlike in pops where it is fine.
my solution so far is to set attributes i know i can pass through successfully (ie Cd) based on numhit in the pop context.
is this the best? or am i missing some thing?
ta
ben
ive had success in using the numhit attr in a pop VEXop, and it work lovely. but
i would really like to work at the shop surface context, switching sprites based on hit ( both time and number). these attributes pass into the sop context and i can see them in the parameter spreadsheet and when i middle mouse on my nodes.
when i have a surface shader that checks (isbound “numhit”) though i get 0, unlike in pops where it is fine.
my solution so far is to set attributes i know i can pass through successfully (ie Cd) based on numhit in the pop context.
is this the best? or am i missing some thing?
ta
ben
- EigenAlex
- Member
- 639 posts
- Joined: 7月 2005
- Offline
- EigenAlex
- Member
- 639 posts
- Joined: 7月 2005
- Offline
Hey.
I think that it was correct that you can pass any arbitrary variable to VEX. However, you'd have to be careful about certain functions becuase some function won't accept integer input and will thus give you error. Could that have been the problem?
My apology, I am learning VEX as well, so I am eons away from being advanced user…
I think that it was correct that you can pass any arbitrary variable to VEX. However, you'd have to be careful about certain functions becuase some function won't accept integer input and will thus give you error. Could that have been the problem?
My apology, I am learning VEX as well, so I am eons away from being advanced user…
- ben.toogood
- Member
- 16 posts
- Joined: 7月 2005
- Offline
-
- Quick Links