Texture in screenspace UV - how to fix position/offset

Node-based Shader Editor

Texture in screenspace UV - how to fix position/offset

Postby pdrummond » Fri Nov 02, 2018 8:22 pm

I'm working on a shader that uses Tonal Art Mapping to create non-photorealistic effects. I'm able to blend the tone textures with the light intensity and map it all to screen space UV, but of course I've got the shower door effect where the tone texturing looks like an overlay on the screen. I'd like to lock the texture by applying an offset based on the object's position in screen space. I've tried a few things but I'm stumped. Can you recommend the best approach?

Image
pdrummond
 
Posts: 26
Joined: Wed Sep 19, 2018 12:28 pm

Re: Texture in screenspace UV - how to fix position/offset

Postby Amplify_Borba » Mon Nov 05, 2018 11:28 am

Hello, I'm not entirely sure on what to suggest without examining the shader itself and, although this is beyond the scope of our support, we might be able to provide some insight if you're able to share a sample with us.
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Texture in screenspace UV - how to fix position/offset

Postby pdrummond » Tue Nov 06, 2018 12:47 pm

Sorry if I wasn't very clear. I'm blending textures in screenspace UV and wondered if there's a way get the x and y position of the target object in screenspace too, so I can use this as on offset for the texture. At the moment the texture simply acts as an overlay across the whole screen, but I'd like to clamp it to the target object so it actually moves with it.
pdrummond
 
Posts: 26
Joined: Wed Sep 19, 2018 12:28 pm

Re: Texture in screenspace UV - how to fix position/offset

Postby Amplify_Borba » Tue Nov 06, 2018 2:53 pm

No problem, thank you for elaborating!

I believe that this has been previously tackled by another user in this tweet.

Please refer to the comments for a screenshot of the node setup and the code itself, and do let us know if this helps you achieve the intended effect.
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Texture in screenspace UV - how to fix position/offset

Postby pdrummond » Wed Nov 07, 2018 10:42 am

Thank you!
pdrummond
 
Posts: 26
Joined: Wed Sep 19, 2018 12:28 pm


Return to Amplify Shader Editor

Who is online

Users browsing this forum: No registered users and 49 guests