Principled Shader's opac input removes points color

   1819   4   1
User Avatar
Member
375 posts
Joined: 5月 2014
Offline
Here are 2 images I did to explain the problem. The situation is very simple and I don't understand why it does not work...

I put some yellow color on my sphere using a color geometry node, and I added a blue Principled Shader on sphere_object1 > tab Render > Material. So my sphere is green.

in Principled shader > tab Surface > "use point color" is checked. In tab Opacity > when I move the "opacity scale" slider, everything works fine. The Sphere is still green!

But I want to connect some nodes into this "opacity scale" slider, and as soon as I connect something in it, the sphere_object1's points colors is lost! The yellow is gone and only the blue base color remains, so the sphere is now blue!

why WHY WHY?

The same problem happen on a more complex Particle scene.

Some things I tried :
- Plugin the color (Cd) into the "opacity color" input does not work because I'm afraid the opacity color is not the same as the Base Color. It uses the color of the object to decide what's opaque and what's not, and so it differs from the original colors.
- Use the Alpha attribute in a Bind node and plugging it in "opac" and "opaccolor" does not bring good results.

Thanks
Gz
Edited by Grendizer - 2021年2月25日 08:59:35

Attachments:
Opac connection deletes points color Simple.jpg (228.7 KB)
Opac connection deletes points color Particles.jpg (246.5 KB)

Houdini gamboler
User Avatar
Member
7740 posts
Joined: 9月 2011
Online
Any connection to a shader causes it to be embedded into a new, outer shader. The outer shader becomes responsible for all inputs to the inner shader. Any attributes that were automatically bound to the inner shader fall off because they have no connection to the outer shader. To keep the connection, the attribute needs to be bound in the outer shader and connected to an input on the inner one.
For the principled shader, which lacks a Cd input, point color needs to be connected to the basecolor input to have an effect.
User Avatar
Member
375 posts
Joined: 5月 2014
Offline
Thanks for your help Jsmack. However there are 2 problems with this solution:

- My original base color is white. So when I plug these 2 nodes in the principled shader, it should not alter its appearance. But it does ! Check the attached pic.

- If my original base color is NOT white, how do I mix the original base color with the point color? Should I use a Multiply node with a Surface Color node?

Attachments:
Opac connection deletes points color Particles 02.jpg (293.0 KB)

Houdini gamboler
User Avatar
Member
7740 posts
Joined: 9月 2011
Online
Grendizer
- My original base color is white. So when I plug these 2 nodes in the principled shader, it should not alter its appearance. But it does ! Check the attached pic.

Not sure why it changes, is the opacity input the same as the value without the input?

Grendizer
- If my original base color is NOT white, how do I mix the original base color with the point color? Should I use a Multiply node with a Surface Color node?

Yes, use a multiply with the desired basecolor before connecting to the basecolor input to replicate the internal mixing behavior.
User Avatar
Member
375 posts
Joined: 5月 2014
Offline
Ok I found it! Here's how I did it : check the attached picture!

What I didn't get at the begining was that, in the Principled Shader, in the tab "Opacity", the upper part is the same as the upper part of the tab "Surface": "opacity scale" is the "base opacity". The "use point alpha" check box allows to retreive the points' opacity. When both are used, they multiply each other, just as "base color" and "point color". Thus, it is necessary to replicate this behavior through nodes and inputs.

So I got what I needed BUT I think it's a hassle to recreate all my settings as nodes. It would be better if Houdini uses the values inside the Principled Shader node, even when nothing is connected into their corresponding inputs.

Attachments:
Opac connection deletes points color Solution exp.jpg (460.7 KB)

Houdini gamboler
  • Quick Links