# Procedural flat shading

**URL:** <https://forums.unrealengine.com/t/procedural-flat-shading/372305>\
**Category:** Rendering\
**Tags:** low-poly, unreal-engine, tessellation, procedural, question\
**Created:** [October 3, 2016, 1:10pm UTC](https://forums.unrealengine.com/t/procedural-flat-shading/372305 "2016-10-03T13:10:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deathrey](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Deathrey](https://forums.unrealengine.com/u/Deathrey)\
**Post date:** [October 3, 2016, 1:10pm UTC](https://forums.unrealengine.com/t/procedural-flat-shading/372305/1 "2016-10-03T13:10:18Z")

</div>

I would like to get advice/ opinions regarding stylized flat shading material for flat surfaces. It will be used on modular flat wall/flooring/ceiling kits.  
My aim is to make a **flat plane** with texture applied to it look like a t[ypical low poly flat shaded asset](https://cdn.tutsplus.com/cg/uploads/2014/01/Blender_LP_Illustration_s04.jpg), with well defined triangles visible.

This set of constraints should be adhered to:

- -Triangles should somewhat follow the actual texture, not just randomly  
placed.
- -Triangles must be actual geometry. Normals alone are not enough.
- -No anything above of what material editor/blueprints can offer.
- -Avoid repetition when modular pieces are placed into the game level.

So far I’ve identified three possible paths for me to follow:

1. Procedural mesh generation in  
blueprints, based of height map and  
noise.
2. Use of tessellation shader.  
Something like tessellation  
multiplier map, that controls the  
size of triangles, height map for  
displacement, and random noise to  
offset the vertices, coupled with  
reconstructing new normals after  
that. I’m frankly favoring this  
option so far as I’ve successfully  
used it before, but I have concerns,  
mostly because whole scene is likely  
to be always transform bottlenecked.
3. Instead of doing it in the engine,  
automate the process in content  
creation software, and export  
several variations of the same mesh.

Maybe anyone has something to say regarding that? My in advance.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_0c62419a](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_0c62419a](https://forums.unrealengine.com/u/anonymous_user_0c62419a)\
**Post date:** [October 4, 2016, 8:46pm UTC](https://forums.unrealengine.com/t/procedural-flat-shading/372305/2 "2016-10-04T20:46:47Z")

</div>

If I am understanding you correctly I would create a tileable normal map based off a triangulated mesh like this

 ![109702-lowpoly_n.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/8/e/78e644c6a97336aa1632d2621d98af89a202739f.jpeg)

.

Granted I would make it more random and less grid like, but this image is just an example. I don’t think tessellation is needed if you use a plane with enough triangles already in it. You would save on performance rather than actively tessellating though the shader. You can still use your height map and noise idea, but just world position offset should suffice.

Also make sure the plane has no smoothing groups and the mesh is set to compute normals.

Thats my opinion anyway,

---

<div class="post-metadata">

**Author:** ![xSheim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@xSheim](https://forums.unrealengine.com/u/xSheim)\
**Post date:** [November 27, 2018, 7:19pm UTC](https://forums.unrealengine.com/t/procedural-flat-shading/372305/3 "2018-11-27T19:19:24Z")

</div>

Hi, I am currently struggling with the same problem. Right now what I have is a procedurally created mesh that is unfortunately way too smooth. How did you approach the wanted result? I see the answer below was accepted but I’d be incredibly grateful if you showed your method in more detail. in advance!

 ![260644-screenshot-4.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/7/7/a771879e715087c03200811d2f5c5a7a53984891.png)

---

<div class="post-metadata">

**Author:** ![Deathrey](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Deathrey](https://forums.unrealengine.com/u/Deathrey)\
**Post date:** [November 27, 2018, 7:34pm UTC](https://forums.unrealengine.com/t/procedural-flat-shading/372305/4 "2018-11-27T19:34:50Z")

</div>

Jeez, that was two years ago. I’ve ended up following advice by and using procedurally generated normal map and displacement map, based on several octaves of Voronoi noise.

---

<div class="post-metadata">

**Author:** ![xSheim](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@xSheim](https://forums.unrealengine.com/u/xSheim)\
**Post date:** [November 27, 2018, 7:42pm UTC](https://forums.unrealengine.com/t/procedural-flat-shading/372305/5 "2018-11-27T19:42:05Z")

</div>

Oh, and you still remember 🙂 Thank you, it’s a big help. One more little question: did you manage to get the collision working? Or maybe you didn’t even need the collision?

---

<div class="post-metadata">

**Author:** ![Deathrey](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Deathrey](https://forums.unrealengine.com/u/Deathrey)\
**Post date:** [November 27, 2018, 9:47pm UTC](https://forums.unrealengine.com/t/procedural-flat-shading/372305/6 "2018-11-27T21:47:16Z")

</div>

The scope did not involve collision. I only needed flat shaded appearance on models, that were not authored with flat shading in mind.
