Page 1 of 1

Screen space masking

PostPosted: Thu Apr 04, 2019 4:30 am
by BaaBaa
Hi, I'm bit of a shader noob and I'm sure what I'm trying to achieve is simple but I just can't seem to find the right nodes. Here's what I'm trying to do:
I want to define an arbitrary point in object space, convert that into screen space coordinates, and then take the distance between that screen space point and the screen space coordinates of a fragment to decide whether I should keep or discard it with an opacity mask. I'm really struggling with the first part, as there does not appear to be an object to screen node.

Would also like to know if there is an easy way to get renderer bounds information (e.g. size) into ASE.

Any help would be appreciated.

Re: Screen space masking

PostPosted: Wed Apr 10, 2019 4:06 pm
by Amplify_Borba
Hey there!

You can use the Transform Position node to pass coordinates from Object to Clip, then use the resulting data in the Comput Screen Pos node, as it converts a position in clip space into screen space coordinates.

We're hoping to add this conversion to the Transform Position node later on, but for now this is how you can achieve the intended results.

To pass renderer bounds information into ASE you'll have to do so through scripting, our Smear and ForceShield examples show examples of how you can use scripting together with our editor.