[Solved] Color by face normal.

   2100   9   1
User Avatar
Member
10 posts
Joined: Sept. 2016
Offline
Hi !
I'm on a project where I need to colorize primitives according to its inclination (see the image below, it must be easier to understand) , but I really don't know how to do that. Can you help me ?

(the model and its material was made on Maya )
Edited by Jaggerwock - Oct. 27, 2016 05:34:05

Attachments:
Jellyfish.gif (2.5 MB)

User Avatar
Member
1737 posts
Joined: May 2006
Online
Here's a way of doing it in sops, if you only need it at render time I'm sure it'd be easier still just using shaders and fresnel vops.
Edited by mestela - Oct. 24, 2016 18:13:35

Attachments:
facing_ratio_prims.hip (240.4 KB)
facing_ratio_prims.gif (492.0 KB)

http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
10 posts
Joined: Sept. 2016
Offline
Wow, thanks a lot !
The fresnel way won't render in viewport isn't it ?

Edit : I have an issue while trying your method with dynamics, the color adapt the movement do with the transform, but not the simulated one.. any clue ?
User Avatar
Member
1737 posts
Joined: May 2006
Online
Yes, it won't update in the viewport. You could probably write your own GLSL viewport shader if you wanted, but thats probably more effort than you need.

It should work with dynamics fine. you're doing the dynamics/deformation first, then feeding it through the setup right?

Attachments:
toy_displace_fresnel.gif (1001.4 KB)
facing_ratio_prims_deform.hipnc (1.5 MB)

http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
1737 posts
Joined: May 2006
Online
btw, it's a lovely design you've setup, I can't stop playing with it.

Attachments:
head_displace.gif (1.6 MB)

http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
10 posts
Joined: Sept. 2016
Offline
Ahah, thanks !
I use a wire simulation, and I still don't manage to make it work. If I put it before the dop import, the colors do not change with the simulate animation, and obviously if I put it after, the colors don't even appear.
User Avatar
Member
1737 posts
Joined: May 2006
Online
you might have to upload a hip file so we can see what you're doing.
http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
10 posts
Joined: Sept. 2016
Offline
Oh yes sorry !
I'm just trying to make this effect work on wire simulation.

Attachments:
wiresColor.hipnc (1.5 MB)

User Avatar
Member
1737 posts
Joined: May 2006
Online
Ok, in that scene you deleted all the nodes that did the colouring, and you weren't bringing the deformed mesh back from the dopnet into your network.

I've attached a fixed version.

Attachments:
wiresColor_fixed.hipnc (1.5 MB)

http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
10 posts
Joined: Sept. 2016
Offline
It was on purpose, I didn't knew how to reimport the dropnet, but now I know

Thanks a lot for your answers !
  • Quick Links