Page 1 of 1

Cutting out based of an object

PostPosted: Thu Jan 18, 2018 9:28 pm
by finepointcgi
Hello,
I was wondering how you would go about cutting a hole in a wall based of an objects placement. I have tried many shaders and none of them display the hole in the shadow. What im asking for is basically a Boolean operation. Is it possible to get another object position and do this?

Here is a guide that shows what I want to do. I do not understand shader code so I don't even know where to begin to get this to happen in amplify.
http://www.strichnet.com/creating-a-cut ... d-windows/


Thank you for your help,

Mitch

Re: Cutting out based of an object

PostPosted: Fri Jan 19, 2018 2:35 pm
by Amplify_Borba
Hello finepointcgi, thank you for getting in touch!

You raised an interesting question regarding cutout shaders, I would recommend that you look into our SphereMask function, which may provide some insight on how to achieve a simple cutout effect which takes shadow information into account, also allowing you to define the Radius and World Space Position of the effect.

Being a Shader Function, you are free to edit and extend it according to your needs, so it's possible to add a fading effect to the cutout, for example, or even to change any of its already implemented inputs and outputs.

You can find it within the ASE package at AmplifyShaderEditor\Examples\Assets\ShaderFunctions\Official\SphereMask.

SphereMask.jpg
SphereMask.jpg (204.25 KiB) Viewed 1792 times


Please let me know if this helps, thanks!

Re: Cutting out based of an object

PostPosted: Fri Jan 19, 2018 5:17 pm
by finepointcgi
Thank you very much for the reply. It does help quite a bit. Is there a way to change it to a square? im not really sure of the math on it shader programming is very new to me.

Thanks,
Mitch

Re: Cutting out based of an object

PostPosted: Mon Jan 22, 2018 12:41 pm
by Amplify_Borba
finepointcgi wrote:Thank you very much for the reply. It does help quite a bit. Is there a way to change it to a square? im not really sure of the math on it shader programming is very new to me.

Thanks,
Mitch


No problem, we've set up a simple sample for a Box Mask, which includes a shader function that you may import into your shaders, for your convenience.

BoxMask.zip
(6.22 KiB) Downloaded 223 times


You may further edit the shader function if you require to extend if for any specific purpose.

Please let us know if this helps, thanks!