How CustomProceduralTexture use itself last render result

How CustomProceduralTexture use itself as next input.
I want create a CustomProceduralTexture and use itself render result as next input.
I try

this.onGeneratedObservable.add((texture)=>{
            this.setTexture("lastRender", texture);
            // console.log(123);
        });

It not work how can I do it, Please give me an example demo.

You can use two textures to get the result.

Though the example used RTT, it should be similar with CustomProceduralTexture.

3 Likes

It works!
But I made a mistake. I need to process vertex data, maybe I should use ShaderMaterial , Can ShaderMaterial use pingpong?
I tried but didn’t succeed. I want to implement the function of drawing on complex models, use shader to calculate painting position.

I’m not sure if I catch your words, but it seems custom post processes work for your situation?

Sorry, maybe I didn’t express clearly.
I learned that Post Processes is bound to the camera, as follows:


but I want a texture based on model,like UV map, as follows:
image
How can I get ShaderMaterial rendered texture like that?