- Home /
 
               Question by 
               derPuppeteer · Apr 01, 2014 at 09:27 PM · 
                shadingflat  
              
 
              Change Shademode to get Data from one provoking vertex
I really need the good old Shadermode = Flat in Unity in order to reduce my vertexcount by a factor of 3. Is there any way (no dx11 pls) to get data from a single provoking vertex?
Some information about what I am talking about: Nvidia.com Shademode Flat Shading explanation
Thank you!
               Comment
              
 
               
              Answer by laurentlavigne · Jun 14, 2016 at 05:51 AM
The closer I got to, which doesn't work on mac is
 Shader "Flattener" {
     SubShader {
         Pass {
             GLSLPROGRAM
 
             #extension GL_EXT_gpu_shader4 : require
             flat varying vec4 color;
 
             #ifdef VERTEX
             void main()
             {
                 color = gl_Color;
                 gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
             }
             #endif
 
             #ifdef FRAGMENT
             void main()
             {
                 gl_FragColor = color; // set the output fragment color
             }
             #endif
 
             ENDGLSL
         }
     }
 }
Your answer
 
 
             Follow this Question
Related Questions
Is there a flat shading option 1 Answer
Flat shading procedural generated mesh? 1 Answer
Can terrain detail meshes have basic shading applied? 1 Answer
Flat lighting for 3D game with Orthographic camera 4 Answers
Shading Problem 1 Answer
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                