UserRenderNodeDemo

Overview

This demo displays a model using the CTR-SDK GR library inside render commands set for user-defined render nodes.

How to Use

Description

One method of rendering by jointly using NintendoWare with other libraries uses RenderCommand Rendering by the CTR-SDK GR library is performed using UserRenderNode. UserRenderNode supports the use of RenderCommand in UserRenderNodeDemo. For details on RenderCommand, see Interrupt Processing During Rendering.

User-defined processes for creating render commands are implemented using Invoke for classes that have inherited UserRenderCommand. Rendering by the CTR-SDK CR library is implemented here for UserRenderNodeDemo.

UserRenderNode is added to the scene graph and UserRenderCommand, implemented independently by the user, is set for this node. Because the addition of UserRenderCommand to RenderQueue is not handled automatically, you must add it to RenderQueue before rendering. See the SubmitView implementation for details. Invoke of UserRenderCommand, added to the RenderQueue at tiem of render command creation, is called and user-defined render commands are created.

If a shader is switched, or other such processing is performed, inside a user-defined render process, you must appropriately reset the RenderContext once the independent render process has ended. Reset is executed using ResetState. Since the shader is switched for rendering by GR in UserRenderNodeDemo, the shader program and material cache are reset at the end of Invoke. If reset is not carried out appropriately, subsequent rendering may not be performed normally because the shader has not been changed.

Rendering that accounts for UserRenderNode transforms is carried out by UserRenderNodeDemo.


CONFIDENTIAL