©Anton Podvalny

Table of Contents

 

Introduction


In this chapter we'll cover the cartoon shading (VolumeVRayToon) implemented in V-Ray. VolumeVRayToon is a very simple atmospheric plugin that produces cartoon-style outlines on objects in the scene. Note that VolumeVRayToon is not intended to be a full NPR (non-photorealistic rendering) effect. However, it may be useful in many cases.

Why an Atmospheric effect?


There are several solutions for adding toon effects to 3d renderings for 3ds Max; most of them function either as special materials (shaders) or as render (post) effects. Each of these approaches has both advantages and limitations. VolumeVRayToon has been implemented as an atmospheric effect for several reasons:

  • The implementation is very simple.
  • Works with any geometry supported by V-Ray, including displaced objects, Procedural Fur and Proxy Objects, etc.
  • Works with any camera type supported by V-Ray (spherical, fish-eye etc).
  • Works with any camera effects (depth of field and/or motion blur).
  • Works with raytraced effects such as reflection and refraction.
  • Smooth and consistent outlines for intersecting objects.

Parameters


The parameters of the effect are controlled by the VolumeVRayToon plugin. It renders cartoon style contours on all meshes (by default) or using an include/exclude list. It has the following parameters:

  • toonChannelsOnly - Apply only to toon render channels.
  • widthType - 0:Pixels; 1:World
  • lineColor - The outer color of the cartoon line.
  • lineColor_tex - The outer color texture of the cartoon line.
  • lineWidth - Cartoon line width.
  • lineWidth_tex - Cartoon line width texture.
  • innerLineControl - Use same lineColor/Width param values for both silhouette and inner edges.

  • lineColorInner - The color of the cartoon line at inner edges.
  • lineColorInner_tex - The color of the cartoon line at inner edges.
  • lineWidthInner - Cartoon line width of inner lines.
  • lineWidthInner_tex - Cartoon line width texture at inner edges.
  • opacity - Opacity of the cartoon line.
  • opacity_tex - Opacity texture of the cartoon line.
  • outerOverlapThreshold - This determines when outer edges will be created for overlapping parts of one and the same object.
  • compensateExposure - Compensate V-Ray physical camera exposure.
  • materialEdges - Draw contours on material boundaries.
  • hideInnerEdges - true : show outlines and not interior edges, false : show all edges.
  • normalThreshold - This determines when lines will be created for parts of the same object with varying surface normals (for example, at the inside edges of a box). A value of 0.0 means that only 90 degrees or larger angles will generate internal lines. Higher values mean that more smooth normals can also generate an edge. Don't set this value to pure 1.0 as this will fill curved objects completely.
  • overlapThreshold - This determines when inner edges will be created for overlapping parts of one and the same object.
  • doSecondaryRays - true : show toon lines in reflections/refractions. Note that this may increase render times.
  • traceBias - This parameter depends on the scale of your scene.
  • distortion_tex - This works like a bump map - a simple constant value won't do, you need to connect a texture.
  • excludeList - Specifies which objects will be affected by the VRayToon atmospheric.
  • excludeType - true : apply toon effect only to objects in excludeList; false : apply toon effect to all objects out of excludeList.
  • depthCurveOn - Enable depth-based line width.
  • minDepth - Minimum depth.
  • maxDepth - Maximum depth.
  • depthCurvePositions - Depth Curve Positions
  • depthCurveInterpolations - Depth Curve Interpolations
  • depthCurveValues - Curve controlling the line width based on depth.
  • depthCurveExternal - If this parameter is set, it will be used instead of depthCurvePositions, depthCurveInterpolations and depthCurveValues to provide an external curve for controlling the line width based on depth.
  • angularCurveOn - Enable view angle-based line width.
  • angularCurvePositions - Angular Curve Positions
  • angularCurveInterpolations - Angular Curve Interpolations
  • angularCurveValues - Curve controlling the line width based on view angle.
  • angularCurveExternal - If this parameter is set, it will be used instead of angularCurvePositions, angularCurveInterpolations and angularCurveValues to provide an external curve for controlling the line width based on view angle.
  • compatibilityMode - 0:V-Ray 3; 1:V-Ray Next
  • toonMaterialOnly - Apply only for objects object with a material implementing ToonEdgeParamsInterface (e.g. BRDFToonOverride, BRDFToonMtl)

 

Example

You can see the commented parameters in the scene bundle.

Notes


  • VolumeVRayToon only provides outlines. You will need to come up with your own cartoon-style materials (for example, using falloff maps etc or other third-party material plugins).
  • VolumeVRayToon has no per-object settings; however, you can add several VolumeVRayToon atmospherics to the scene, each applied to a different set of objects through the Include/exclude objects list.
  • VolumeVRayToon will not work properly with objects that have their Cast Shadows property turned off.
  • The quality of the lines depends on the current settings of the Image sampler.
  • No labels