Announcement

Collapse
No announcement yet.

Material Ids

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

  • #16
    Any tricks for getting a super fast MaterialID channel?
    Matthew Valero, ASAI

    Comment


    • #17
      Originally posted by ValeroStudio View Post
      Any tricks for getting a super fast MaterialID channel?
      Turn off all lights and render. That's quick. I haven't used production much, not sure of the best settings. When I tried it, my aliasing was really bad, so you'll have to figure out the best settings to get sharp delineation between colors.

      Comment


      • #18
        Just wanted to add GPU support is on our roadmap for the next big update.

        Kind regards,
        Peter
        Peter Chaushev
        V-Ray for SketchUp | V-Ray for Rhino | Product Specialist
        www.chaos.com

        Comment


        • #19
          Hi guys,

          The MaterialID will be supported on the GPU in the future. The GPU team is working on it as we speak.

          Another thing that I have to point out is that the most robust way of rendering masks in 3dsMax for example is using MultiMatte render elemet.
          This is a render element that renders R G B channel masks for 3 scene object or material IDs (integer number IDs).
          If you want to mask more than 3 IDs you just create multiple MultiMattes.
          The reason why people prefer this approach is that the RGB channel masks can be extracted and applied with perfect anti-aliasing in post (unlike the MaterialID).
          We are considering adding this render element in SketchUp but we are still trying to design a good way to do it.

          If you want to experiment a little with this element you can try the following:
          1. Set object IDs in SketchUp :
          Click image for larger version

Name:	ObjectID.png
Views:	356
Size:	4.7 KB
ID:	982772
          2. Run the following script once (per session):
          Code:
          module VRay
              module ObjectProperties
                  BEFORE_RENDER_STARTED_CALLBACK ||= VRay.on(:beforeRenderStarted){
                      ids = Sketchup.active_model.definitions.collect{|definition| ObjectProperties.get_object_id(definition) }.compact.sort
                      ids.each_slice(3).with_index{|(r,g,b), i|
                          name = "MM#{i}"
                          mm = Renderer.active.create_plugin(:RenderChannelMultiMatte, name, {name:"#{name}(#{r},#{g},#{b})", red_id: r, green_id: g, blue_id: b})
                      }
                  }
                  def self.get_object_id(entity)
                      entity.get_attribute(OBJECT_PROPERTIES_DICTIONARY_NAME, "objectID")
                  end
                  def self.set_object_id(entity, value)
                      if value
                          entity.set_attribute(OBJECT_PROPERTIES_DICTIONARY_NAME, "objectID", value)
                      else
                          entity.delete_attribute(OBJECT_PROPERTIES_DICTIONARY_NAME, "objectID")
                      end
                  end
              end
          end
          3. At any point in the current SketchUp session you'll be able to call:
          Code:
          VRay::ObjectProperties::BEFORE_RENDER_STARTED_CALLBACK.disable
          ...to disable the element
          or
          Code:
          VRay::ObjectProperties::BEFORE_RENDER_STARTED_CALLBACK.enable
          ... to re-enable it

          ---------------------
          The script will check the number of ObjectIDs that you have in the scene and auto-create the corresponding number of MultiMatte render elements (they'll only show up in the VFB).
          You can experiment with the script a little and let me know what you think. We might decide to add similar option in the UI in the future.

          Regards,
          Konstantin

          Comment


          • #20
            testing it out now - first pass and I"m getting yellow and cyans. Is that intentional? I'm assuming not, maybe its because I have some wonky object ID's?

            Comment


            • #21
              Hi guys,

              Here's a short video that shows what the script does:


              Regards,
              Konstantin

              Comment


              • #22
                Originally posted by delineator View Post
                testing it out now - first pass and I"m getting yellow and cyans. Is that intentional? I'm assuming not, maybe its because I have some wonky object ID's?
                Hi delineator,

                What you've described is really strange. The MultiMatte element can't produce colors different from Red / Green / Blue.
                Can you share a scene that I can test?

                Regards,
                Konstantin

                Comment


                • #23
                  This is very useful, especially when you know what you want a channel for. In some cases, clients are unpredictable and they may want to change the hue of something randomly in the background. MaterialID just covers all the bases.
                  Matthew Valero, ASAI

                  Comment


                  • #24
                    Yeah, but I think its belt and suspenders. MaterialID is not a great solution in general, just because you can't comp with absolutely values and there are some inherent accuracy and AA issues with color picker/magic wand/etc. Lower res and stills (ie Pshop) it works OK, but I recently finished up an animation where I was trying to use the matID to tweak the exposure of a leaf structure in After Effects and frankly the keying tools sucked to work with - something like this would have been awesome at the time.

                    Comment


                    • #25
                      Hi guys,

                      Keep in mind that V-Ray Core has the Cryptomatte element available.
                      It works great for Nuke compositing but Photoshop still does not support it.
                      Once it's supported we'll make sure to add it in SketchUp.

                      Konstantin

                      Comment


                      • #26
                        Well, I?d still like my suspenders in GPU.
                        Matthew Valero, ASAI

                        Comment

                        Working...
                        X