How to render mask and other specific properties of the surface?

37 views
Skip to first unread message

Cloud Han

unread,
Jan 24, 2018, 4:59:03 AM1/24/18
to scalismo-faces
I want to render some specific properties to images, say, mask and diffuse albedo

After digging into the code, I find
override def renderMask(parameters: RenderParameter, mask: MeshSurfaceProperty[Int]): PixelImage[Int] = maskRenderer((parameters, mask))
which requires a second parameter. But I don't know how to construct it.

More generally, I want to render diffuse albedo into image (aka, rendering the image simply with uniform illumination). And I find
  /**
    * render an arbitrary property on the mesh into buffer (rasterization)
    *
    * @param renderParameter scene description
    * @param mesh mesh to render, positions
    * @param property surface property to rasterize
    * @tparam A type of surface property
    * @return
    */

 
def renderPropertyImage[A: ClassTag](renderParameter: RenderParameter,
                                       mesh
: TriangleMesh3D,
                                       property
: MeshSurfaceProperty[A]): PixelImage[Option[A]] = {
   
TriangleRenderer.renderPropertyImage(mesh,
      renderParameter
.pointShader,
      property
,
      renderParameter
.imageSize.width,
      renderParameter
.imageSize.height
   
)
in ParametricRenderer.scala

But I don't know how to obtain the property parameter...

Thanks ahead.

Andreas Schneider

unread,
Jan 24, 2018, 12:32:25 PM1/24/18
to scalismo-faces
Hi,
the property parameter is attached to the VertexColorMesh3D object.
It is mesh.color, it has the type MeshSurfaceProperty[RGBA].

Best regards,
Andreas Schneider
Reply all
Reply to author
Forward
0 new messages