0 votes

Currently I'm working on interacting effects. I want to use 4 render targets to simulate water ripple effects. These render targets represent for water surface height at current frame, previous frame, next frame and for temporary use respectively. And I want to simulate the effect following 4 steps:
1. Draw current frame texture to temp texture.
2. Draw additional height caused by ripple source to temp texture.
3. Take temp texture as source, calculate ripple spread in one frame and draw to the next frame texture.
4. Simply copy current frame texture to previous, and next to current.
Finally I can use the next frame texture to calculate water normal etc.

So is there any good method to make it? As far as I know, I can use viewports to achieve it, but I don't know the order they are drawn. Is it possible to draw a render target in code? May be something like drawtotexture(texture, node).

Godot version 3.4
in Engine by (21 points)
edited by

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.