0
\$\begingroup\$

I have a Shader graph in which I am using "Scene Color" node to do processing on camera feed, It is Unity AR foundation project

Until now I was passing color to be used using a property,

Now I need to take color from top left corner of the object and use it for further logic, Is there any way to do that?

I had tried with various position nodes and UV nodes without any luck. Here is one of such try:

enter image description here

Here is a demo shader to understand what I am doing and below it is screenshot of same shader: enter image description here enter image description here

Now I want to pass UV to Scene Color node which will always give me color of top left corner of the Object.

I had also tried using position from Object node but it always gives me top left corner of screen and not top left or center of the Object.

\$\endgroup\$
3
  • \$\begingroup\$ Unless you tell us, we won't know which object in that image is using this shader. If it's the text and you want to sample from the top-left of the block of text then that might be significantly more challenging than each character sampling from the top-left of its character rectangle, due to the way these things get batched. Can you clarify? \$\endgroup\$
    – DMGregory
    Commented Dec 22, 2021 at 15:18
  • \$\begingroup\$ @DMGregory The object in question is the yellow plane with lines texture, text is part of the background. \$\endgroup\$
    – Dhruv
    Commented Dec 23, 2021 at 6:54
  • \$\begingroup\$ @DMGregory updated content of question. \$\endgroup\$
    – Dhruv
    Commented Dec 23, 2021 at 9:09

0

You must log in to answer this question.

Browse other questions tagged .