Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When rendering surfaces in Katana, you may need to discard normals. The basic workflow for rendering smooth-looking surfaces is below:

  • Export normals for poly meshes polymeshes with smoothed normals that you wish to preserve when they are not going to being subdivided. This is a common "fake" for low-poly surfaces that need to look smooth. No normals export is needed when you only require hard edges/faceting.

  • Going to subdivide the mesh? Do not export normals for these poly meshespolymeshes, let PRMan calculate them new when they are subdivided. This also saves space for the exported file since you don't need the normals.

...

It may be useful to match what you're seeing in Maya since it may be your primary modeling package. Below are the settings necessary to achieve the same look if you asset was not exported with the data.

  1. Create an attribute Script OpScript node
    1. In the CEL section, select the mesh(es) where you wish to apply the attributes. In this case we've added the subdmeshes from Maya
      1. Custom CEL statements
        1. /root/world/geo//*{@type == "polymesh"}
        2. /root/world/geo//*{@type == "subdmesh"}
      2. In the script section add the following:

      3. DelAttr( 'geometry.vertex.N')
      4. SetAttr( 'type', ['subdmesh'] )
      5. Code Block
        languagepy
        titleOpScript for Subdivs
        Interface.SetAttr('geometry.facevaryinginterpolateboundary',
        [
         IntAttribute(3
        ]
        ))
        
        Interface.SetAttr('geometry.facevaryingpropagatecorners',
        [
         IntAttribute(0
        ]
        ))
        
        Interface.SetAttr('geometry.interpolateBoundary',
        [
         IntAttribute(1
        ] )
        ))
        Interface.DeleteAttr('geometry.vertex.N'
        (Note: This deletes the existing normals off the mesh as renderman will create its own for a SubD mesh. This is explained in the above section.)'type' changes the mesh to a subdivisional surface
        )
        Interface.SetAttr('type', StringAttribute('subdmesh'))


  2. We set several attributes above to match the Maya settings. Below we list the other options should you need to experiment.
    1. Options for geometry.facevaryinterpolateboundary
      1. 0 (old style)
      2. 1 (new style)
      3. 2 (new style, no corners)
      4. 3 (new style, smooth internal only) This is the current Maya default
    2. Options for 'geometry.facevaryingpropogatecorners'
      1. 0 (off) This is Maya default
      2. 1 (on)
    3. Options for 'geometry.interpolateBoundary'
      1. 0(no interpolation)
      2. 1(edge crease, corner crease) This is the Maya default
      3. 2(edge crease only)
    4. geometry.vertex.N'
      1. We delete the existing normals off the mesh as RenderMan will create its own for a subdivision mesh. This is explained in the above section.
    5. 'type'
      1. Changes the mesh to a subdivision surface

For Developers

If you are implementing support in a custom Katana plugin for subdivision surfaces, you will be interested in how RenderMan for Katana translates geometry attributes to RenderMan's subdivision format.  See the developer documentation here.

We support the following attributes, which are converted to RenderMan's internal format.  You can also examine the code for RenderMan for Katana to see the details of how each are handled.

  • geometry.edits
  • geometry.edits.tags
  • geometry.edits.numArgs
  • geometry.edits.intArgs
  • geometry.edits.floatArgs
  • geometry.edits.stringArgs
  • global.prmanStatements.subdivisionMesh.scheme
  • global.prmanStatements.subdivisionMesh.attributeSubsets "shading"|"geometrydefinition"|"geometrymodification"
  • geometry.faces
  • geometry.faces.visible
  • geometry.faces.material
  • geometry.faces.prmanStatements
  • geometry.faces.lightListprmanStatements.primAttributes.subdivisionMesh.scheme
  • geometry.holePolyIndices
  • geometry.creaseLengths
  • geometry.creaseIndices
  • geometry.creaseSharpness
  • geometry.creaseSharpnessLengths

...