Creating a cutting plane effect creates a spherical cutting plane.
I made a cutting plane effect using a material in UE4. However, when I move the plane around it cuts in a slight spherical shape, not a perfect plane like I want it to. The selected white device on the right dictates the orientation of the plane. I used the up vector as the plane definition.
I keep the position and up vector of the plane using a MaterialParameterCollection.
I calculate the vector between the position of the fragment and the position of the plane, and dot that vector with the up vector. Both are normalized so I can use the cosine value to find out on which side of the plane the fragment is and thus mask it away if it is on the do-not-render-side.
However, the cutting plane bends as you can see in the first image. I have no idea why.
The second problem is that I want to be able to select an actor and use the cutting plane on that actor only; essentially turning the effect on and off on any material. For example, I have a hologram material and a cloth material. I want this masking effect to apply to the result of the underlying material. I tried making it a material function and override the mask or do it the other way around, but no mixing and meddling made it work. I either had to not get the cutting effect on the hologram or I didn't get the transparent effect.
Is there a way to make it easy to apply the cutting plane to any material as described above?
Thank you for your help.
asked Jun 25 '16 at 12:08 PM in Rendering
The answer was that my assumption that anything greater than zero would be treated as non-zero like booleans are in C++. However, this is wrong. Once I changed the material to return a zero OR a one using an IF module it works flawlessly. Change the clamp above for the if module.
answered Jun 26 '16 at 10:05 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here