- This topic has 8 replies, 2 voices, and was last updated 1 year, 7 months ago by matin00x.
-
AuthorPosts
-
2023-04-21 at 10:20 am #63175matin00xCustomer
Hello to everyone,
I have this material in Blender where i have 2 Principled BSDF shaders mixed with mix shader and there is a texture connected to fac of the mix shader.
I would like to change the Principled BSDF Color.001 – color of the 2nd Principled shader
according to the Principled BSDF Color. (this color is changed by user)
Lets say if the RGB value is higher then 128, then it change.
Or maybe it would be easier just to set colors for which the Principled BSDF Color.001 would be black .
Could anyone help me with this please ?Attachments:
You must be logged in to view attached files.2023-04-21 at 10:44 am #63177kdvParticipantYou can’t compare a color in the RGB format with a number. An array of numbers cannot be less or more than one number. Your condition will always return
false
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-04-21 at 10:47 am #63179matin00xCustomerHi
Thats what i thought can i compare the RGB values somehow ?2023-04-21 at 10:50 am #63180kdvParticipantCompare the red, green or blue channels separately.
The range for these values is 0-1.
128 corresponds to 0.5Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-04-21 at 11:02 am #63181matin00xCustomerI dont understand how could i place the RGB values in the get color puzzle. Could you show me please ?
maybe something like this ?
https://www.soft8soft.com/docs/files/puzzles/puzzles-materials-get-color.jpg- This reply was modified 1 year, 7 months ago by matin00x.
2023-04-21 at 11:05 am #63183kdvParticipantPuzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-04-21 at 12:28 pm #63186matin00xCustomerThanks for your help kdv, but I did not have much luck with your setup,
when i adjust it to this.
the Principled BSDF.001 Color changes according to the value in the “if part”
0.08 – is the threshold for some reason ?
But it does not change regarding to Principled BSDF Color.Attachments:
You must be logged in to view attached files.2023-04-21 at 12:33 pm #63188kdvParticipantUse this puzzle. See inputs, outputs, condition in the console log.
0.08 – is the threshold for some reason ?
Have no idea what are talking about.
Puzzles and JS coding. Fast and expensive.
If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.
2023-04-21 at 2:26 pm #63190matin00xCustomerYes you are right. That was actually the best advice !
I got it working with the puzzle i posted above just swap the LSB material to the variable i am placing the “variable material”
I am a bit lost in JS so in the Verge puzzles also, but slowly thanks to Verge i am getting better :-D -
AuthorPosts
- You must be logged in to reply to this topic.