Announcement

Collapse
No announcement yet.

Procedural Object XYZ cooridinates

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

  • Procedural Object XYZ cooridinates

    I'm a little confused about how to fix this and I'm hoping someone here knows the secret.

    I have modeled an object as one single mesh, then I have cut it into separate objects and not moved any of the pieces. I apply a Cellular procedural texture to all the objects and when I render using Object xyz as the coordinates type the cellular pattern appears seamless across all of the objects (similar to if I had used World XYZ coordinates). I'm wanting to have it look as though each object has different UV offsets so that from one object to another you see cellular texture change. How do I randomize the cellular patterns position if I've created all my objects from a single original model? I had thought that the objects pivot point dictated the location of a procedural texture, but that doesn't seem be the case.

    Does anyone know the solution? Anyone know what dictates the location of a procedural texture?

    Thanks,

    Tim J
    www.seraph3d.com
    Senior Generalist
    Industrial Light & Magic

    Environment Creation Tutorial
    Environment Lighting Tutorial

  • #2
    First center the pivot of the new objects or shift them around they may not be in the same location. Than apply a "reset x-form". In that order.

    Comment


    • #3
      You could apply UVW map modifier with XYZ to UVW mode and shuffle the gizmos a bit.

      Best regards,
      Vlado
      I only act like I know everything, Rogers.

      Comment


      • #4
        Well if this is for stills, set your procedural to world xyz. This doesn't help if all your objects are at the same position though.
        For animation, you should be able to "lock" the procedural in place so objects don't swim through it when moving, by adding a uvw xform modifier.
        Signing out,
        Christian

        Comment


        • #5
          Some cool ideas here. Provided the sub-elements are not welded you could aadd a material by element modifier, create a multisubtex with equal number of matIDs.

          Then plug a different Bercon mapping map into each slot to offset the UVs, then plug your single cellular map into these.

          Don't forget to cross your fingers and toes when you edit your Bercon map coordinates when your cellular is plugged in.
          Win10 x64, 3DS Max 2017 19.0, Vray 3.60.03
          Threadripper 1950x, 64GB RAM, Aurous Gaming 7 x399,

          Comment


          • #6
            Thanks guys! All very helpful ideas.

            Now let me put a new spin on the problem. Let's say I have a LOT of objects that all need this fix. Some are instances and some are not. Ideally I'd like to be able to randomize all the objects by looping through a maxscript. I could automate the process using some of the techniques mentioned here already (adding modifiers and offsetting), but I'm really curious to know what specifically is happening under the hood in max that dictates the location of a procedural? The ideal fix would be a single line of maxscript where all I would have to do is randomize the "secret unknown transform" position. Anyone know if such a line of code exists?

            Thanks,

            Tim J
            www.seraph3d.com
            Senior Generalist
            Industrial Light & Magic

            Environment Creation Tutorial
            Environment Lighting Tutorial

            Comment


            • #7
              World based procedurals are exactly that - locked to the origin of the scene, so an object that if you animate an object, they'll "slide" through the procedural and it'll look a bit like an object moving through camera mapping.

              In terms of placement you go as follows. If you have a procedural map in object space mode, it means that the centre of the object is where the procedural pattern starts from. In world space mode, the procedural pattern locks it's centre to 0,0,0 in your scene so if you've got a load of objects all using the same map but they're in different places, simply moving them positionally will give you a different section of the map.

              If you use explicit mapping the map will flow along the uv's of your object. With this mode you'll notice as soon as you switch to explicit, your procedural scale goes out the window. I'm sure there's an accurate description of how the units relate between object / world and explicit but I find you've to use a size that's 100 times smaller in explicit mode to find a similar mode. In other words, an object / world size of 8.0 has to turn into 0.08 to look similar in explicit mode.

              In terms of variation it depends on if you're using object/world or explicit. If you're using object then the only way to get variation is to move the verts of an object away from it's centre which is a bit annoying. In world mode you have to reposition the object to get a new section - you may already have this done so it's a first option. As mentioned before if you use world or object modes, you'll have to add an unwrap uvw modifier to each object which will take the current mapping applied to the object and stick it in place. If you've got something like a big lined up squadron of objects / robots / vehicles whatever then they're already in different places. Use world space so they automatically have a different section of the map, then lock it with unwrap uvw.

              If you're using explicit it might be a tiny bit handier. If you're using this then the uvw xform modifier comes into play. With this it gives you simple offset controls so you can slide your procedural map around to different portions of the objects mapping coordinates.

              Could you describe more specifically what type of scene you're dealing with in terms of the objects - what they are, how many sub materials they have, how they're instanced (cos of course this affects modifiers) and which of the approaches above sounds about right and we can do some more?

              Comment


              • #8
                The scene I'm working on involves a lot of stone blocks lining the edge of a curving walkway. I modeled one long curvy box and cut it into many smaller boxes. I then instanced some of the boxes and used them on another nearby walkway. I'm using a cellular map as part of the shader. I'm using object XYZ coordinates because with world XYZ it is obvious that the cellular pattern is going from one stone to the other seamlessly and I want each stone to not appear as though it was cut from one massive stone. The stones are right up against each other. So because all the stones were created from one original object, using object XYZ looks identical to using world XYZ. I can randomize the pivot positions and then reset the xform of each one so that the object XYZ pattern no longer goes seamlessly across all the stones. I can script that and it isn't really a big problem. I was hoping to learn that max has a parameter somewhere that is stored with each object that dictates the location of where a procedural maps center point is for that object. If there is such a parameter I would be able to (hopefully) just write a script that randomized that value instead of writing a script that requires adding modifiers.

                Tim J
                Last edited by Seraph135; 03-12-2013, 10:01 PM.
                www.seraph3d.com
                Senior Generalist
                Industrial Light & Magic

                Environment Creation Tutorial
                Environment Lighting Tutorial

                Comment


                • #9
                  Here's an approach that will work:
                  • Render out a large bitmap of the texture.
                  • Attach all the blocks as one object.
                  • Add a UV unwrap modifier
                  • Select all the faces and "Pack UVs..."

                  This will randomly distribute the texture to all blocks.
                  - Geoff

                  Comment


                  • #10
                    Originally Posted by Seraph135 View Post
                    The scene I'm working on involves a lot of stone blocks lining the edge of a curving walkway. I modeled one long curvy box and cut it into many smaller boxes. I then instanced some of the boxes and used them on another nearby walkway. I'm using a cellular map as part of the shader. I'm using object XYZ coordinates because with world XYZ it is obvious that the cellular pattern is going from one stone to the other seamlessly and I want each stone to not appear as though it was cut from one massive stone. The stones are right up against each other. So because all the stones were created from one original object, using object XYZ looks identical to using world XYZ. I can randomize the pivot positions and then reset the xform of each one so that the object XYZ pattern no longer goes seamlessly across all the stones. I can script that and it isn't really a big problem. I was hoping to learn that max has a parameter somewhere that is stored with each object that dictates the location of where a procedural maps center point is for that object. If there is such a parameter I would be able to (hopefully) just write a script that randomized that value instead of writing a script that requires adding modifiers.

                    Tim J
                    Well this parameter actually is the pivot. But there is one really simple and quick solution in case Bercon maps is an option for you.
                    They include the "Bercon Mapping" map. It´s a mapping parameter frontend for every kind of map.
                    They have an option "variance" (offset, size, angle) by material object or particle.
                    In your case object would do the trick. Like this you can have one map that will give you random results for each object in object space.
                    it works on instances also. With this map you don´t even need to change the pivots position or reset x-form.

                    Comment


                    • #11
                      Got to love BerconMaps, I'm using them pretty much all the time!
                      Rens Heeren
                      Generalist
                      WEBSITE - IMDB - LINKEDIN - OSL SHADERS

                      Comment


                      • #12
                        Contact Martin Breidt he could write a script for that (for a fee).
                        He allready wrote some scripts for me and I am happy with them.

                        Comment


                        • #13
                          Either that or assign random material ID's to each of the elements of the stones and use the vray multi sub texture as your map with a load of variations in there? Even three of the same cellulars with different phase values? What about the freebie railclone plugin too - sounds like it'd give you a tonne of options for exactly this thing too.

                          Comment


                          • #14
                            There is a freebie Railclone plugin?
                            Signing out,
                            Christian

                            Comment


                            • #15
                              Originally posted by trixian View Post
                              There is a freebie Railclone plugin?
                              last time I checked, yes...it was called Rail Clone Lite
                              http://www.itoosoft.com/downloads/railclone.php

                              Comment

                              Working...
                              X