Jump to content

Vop Sop Texture() Function?


asa

Recommended Posts

Hello all. I am looking to have an image map some parameters on a surface in the fastest way possible.

Simple case: A black and white texture map should change a map a surface point parameter (evaled each vertex) from 0->1.

Using the pic() expression in a point sop is way slow. It works but I think it is not caching the image each time and rereading it in some very slow way. Working at 720x486 with a piece of geometry with 12000 verts is taking a couple of minutes per frame.

I looked into VOP sops but there is only a texture3d() function and that takes i3d files. I suppose I could preprocess my textures to thin i3d files but that seems a bit limited. Is there another vop in sopland that would to what I want?

Thanks all.

Asa

Link to comment
Share on other sites

Offhand, I don't know why texture() wouldn't be valid in the SOP context. However, I also don't see why tex() would be slow. The textures are supposed to be cached. It might be faster if you converted your picture to .rat format first though. Or perhaps use texni() so that it doesn't try to do any filtering. Finally, maybe your expression is being evaluated a lot more than you think it is. One thing to try is to use an AttribCreate SOP to assign the texture values to your points in one pass first. Then do all your complicated expressions using a second SOP. That way, you can more easily tell where the bottleneck is.

Link to comment
Share on other sites

I believe the VEX texture() calls use/need shading derivatives to estimate the filter size and that's why they're missing from the SOP context. For the SOP context you can use VEX's colormap() function, which is also available as the "Color Map" VOP. Keep in mind however, that a VEX SOP won't be able to operate on vertex attributes -- only point attributes.

HTH.

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