Hello everyone!
What I want to do is render a viewport and use the resulting texture on another viewport. I know the docs have a section on "custom post processing" (custompostprocessinggodotdocs), but it relies on the node hierarchy to work, which would work poorly for what I want to do.
Imagine I am doing a 3x3 blur and I want to apply the same blur multiple times, to get a blurrier image without using a large kernel. In code it would look something like:
create ViewportA //VpA
create ViewportB //VpB
create ViewportArray[] add ViewportA and ViewportB
render Viewport A using SCREEN_TEXTURE and blur
for i 0...k :
render ViewportArray[(i+1)%2] using ViewportArray[i%2] and blur
In this example k is the number of times to reapply the blur. so if k is equal to 5 for example I would have (imagine they are always using a material that blurs the image it is given)
render VpA using SCREEN_TEXTURE
render VpB using VpA
render VpA using VpB
render VpB using VpA
render VpA using VpB
render VpB using VpA
the result would be VpA having a SCREEN_TEXTURE with a blur 3x3 applied 6 times.
if I wanted to do it with the node structure setup I would need to create 6 viewports instead of 2 (without counting the scene viewport), and nest them accordingly. There is a note on the custom portprocessing page that says:
You can also render your Viewports separately without nesting them like this. You just need to use two Viewports and to render them one after the other.
But I have not found any render, or update functions for a specific viewport. There is a function on the visual server called "force draw" but it draws all the viewports attached to it, but I just want to render a single one.
Any help on this would be really appreciated!
Thank you in advance