- Home /
Stencil on iOS
Hello,
I have an ocean made out of several patches of different LOD levels, which creates cracks sometimes while the water surface is animated. To easily counter this without stitching the patches with extra geometry, I thought of using the stencil buffer to render a large quad with the same shader of the ocean, covering the whole area of the patches. Here is my process to do this (I show only the stencil parts of the materials):
1) Ocean shader:
Stencil { Ref 2 CompFront always PassFront replace
ZFailFront zero
}
2) The I render the big quad at the same height using: Stencil { Ref 2 CompFront notequal }
Which in the editor, it renders the quad exactly where the cracks between the patches are, expected behaviour.
On iOS though, it doesn't seem to work and the quad is rendered directly on the ocean, as if no stenciling even took place.
Anybody has experience with such behaviour? Many thanks