Jump to content

reading from arbitrary geo in a shader


Recommended Posts

Is it possible to access an arbitrary piece of geo (i.e., not the one being shaded) from a shader?  I know that you can read data from pointclouds on disk.  I also read somewhere that the "op:" syntax doesn't work for shaders (although it does work for referencing COPs from a shader, yes?).  Presumably, you'd have to alert houdini somehow to the fact that there was non-rendered geo that needed to be pushed to the ifd.

The context is that I'm trying to write a shader that does coloring based on distance from a set of guide curves.  The color transitions need to be sharp, not blurry, therefore baking the colors into the shaded surface's points in SOPs isn't an option, unless I dice it up into a zillion polys.  (I suppose a fallback plan would be cooking the color info down into a very large texture.  But all of this is animated, so I'd prefer not to render a few hundred frames of textures.)

I can confirm that using the xyzdistance VOP from within the shader doesn't seem to work - neither with op: syntax, nor reading the curves from a file on disk.

Link to comment
Share on other sites

D'oh!  Dude - nice one.  You're like a psychic for boneheaded mistakes. Reading the curve geo from a file seems to work, with that fix.

op: syntax still doesn't work, which is not entirely surprising.  Anyone know if that's is something that's been implemented, and maybe it's another "PEBKAC" issue?

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...