Point cloud dissolve - some questions

Hello all,
starting from an image (RGB 8 bit) and its depth (RGBA 32 bit) I’ve created a 3D model into the Geometry COMP with the Translate OP and the Color OP parameters, and a small cube for instancing.

So far so good.

Now I should fade/dissolve this 3D model (we can think about it as a point cloud) from top to bottom, so to create an effect where the points (cubes) of the 3D object, starting from the top ones and ending with the bottom ones, move away upwards.

I’ve been able to shift each small cube of the 3D model simply adding to the depth image a vertical TOP Ramp (with blue color - Y axis) with 3 steps (start, middle, end), but here come my questions:

  1. How can I link the middle step position of the Ramp to an expression, so to animate its position from 100% to 0% and create the desired effect?
    Its position parameter is greyed out and I can’t see any other option to control it by code (I can just move it from left to right clicking and dragging on it with the mouse).

  2. This approach seem to work well for the depth, but I should manage the color too, so that each small cubes keep its texture when it’s moving upward.
    Ideally I should use the same (animated) Ramp to shift the color image, but how to do that? I know that I can use displacement TOP, but the result image should be much higher, since the small cubes can move upperward a lot, and it should perfectly match the depth image…
    Or maybe there’s a better approach, so to move the cubes after that the texture is applied to them (something like a second Translate OP of the instance) ?

  3. Furthermore these small cubes should fade in opacity moving upperward, and my Geometry COMP has just one material. I suppose I should create a GLS to that but honestly I really don’t know how to start to code it from scratch.

I’m not obviously asking for a step by step tutorial for each of my question, but any suggestion, web link, etc, would be really much appreciated!

Many thanks!

I would suggest using the Phaser CHOP here. Based on your description, it seems like you have a bunch of instanced cubes. I’ll assume you have a CHOP where each sample represents one cube. Take the ty channel with a Select CHOP and use the Limit CHOP with the “normalize” toggle enabled. These values should now be between 0 and 1, so they’re perfect to use as the secondary “phase” input of the Phaser CHOP. Now take the output of the Phaser CHOP and connect it to either a Lookup CHOP, or use it with a Blend CHOP to produce new opacity or translation values to merge in with your previous instancing data. Last, manipulate the first input of the Phaser with something that drives your animation, with zero meaning “no dissolve” and one meaning “full dissolve.”

Thank-you for your reply DavidBraun,
I’m not using a CHOP, I’m using a TOP (a depth image) where each pixel of the image represent the position of each small cube (red = x, green = z, blue = y).
But, the idea to convert my TOP to a CHOP, and then modify one channel (the green values) with a Phaser sound interesting.
Unfortunately I’m not able to convert a TOP to a CHOP, and back to TOP (so to be able to use it for instancing), because the final TOP is weird (very small).
Please look at this screenshot

I’m a very newbie with TD, what I’m doing wrong?
Mant thanks!

phase_point_cloud_effect.tox (2.0 KB)

The shader looks like this:

uniform float uTime;
uniform float uEdge;

float phaser(float pct, float phase, float e) {
  return clamp( (phase-1+pct*(1.+e))/e, 0., 1.);
}

out vec4 fragColor;
void main()
{
	vec4 p = texture(sTD2DInputs[0], vUV.st);
	
	float phase = p.y*0.5 + 0.5; // normalize phase to [0-1]
	
	float ramp = phaser(uTime, phase, uEdge);
	// ramp is guaranteed to be between 0 and 1.
	
	p.y += ramp*3.; // animate however you want
	
	fragColor = TDOutputSwizzle(p);
}

Hopefully this helps. You may need to use multiple GLSL TOPs like this one. You could use ramp to write different attributes, like p.a = opacity where you calculate opacity yourself. Then you would use all of the TOPs you’ve created to do the instancing, accessing the right attributes from each one.

Thank-you so much! What else can I say…
I feel so stupid, and I think I should understand how to do that by operators too, a bit more confortable to me than GLSL
I’ve made a big mistake in converting my TOP to CHOP because I was using just a single row, not the full image, my big fault.
I’ve understood how to recreate the same model with TOP → to CHOP → to TOP
But If I split (select) each channel (all channels R, all chanels G, etc) and I merge them back, obviously the result is insane, because them are not ordered anymore as before.

Is there a way to recreate the same pattern (r0 g0 b0 a0 r1 g1 b1 a1 r2 g2 b2 a2 …), merging different channels?
I’ve tried with the Reorder CHOP, but it seem to me that none option can create the same pattern
Really, many thanks for your help!!!


These are the non-default settings you’ll want on your first TOP to CHOP. It will give you just 4 channels.