Announcement

Collapse
No announcement yet.

random particle ID matte

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

  • random particle ID matte

    Hello all,

    I have a particle system set up in Maya using instanced vray proxies to create a swarm of ants each carrying a different piece of a clock. The proxy system is working a treat and making render times a pleasure!

    The guy who will be comping it has (rightly) requested random mattes for the instances so we can create a bit of variation in colour without having to set up multiple shaders/instances etc.

    Any ideas how I could do this using the v-ray multimatte renderpass and particle ids?

    I'm aware this is a bit of a general dynamics question but hope someone will have come across it in the past. Couldn't find anything similar in the forum.

    Any advice would be greatly appreciated.

    Cheers!

    Liam
    Broadcast Designer/VFX Artist at Mainframe

  • #2
    not sure what is particle ID, you however may want to explore render id and object id passes in the render elements tab.
    Dmitry Vinnik
    Silhouette Images Inc.
    ShowReel:
    https://www.youtube.com/watch?v=qxSJlvSwAhA
    https://www.linkedin.com/in/dmitry-v...-identity-name

    Comment


    • #3
      - Create the pp attr UserVector1PP or any other PP attr you're not using.
      - Create creation exp: particleShape1.userVector1PP = <<rand(0,1),rand(0,1),rand(0,1)>>; //assign random matte colors to particles
      - Enable export of UserVector1PP from vrayexport attr
      - Create particleSamplerInfo
      - Create Ramp and delete all extra slots so you're left with one color slot
      - Connect particleSamplerInfo1.userVector1PP to ramp1.colorEntryList[0].color
      - Create "extraTex" vrayrenderelement
      - Connect ramp1.outColor vrayRE_Extra_Tex.vray_texture_extratex

      This gives you the following:
      Click image for larger version

Name:	particleMattes.ramp1.jpg
Views:	1
Size:	16.1 KB
ID:	844453

      or if you only want RGB mattes use the following exp:
      float $rand = rand(0,1);
      if ($rand > .66)
      particleShape1.userVector1PP = <<1,0,0>>;
      else if ($rand > .33)
      particleShape1.userVector1PP = <<0,1,0>>;
      else
      particleShape1.userVector1PP = <<0,0,1>>;

      which gives you:
      Click image for larger version

Name:	matte.ramp1.jpg
Views:	1
Size:	22.6 KB
ID:	844454
      Last edited by jbvfx; 12-09-2011, 01:32 AM.
      Jacob Børsting
      Head of Pipeline @ Ghost VFX

      Comment


      • #4
        Or, you could pass on the rgbPP directly to your shader to create color variation, without the need for multiple shaders/models or any matte pass.

        Comment


        • #5
          He asked for a way to setup a matte renderelement, so I think he wants to do the color variation in comp.
          Jacob Børsting
          Head of Pipeline @ Ghost VFX

          Comment


          • #6
            Thanks jbvfx, that looks like exactly what i need.

            It's being comped in Nuke So I assume the RGB pass will do fine. It's really just to break things up a bit as it is looking a bit regular.

            Tobbe, that's also a nice idea, think I'll leave the compositor with a bit more scope, but cheers anyway.

            I'll give it a go and get back to you with the results.

            Thanks again
            Broadcast Designer/VFX Artist at Mainframe

            Comment


            • #7
              Just to let you know, that system worked, but it didn't seem to affect the instanced geometry, so I just duplicated the instances then added each of them to different object properties and multimatted those suckers.

              Works well enough but would love to know how your script could be used to affect the instances, would save on set-up time, or did I miss something?
              Broadcast Designer/VFX Artist at Mainframe

              Comment


              • #8
                It does work with instances.. as you can in my renders, I use instanced toruses.

                What version of Vray are you using? Support for passing PP attributes to the instancer is a rather new feature in 2.0.
                Jacob Børsting
                Head of Pipeline @ Ghost VFX

                Comment

                Working...
                X