Stencil

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:

Cube setup to custom depth stencil value to 8. When not rendered in main pass, it can be used to hide the water Plane.
Material Setup for custom Depth Stencil if it's equal to the stencil value parameter then the opacity is set to 0
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

Popular posts from this blog

Environment Showcase Concepts

Distance Field water foam

World alignment (Tri-planar mapping)