- Home /
Flat Shading / No Vertex Interpolation
Hey, I just wanted to know if there is a way to shade a object flat without adding additional vertices / normals? In OpenGL its easy, you just have to add the "flat" keyword to your normal in / out variable (https://www.opengl.org/wiki/Type_Qualifier_(GLSL)#Interpolation_qualifiers) to stop interpolation of normals. Is there a way to do the same thing in cgshaders / shaderlab?
I believe you can use the "nointerpolation" keyword to a surface declaration, or using the absolute value of the normals also does it. Not tried either of these things myself, however.
Answer by tanoshimi · Aug 24, 2016 at 06:25 AM
The only reliable cross-platform way I know to do this is to prevent having any shared vertices in the first place. Either duplicate vertices in your modelling program or, in Unity's model import settings, set Normals to calculate and smoothing angle to zero, so that all the vertices of each face share the same face normal.
Your answer
Follow this Question
Related Questions
Shader - What is float3.xy? 1 Answer
How to achive the same look? Which shaders to use? 2 Answers
shadertoy to unity,Shadertoy to unity 0 Answers
Dissolve Shader Problem 1 Answer
Unity Advanced Shader Help 0 Answers