I am working on a project that requires me to have outlines on cubes, the outline HAS to be a shader, not matter if it's a combination of nodes or a script,it has to be a shader. Meaning that I can't add extra-mesh like the solidify modifier would do.

And I couldn't find any way to do outlines on a sharp cube with nodes, every single way I saw to do it was with smooth objects. The project I'm working on will be NPR, and I want to render on my GPU to minimize render time.

Here is a mockup of what I want to do, you can see all of the objects in the scene have their outline visible, and only the OUT-lines


The outline also has to be able to take a texture's color, so the solodify modifier is NOT an option (I said it already but I want it to be clear). Here is a mockup of how it would look

enter image description here

Hope this was precise and well explained enough.

EDIT : Freestyle is NOT an option.

  • 2
    $\begingroup$ I know you said you need a shader, but Freestyle plus the compositor could do exactly what you want. Is that an option? $\endgroup$
    – hekete
    Aug 22 '19 at 6:03
  • $\begingroup$ @hekete it's not an option, I need it to be a shader, the compositor doesn't produce a good enough result. plus freestyle has a lot of problems rendering outlines. $\endgroup$
    – azagwen
    Aug 22 '19 at 12:37
  • $\begingroup$ I would say freestyle is pretty good at rendering outlines these days... Any way I think you will have to write a GLSL shader to do what you want otherwise. $\endgroup$
    – hekete
    Aug 22 '19 at 13:22
  • $\begingroup$ @hekete I had some troubles with freestyle, even in 2.8. And yeah, that's why I precised "node or code" shader. $\endgroup$
    – azagwen
    Aug 22 '19 at 13:52
  • $\begingroup$ @hekete to clarify my last answer : no I won't be using freestyle, I didn't precise "shader" to use freestyle, I won't use it because it's not good enough for what I'm looking for. $\endgroup$
    – azagwen
    Aug 27 '19 at 2:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.