Instance texture deforming

Hi guys,

I’m trying to wrap my head around something:

Imagine I have instanced planes on which I’m projecting instanced textures. I would like to deform those planes individually to make the textures fish-like. How would you go about it?

The Mat/Deform documentation is quite slim about GLSL set-up and I don’t know if there’s a way to access the instances bones.

So, I see couple of ways doing that:

  1. With normal IK bones chains, but I’m not sure how to access the capture data per instance to deform individually every instance

  2. Directly on GLSL if I can access every instance and perhaps using somekind of array of textures or directly chops with displace/deform data.

I could also use the particle system converted to chop to drive the positions of the goal in the IK chain.

What do you think about it?

Best
sH

If you want to stick with GPU instancing, you might be able to combine this displacement technique derivative.ca/Forum/viewtopic.ph … 209#p34209
with UV mapping or 3D texture techniques derivative.ca/wiki088/index. … 3D_Texture

I haven’t tried this full setup yet, so, no promises: You could have each instance looking at a different displacement map slice. Depending on instance count, vertex count, and your hardware, you might be able to encode all the displacement data, for all instances, into a single texture, and offset UV of each instance to select displacement data for each instance. Otherwise, you’d need to have a W slice for each instance and use texture array. Hopefully this works on instances.

I remember trying to do something like this with texture arrays and vertex displacement once but not sure what happened with that experiment. I’ll revisit when I’m back at my TD machine. I know I have been able to access slices from 3D Texture array within a shader - just need to dig through to modify Diatom’s displacer.


You could also do this with replicators that each have their own geometry displacement going on. This might be easier, but probably too computationally expensive. From experience with replicated IK systems, it gets heavy fast youtube.com/watch?v=nl2-kcXdp9Y

Hey, mister CutMod,

Thank you again for pitching in! Much appreciated.

Yeah, I’ve tried 10 different ways already and neither of them is satifsfying. And yes, IK gets heavy very quickly. My hardware is top notch cpu and gpu wise, but still doesn’t handle it well. I’m still learning GLSL, but up for the challenge.

One of the most promising way so far, is texture displacement itself that I could easily rig for each instances with the most efficient way. Sure, it doesn’t give the flexibility of the IK chain, but in my case, with instancing movement via transform channels it should be enough.

Texture 3D is also a usefull type, I’m just not sure how to use it with instance texturing. I feel it should be one or another perhaps, if not, would be an overkill.

Thanks again for your ideas.

Cheers,mate

You can do this with a texture. Put a UV map across your whole model, and provide a texture with the displacement you need. I used r,g,b and alpha to do something different, for instance r, g can be rx and ry.

It’s non-trivial, but worth the effort.

If you get stuck, let us know and I’ll try to help.

Bruce