We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Set material color1 according to color0

Home Forums Puzzles Set material color1 according to color0

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #63175
    matin00x
    Customer

    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.
    #63177
    kdv
    Participant

    You 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.

    #63179
    matin00x
    Customer

    Hi
    Thats what i thought can i compare the RGB values somehow ?

    #63180
    kdv
    Participant

    Compare the red, green or blue channels separately.
    The range for these values is 0-1.
    128 corresponds to 0.5

    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.

    #63181
    matin00x
    Customer

    I 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.
    #63183
    kdv
    Participant

    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.

    #63186
    matin00x
    Customer

    Thanks 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.
    #63188
    kdv
    Participant

    Use 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.

    #63190
    matin00x
    Customer

    Yes 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

    • This reply was modified 1 year, 7 months ago by matin00x.
    • This reply was modified 1 year, 7 months ago by matin00x.
Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.