Announcement

Collapse
No announcement yet.

random materials

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • random materials

    Hi,

    I was wondering if it is possible to properly randomize some materials on various meshes, created through a replicator/surface generator combo ( so the meshes are considered as particles ). I tried something with a Variation Texture set as a Group Mask with Particles as Variation Source but it returns some intermediate values and so blended materials. What is the proper way to randomly apply any number of materials on any number of mesh ?

    In my example, I have a blue material and a green material ( the blue on top of the green ). The Variation Texture seems to be working but returns blended colors. So the same with complete materials. How to avoid this result ?
    Click image for larger version

Name:	Capture00.jpg
Views:	1
Size:	259.7 KB
ID:	881780

    Click image for larger version

Name:	Capture01.PNG
Views:	1
Size:	24.2 KB
ID:	881781Click image for larger version

Name:	Capture02.PNG
Views:	1
Size:	14.1 KB
ID:	881782
    Last edited by John_Do; 18-05-2015, 04:08 PM.

  • #2
    Well, first of all I will have to fix the "stepped" mode for the control points in MODO's gradient texture, it just doesn't work in V-Ray for MODO like you noticed.
    I was waiting for somebody to actually use it, before I take the time to fix it.

    After that, you can do it like in the attached screenshot, but it will probably be more effecient, if you use a blend material, and the Variation texture is used
    as the amount for the blend's layers.

    Even better would be if I add the V-Ray Switch material from V-Ray for Maya, it chooses what material to use, based on the value of a texture,
    with values between 0 and 1 choosing the first material, between 1 and 2 choosing the second material, and so on. The good thing about
    it is that it will mostly work even if the "stepped" mode is not fixed.

    Both the blend and switch texture need to be setup in the Schematic though.

    How did you arrive at the attached image ? Is it a single rendering ? Can you send me the scene so I can examine and test it ?

    Greetings,
    Vladimir Nedev
    Vantage developer, e-mail: vladimir.nedev@chaos.com , for licensing problems please contact : chaos.com/help

    Comment


    • #3
      Originally posted by vladimir.nedev View Post
      Well, first of all I will have to fix the "stepped" mode for the control points in MODO's gradient texture, it just doesn't work in V-Ray for MODO like you noticed.
      I was waiting for somebody to actually use it, before I take the time to fix it.

      After that, you can do it like in the attached screenshot, but it will probably be more effecient, if you use a blend material, and the Variation texture is used
      as the amount for the blend's layers.

      Well, I tried this ( with the Blend Mat and Variation Texture plugged in amount slots ), but it didn't do anything. But actually the Blend Material is the wrong option IMHO, because I designed my materials in the ST, taking advantages of the Bercon Noise and the blending possibilities of ST. Blend Mat works only in the Schematic Editor and it's painful when you have to deal with tens of procedural layers with precise blend amount. Color Blend is not an artist-friendly option :/

      Originally posted by vladimir.nedev View Post
      Even better would be if I add the V-Ray Switch material from V-Ray for Maya, it chooses what material to use, based on the value of a texture,
      with values between 0 and 1 choosing the first material, between 1 and 2 choosing the second material, and so on. The good thing about
      it is that it will mostly work even if the "stepped" mode is not fixed.

      Both the blend and switch texture need to be setup in the Schematic though.
      Sounds good, but does it provide randomisation like the Variation Texture, based on the Particles ID generated by the Surface Generator ?
      And I presume, if it potentially works only in the Schematic, it means that the materials used in the slots have to be designed also in the Schematic ?


      Originally posted by vladimir.nedev View Post

      How did you arrive at the attached image ? Is it a single rendering ? Can you send me the scene so I can examine and test it ?

      Greetings,
      Vladimir Nedev
      Nope, it's just 3 renderings ( region render ), with the 2 separate materials, and the result with the Variation Texture with Stepped Gradient. I send you that, right now.

      So, to be clear, at the present time there is no solution to randomly distribute my materials across several items ?

      Comment


      • #4
        Well, I tried this ( with the Blend Mat and Variation Texture plugged in amount slots ), but it didn't do anything. But actually the Blend Material is the wrong option IMHO, because I designed my materials in the ST, taking advantages of the Bercon Noise and the blending possibilities of ST. Blend Mat works only in the Schematic Editor and it's painful when you have to deal with tens of procedural layers with precise blend amount. Color Blend is not an artist-friendly option :/
        What output of the variation texture did you use ? The "Texture value" output comes from the "Value" gradient, and the "Texture Color" output comes from the "Color" gradient.
        What if I add a composite texture that can blend many textures (not just 2) ? Will that make it viable ?

        Sounds good, but does it provide randomisation like the Variation Texture, based on the Particles ID generated by the Surface Generator ?
        And I presume, if it potentially works only in the Schematic, it means that the materials used in the slots have to be designed also in the Schematic ?
        Yes, just like the blend material, the sub-materials will work in the Schematic.
        You connect any texture you want to specify the materials. In this case, you connect a "Variation texture" to the Switch material.
        It will have 2 control points, one at (0, 0) and one at (1, n), where n is the number of materials you connected to the Switch material.
        Once I add it, I will post an example.

        So, to be clear, at the present time there is no solution to randomly distribute my materials across several items ?
        You can work around the stepped gradients not working by using some math nodes in the Schematic.
        Basically the variation texture output is first multiplied by 2 (or you can instead change its control points)
        and then the "floor" function is used. I am attaching a scene. It uses the V-Ray blend material, but you
        can just use the constant texture in the scene as the "group mask".

        Bear in mind that when using the "Group mask" effect, you are not doing material blending like a V-Ray Blend material.
        To achieve this you should add a Shader item and the texture with the "Group mask" effect should be used as a layer mask for the Shader item.

        gradient_stepped_2.zip

        Greetings,
        Vladimir Nedev
        Vantage developer, e-mail: vladimir.nedev@chaos.com , for licensing problems please contact : chaos.com/help

        Comment


        • #5
          Originally posted by vladimir.nedev View Post
          What output of the variation texture did you use ? The "Texture value" output comes from the "Value" gradient, and the "Texture Color" output comes from the "Color" gradient.
          What if I add a composite texture that can blend many textures (not just 2) ? Will that make it viable ?
          I think I used the Texture Color output, so obviously it didn't work. But the material was in the ST, this part remains valid. So adding a composite texture would be really great, with 10/12 slots


          Originally posted by vladimir.nedev View Post
          You can work around the stepped gradients not working by using some math nodes in the Schematic.
          Basically the variation texture output is first multiplied by 2 (or you can instead change its control points)
          and then the "floor" function is used. I am attaching a scene. It uses the V-Ray blend material, but you
          can just use the constant texture in the scene as the "group mask".

          Bear in mind that when using the "Group mask" effect, you are not doing material blending like a V-Ray Blend material.
          To achieve this you should add a Shader item and the texture with the "Group mask" effect should be used as a layer mask for the Shader item.

          Greetings,
          Vladimir Nedev
          I'm not comfortable with this kind of magician-of the-schematic-editor tricks ( and mainly with the Schematic Editor haha ), but thank you for the scene, it is really helpful. What is the purpose of the Floor expression ?

          I hope the documentation will be consequent, it's hard to deal with shading between Schematic Editor and Shader Tree ( but when it works properly it's really powerful, especially when combining the two methods ).

          Comment


          • #6
            I'm not comfortable with this kind of magician-of the-schematic-editor tricks ( and mainly with the Schematic Editor haha ), but thank you for the scene, it is really helpful. What is the purpose of the Floor expression ?
            The floor function returns the nearest integer that is less than or equal to its argument. So any values between 0 and 1 will get reduced to 0. Any values between 1 and 2 will get reduced to 1. And so on.

            Greetings,
            Vladimir Nedev
            Vantage developer, e-mail: vladimir.nedev@chaos.com , for licensing problems please contact : chaos.com/help

            Comment


            • #7
              So, does value resulting from this expression select corresponding blend amount slot ? Like 0 = base mat / 1 = coat mat 1 / 2 = coat mat 2 etc. ?

              I tried to use it with more than 2 materials and it doesn't work ( I obsviously did something wrong ), only 2 materials are applied on the same time ( and I played with the gradient in every possible direction ). Sorry, the logic behind this remains obscure to me !

              Comment


              • #8
                Originally posted by John_Do View Post
                So, does value resulting from this expression select corresponding blend amount slot ? Like 0 = base mat / 1 = coat mat 1 / 2 = coat mat 2 etc. ?

                I tried to use it with more than 2 materials and it doesn't work ( I obsviously did something wrong ), only 2 materials are applied on the same time ( and I played with the gradient in every possible direction ). Sorry, the logic behind this remains obscure to me !
                The idea of the expression is to convert the continuous(i.e. between 0 and 1) value of the variation texture to either 0 or 1, so there is no actual blending between the two materials.
                So if you want to select between more than 2 materials, you will need multiple different variation textures just like in the scene you sent me. And each of them must be piped through its own floor and constant nodes.
                The good thing about a switch material will be that you won't need these multiple variation textures, just one, with only 2 control points.

                I am attaching a scene with 3 blend layers.

                gradient_stepped_3.zip

                (Btw, in the first scene I attached I made the mistake of using the "value" input of the "constant" texture as output.
                I've fixed this in this new scene).

                Greetings,
                Vladimir Nedev
                Vantage developer, e-mail: vladimir.nedev@chaos.com , for licensing problems please contact : chaos.com/help

                Comment


                • #9
                  Oh, now I notice that some of the variation textures that you are using are actually the "Gradient" texture with "Input Parameter" set to "Particle ID".
                  But my export code doesn't support this case, you need to use the actual variation texture.
                  I will fix this case.

                  Greetings,
                  Vladimir Nedev
                  Vantage developer, e-mail: vladimir.nedev@chaos.com , for licensing problems please contact : chaos.com/help

                  Comment


                  • #10
                    Originally posted by vladimir.nedev View Post
                    Oh, now I notice that some of the variation textures that you are using are actually the "Gradient" texture with "Input Parameter" set to "Particle ID".
                    But my export code doesn't support this case, you need to use the actual variation texture.
                    I will fix this case.

                    Greetings,
                    Vladimir Nedev
                    What do you mean by "actual variation texture" ?

                    Comment


                    • #11
                      Originally posted by John_Do View Post
                      What do you mean by "actual variation texture" ?
                      I mean Processing -> Variation Texture set to "Particle", not Processing -> Gradient set to "Particle ID".

                      Greetings,
                      Vladimir Nedev
                      Vantage developer, e-mail: vladimir.nedev@chaos.com , for licensing problems please contact : chaos.com/help

                      Comment


                      • #12
                        It seems to work !

                        Click image for larger version

Name:	variationMaterial.jpg
Views:	1
Size:	26.2 KB
ID:	856091

                        Comment


                        • #13
                          Even with the Color Blend node, I can't get the same result, really strange. It's subtle but the difference is visible and important in my mind.

                          Click image for larger version

Name:	Capture04.png
Views:	1
Size:	458.4 KB
ID:	856093

                          And the setup is more complicated, can't wait for the Composite texture

                          Click image for larger version

Name:	Capture05.PNG
Views:	1
Size:	134.2 KB
ID:	856094

                          Comment


                          • #14
                            Originally posted by John_Do View Post
                            Even with the Color Blend node, I can't get the same result, really strange. It's subtle but the difference is visible and important in my mind.

                            [ATTACH=CONFIG]24305[/ATTACH]

                            And the setup is more complicated, can't wait for the Composite texture

                            [ATTACH=CONFIG]24306[/ATTACH]
                            Are you sure you have them setup in exactly the same way ? It seems the Schematic material is missing some high frequency noise compared to the Shader Tree material.

                            Greetings,
                            Vladimir Nedev
                            Vantage developer, e-mail: vladimir.nedev@chaos.com , for licensing problems please contact : chaos.com/help

                            Comment


                            • #15
                              I setup them like this, is it correct ?

                              Click image for larger version

Name:	Capture05.PNG
Views:	1
Size:	181.6 KB
ID:	856095Click image for larger version

Name:	Capture06.PNG
Views:	1
Size:	48.3 KB
ID:	856096

                              Comment

                              Working...
                              X