#Is it possible to "copy" the output of a shadergraph?

1 messages · Page 1 of 1 (latest)

strange cypress
#

The quad A shows a shadergraph creating a frame around the screen edge, on the quad's material. This is done using screenposition calculations.
I want to copy this output exactly, and have it display the same on quad B (Third quad shows the outcome I want)

Because the visual is calculated using the screen's values and the object itself, is it impossible to "copy" this texture? Do I need to find another method?
Render textues doesn't seem to work. Let me know if I explained this poorly.

#

shadergraph

#

I'm beginning to think it may be impossible sadly, and if it is, my second thought was to somehow calculate if a specific quad's pixels are within a specific camera's frustum. Would have to input these object's values somehow.

short vector
# strange cypress I'm beginning to think it may be impossible sadly, and if it is, my second thoug...

Instead of using the Screen Position node specifically, you may be able to pass in the localToWorldMatrix for quad A & Multiply that by Position in object space (matrix should be A port of multiply), Transform from World to Screen space and Divide by it's W/A component. The resulting coordinates should match the "Screen Position" of quad A regardless of where the quad being drawn actually is in the scene, if I'm not mistaken.

strange cypress
short vector
strange cypress
#

Oh I see, I will try it

strange cypress
short vector
strange cypress
#

oh from the multiply

short vector
#

From the Transform

strange cypress
#

Isnt that a vector4?

short vector
#

Oh I see, maybe the Transform node is already handling it

#

Might not need the Divide

#

But swap the ports on the multiply node. The order is important with matrix multiplication and the matrix needs to be in A port for this iirc

strange cypress
#

omg it does work! It looked weird in the graph but ingame it looks correct!

#

Now I'm not going to get too happy yet because it's a first step in a thing I'm making, but seriously thank you so much for the help

#

Had no idea there was a secret magic formula I didn't know I could do

short vector
strange cypress
#

It looks very simple now, I guess I was on the right track with needing to input a specific objects values somehow

short vector
#

The Position node in object space just access the vertex positions of the mesh data. It's the matrix property that offsets here, since that matrix is specific to quad A

strange cypress
# short vector The `Position` node in object space just access the vertex positions of the mesh...

I didn't really go into this on my first message, but will this also "block" the view for a secondary camera? The image of the screen is a render texture of the second cameras view, and its looking at the little duplicate quad down left.
When the "source quad" is competely out of the screen view the image should be completely visible, and that looks to be the case for the second camera

Will I need to make a similar way to specify a specific screen in the shader also, like i did for the object?