Class SoRenderToTextureProperty

  • All Implemented Interfaces:
    SafeDisposable

    public class SoRenderToTextureProperty
    extends SoNode
    Class for creating a texture by rendering a scene graph. This class is used to define an image for texture mapping which is created by rendering a scene graph.

    It can be used with the classes SoTexture2 and SoTextureCubeMap. Create the SoRenderToTextureProperty node and assign it to the renderToTextureProperty field of the texture mapping node.

    The SoRenderToTarget node can also be used to create texture images.

    One of the two fields, node or path, must be defined.

    The scene graph should normally contain a camera and at least one light. Unlike SoRenderToTarget, the children of SoRenderToTextureProperty do not inherit the camera, lights, etc from the main scene graph.

    Note that the default image size is 0,0 (effectively disables rendering).

    File format/default:

    RenderToTextureProperty {

      node []
      path ""
      updatePolicy WHEN_NEEDED
      backgroundColor 0 0 0
      size 0 0
      component RGB
    }

    See Also:
    SoTexture2, SoTextureCubeMap
    • Field Detail

      • node

        public final SoMFNode node
        Specifies the scene graph(s) (SoNode(s)) to be rendered into the texture. For use with SoTexture2, only one scene graph should be specified. For use with SoTextureCube map, six scene graphs must be specified, one for each face of the cube in the order:

        • imagePosX (left)
        • imageNegX (right)
        • imagePosY (bottom)
        • imageNegY (top)
        • imagePosZ (back)
        • imageNegZ (front)

        The node field has priority over the path field. Null by default.

      • path

        public final SoMFPath path
        Specifies the scene graph(s) (SoPath(s)) to be rendered into the texture. For use with SoTexture2, only one path should be specified. For use with SoTextureCube map, six paths must be specified, one for each face of the cube in the order:

        • imagePosX (left)
        • imageNegX (right)
        • imagePosY (bottom)
        • imageNegY (top)
        • imagePosZ (back)
        • imageNegZ (front)

        The node field has priority over the path field. Null by default.

      • backgroundColor

        public final SoSFColor backgroundColor
        Background color used when rendering the scene graph. Black by default.
      • size

        public final SoSFVec2s size
        Size in pixels of the rendered texture. (0, 0) by default.
      • trigger

        public final SoSFTrigger trigger
        Trigger field to render the scene into the Pbuffer. Effective only if updatePolicy is ON_TRIGGER.
    • Constructor Detail

      • SoRenderToTextureProperty

        public SoRenderToTextureProperty()
    • Method Detail

      • setContextForSharing

        @Deprecated
        public void setContextForSharing​(SoGLContext name_20783)
        Deprecated.
        As of Open Inventor 10000. No more used. Related to deprecated PBuffer implementation.

        Warning Deprecated since Open Inventor 10000. No more used. Related to deprecated PBuffer implementation.

      • getGLRenderAction

        public SoGLRenderAction getGLRenderAction()
        Returns the render action used for rendering the scene.
      • setGLRenderAction

        public void setGLRenderAction​(SoGLRenderAction ra)
        Specifies a custom render action to use for rendering the scene.