Tech Breakdown: Hiding Water in Boat Interiors

The Problem. Someone get a bucket!

The Mask Mesh

The water mask mesh

The Mask Shader

The shader for the water mask mesh
Toggling the water mask mesh on and off
Gross

The Stencil Buffer

Stencil - This is just signifying that we’ll be doing a stencil operation in this shader pass Ref 1 - The stencil value we'll be referencing is 1Comp always - When we look at the current stencil value, our shader should always draw its pixel regardless of the stencil value.Pass replace - When we draw a pixel, we should replace the current stencil value with our value, aka '1'. 

Masking in the Water Shader

Adding the stencil block to the water shader.
Water water everywhere but not a drop in our boat!
Oops…
Artifact is ‘fixed’

Indie Game Developer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Twitter Outage and Support Feeds Integrated with CloudReady Internet Outage Monitoring

Detect and Blur Faces with a Simple Function — image analysis for beginners

Sum subarrays of a Matrix.

How to deploy a .NET Application in Azure

Internship Experience at Oasis Infobyte

Future Programming Languages

I Created an HTML/XML Parser Tool in Alteryx Using Python SDK

SAP ASE monitoring scripts

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
David Evans

David Evans

Indie Game Developer

More from Medium

Spawn Manager Cleanup

Feature Frenzy

A More Productive Editor Layout in Unity

Mobile Applications In Unity — Rainy Day Insurance: