Why does vertex displacement on terrain differ from displacement on static meshes?
I'm working on a displacement shader for a terrain material. The shader uses the dot of the vertex normal to blend between a horizontally oriented triplanar projection and a vertically oriented landscape texture. That all works fine, and the masking behaves as intended.
However I want to add a displacement component that exaggerates the normals on horizontally oriented sections. It seems on experimentation that the normal masking I'm using (basically vertex normal dotted by (0,0,1)) does not work -- on a landscape object it behaves as if every VertexNormalWS was coming back as (0,0,1). For the rest of the shader this difference between the vertical and horizonal surfaces works properly; I can even hook up the output of the displacement section to the emissive color and see the masking there -- however the displacement acts as if its not getting masks, instead the entire landscape moves.
I assume this has something to do with fact that displacement goes through an earlier stage of the shader pipeline. Is there any documentation on what nodes will and won't work with displacement? A few will trigger compile warnings but this compiles just fine -- it simply works wrong. Looks great in the preview window though....
asked Jul 20 '16 at 05:46 PM in Rendering
Follow this question
Once you sign in you will be able to subscribe for any updates here