Any tricks for getting a super fast MaterialID channel?
Announcement
Collapse
No announcement yet.
Material Ids
Collapse
X
-
Originally posted by ValeroStudio View PostAny tricks for getting a super fast MaterialID channel?
Comment
-
Just wanted to add GPU support is on our roadmap for the next big update.
Kind regards,
PeterPeter Chaushev
Former Product Owner V-Ray for SketchUp & Rhino (2016-2025)
Let's keep in touch
Comment
-
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 :
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
Code:VRay::ObjectProperties::BEFORE_RENDER_STARTED_CALLBACK.disable
or
Code:VRay::ObjectProperties::BEFORE_RENDER_STARTED_CALLBACK.enable
---------------------
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
-
Originally posted by delineator View Posttesting 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?
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
-
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
Comment