Hi,
some times my design clients ask for masks to select object of a rendering for fineadjust or create variations of colors in postwork. At the moment VfR dosn't support any antialiased mask output.
Today I got the idea for a script, that allow to select objects at a scene and to render this object white and all other objects black with all camera and output settings of the current scene.
The script create copies of all objects, assign black and white emitter materials, add a big black sphere around the scene and render it. At the end, the masked object and the black sphere are deleted again.
Prepare for usage:
Befor starting the script, the mask materials must be load to the current Rhino file materials - use right mouse button. For mask render use the left mouse button.
www.simulacrum.de/download/MaskRendering.zip
Please use the tool at own risk.
I'm glad to hear, if somebody know, how the tool can be improved. One problem is, that the white mask material could be to bright or to dark for some camera settings. I don't know an automatic solution. Manualy adjust of the output brightness (color mapping or physical camera) or adjust the white emitter material could help. Best, the rendered white material match the rendered color range.
Update: if the white mask material dosn't match the current camera, than the easiest method to get the full range is, to disable "clamp output" to get a 32bit output and adjust the exposure of the frame buffer.
Also, at the moment lights stay visible at the scene (not the lighting effect). I'm not sure it is good or not. If lights should not be visible at the mask, than best hide the lights befor.
Rendered example
Mask
PS: My dream is, that a mask is rendered based on the Rhino display colors. This display colors wasn't needed by me and I suppose so, it's free for mask usage in the most cases. AIR support a render command like this
... maybe something could be possible for VfR in the future. Or the Vray wireframe output channel could based on the Rhino display colors.
some times my design clients ask for masks to select object of a rendering for fineadjust or create variations of colors in postwork. At the moment VfR dosn't support any antialiased mask output.
Today I got the idea for a script, that allow to select objects at a scene and to render this object white and all other objects black with all camera and output settings of the current scene.
The script create copies of all objects, assign black and white emitter materials, add a big black sphere around the scene and render it. At the end, the masked object and the black sphere are deleted again.
Prepare for usage:
- save the MaskRenderTool.tb toolbar at the Rhino directory and drag&drop it to a Rhino task -> the toolbar will be installed
- save the files BlackSphere.3dm, MaskBlack.vismat and MaskWhite.vismat at harddisk c:
Befor starting the script, the mask materials must be load to the current Rhino file materials - use right mouse button. For mask render use the left mouse button.
www.simulacrum.de/download/MaskRendering.zip
Please use the tool at own risk.
I'm glad to hear, if somebody know, how the tool can be improved. One problem is, that the white mask material could be to bright or to dark for some camera settings. I don't know an automatic solution. Manualy adjust of the output brightness (color mapping or physical camera) or adjust the white emitter material could help. Best, the rendered white material match the rendered color range.
Update: if the white mask material dosn't match the current camera, than the easiest method to get the full range is, to disable "clamp output" to get a 32bit output and adjust the exposure of the frame buffer.
Also, at the moment lights stay visible at the scene (not the lighting effect). I'm not sure it is good or not. If lights should not be visible at the mask, than best hide the lights befor.
Rendered example
Mask
PS: My dream is, that a mask is rendered based on the Rhino display colors. This display colors wasn't needed by me and I suppose so, it's free for mask usage in the most cases. AIR support a render command like this
Code:
_AirRender _Outline=No _Surface _Shader constant _Enter _Colors=Yes _GiMode=Off _BGcolor=0,0,0 _PixelSamples=8 _Enter
Comment