I don’t really have the option to create duplicates with smooth surfaces, and I therefore want to create a workaround where I calculate the interpolated vertex normals so I could use them in the vertex shader.
quick thought… you could use smooth shading and bake the flat normals into the vertex color. or if there are, use additional vertex attributes. i don’t think you can do this in unreal tho. external program required.
That video was great, but I tested it and it works on cubes and basic-ish meshes, but it doesn’t work on anything in the form of a stick or for example a fire extinguisher.
works for me. i don’t have a fire extinguisher, but i imported a smooth shaded random stick. using the flat shading shader and has a continous outline.
I have tried using postprocess outlines with custom depth and it looks great. The problem with this is that it´s for a VR project. Adding a postprocess with an outline material adds +0.8 in average in the GPU stats. That´s why I am trying to find another way.
you want it to look flat and you need the smooth shading for the vertex displacment. that’s exactly what the shader does. you export your meshes smooth shaded so the vertex normals are displacing correctly. the shader does the flat shading. it’s the other way around than you think you should do it. but that’s how that works.
you can’t compute smooth normals in a shader. you don’t have information about neighbouring vertices. that doesn’t work. do the flat shaded “hack”. it works.