Last year I remember reading up on of one of the Blog posts on Simon Schreibt, Assassin’s Creed: Black Flag – Waterplane, where he explains how in Assassins creed Black flag the water is hidden when boats are overlapping the water plane.
I was really curious how this is done so I thought I'd try this out for myself. I did some research on how i can do this and found a tutorial by Nilson Fernandes de Lima where he uses Stencil to mask out water for boats:
https://www.youtube.com/watch?v=69YfV8ru-ZM&list=PLfJSXC5qE3FxxKvT2-l2CN6qTSvGdgVq9
I have managed to implement his method into the water system:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivKDJYgQRRyR5eSeLO9VHJCRuzYz_drzhAli4unjv7PV5GDjv1yxVuwrOWM2JFAXaYyxmo1-IjyD7zyA2YGrIVs85VW-8u10LzxxXRKIAZQPR1DbPPtEwG11ESbeqqhm32aBiT4imfLrrd/s640/e93ce0a0215730b3b8b04ac7eb0b42f2.gif) |
Cube setup to custom depth stencil value to 8. When not rendered in main pass, it can be used to hide the water Plane. |
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4tP51M5TfgDPxuZslEriArgy1RYo9FUeEeeMcYzuHdXbH-iOGXHnajcpkCGIz_P-nylmkNlPqK0kZ0LPs1T7jQ0riuMB9L3x18k29CyZTgQYe3InlvGommo94toxZNwOfLzKAoyW9Txsv/s320/Annotation+2019-09-16+213207.png) |
Material Setup for custom Depth Stencil if it's equal to the stencil value parameter then the opacity is set to 0 |
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy9jlv63ntYvXEq2zLbFbsasjGJ-fhGKTX7bEhG6pZzi3n4EbxyA3v6GEbs0vkO9sCHdSZxocnxb3r7k7mlX9hJePv8WLyQ2RZ_Ypc6OTERDGOcYFGZaaiu98-G1U7lqZDIlfh9l89Toh2/s320/Stencil+setup.png) |
Settings for Stencil in the details panel of the object. Custom Depth Stencil Value must be the same as the material parameter otherwise it won't work. |
Comments
Post a Comment