Items Added and Revised in 1.3.0

Graphics

Animation

Particle

Troubleshooting:

How do I display more than one character having the same motion?

See Sharing Skeletons.

How do I dynamically change the world matrix of a model?

See Overwriting the world matrix of a node or bone.
For information regarding callbacks, also see Interrupting updates or rendering using callbacks.

How do I set the visibility of a mesh using DCC node names?

If the Mesh Visibility Mode option of the DCC exporter is set to Bind By Name, the exporter outputs the DCC node names and a mesh visibility flag table corresponding to those nodes. Use this table to look up and change a flag by name, allowing you to set mesh visibility using the DCC node name. Mesh rendering uses the bitwise AND of this flag and the visibility flag for the mesh itself.

Similar tables also exist for model resources and model instances. Flags actually referenced when drawing meshes are actually stored in the model instance table, so this table cannot be used to look them up by name. Therefore, when setting visibility, first get the index from the model resource table using name look-up, and then set the flag by specifying the index in the model instance table.

The sample code below sets the model node named "Shield" as invisible.

Model* model;
int idx = model->GetResModel().GetMeshNodeVisibilitiesIndex("Shield");
NW_ASSERT(idx != -1); // Can't find a node with the specified name
model->GetResMeshNodeVisibilities(idx).IsVisible = false;

You can also set animations for this visibility table. The method for setting animations is the same as for other visibility animations.

How do I get the scale for nodes and bones?

See Handling Scaling.

Ambient light is not applied

Ambient light cannot be applied if at least one fragment light does not exist. This is due to hardware restrictions.
If you want to apply an ambient light only, this can be done by adding a black fragment light.

Named visibilities at the node level under DCC are not enabled

Set the Mesh Visibility Mode option of the DCC exporter to Bind By Name to sets visibility at the node name level under DCC rather than using mesh numbers.

This visibility flag is saved in table format within the model class, rather than as a mesh. You must use the GetMeshNodeVisibilitiesIndex and GetResMeshNodeVisibilities functions to get the flag. You can also use the IsMeshVisible function to get the bitwise AND of the mesh visibilities and named visibilities.***

Your application does not generally need to be aware of these issues as these determinations are made automatically. However, if you have customized the render queue, you must also change visibility determination processing accordingly. See the BasicEnqueueModelFunctor implementation for details.

How do I apply lighting and other material settings to a non-gfx render?

When also using non-gfx libraries such as the CTR Mii Face Library or the GR library, you can render faster by batching commands together for each library. This minimizes the cost of switching between shaders and other resources. If using a gfx material with another library, use the DirectMaterialActivator function to set a specific command. The following code gives an example of use.

  1. Create a DirectMaterialActivator object and set the flag.
    directActivator = nw::gfx::DirectMaterialActivator::Create(allocator);
    directActivator->SetActivateFlags(nw::gfx::Model::MULTI_FLAG_LIGHTING_MATERIAL);
        			
    This code sets a lighting material to the flag.
  2. Get the Material from the Model, and set it to the RenderContext. Use DirectMaterialActivator to activate the set material.
    nw::gfx::Material* material = model->GetMaterial(0);
    renderContext->SetMaterial(material);
    renderContext->ActivateContext(directActivator);
        			
    This only sets the commands for the specified material.
  3. Render for the non-gfx libraries, such as the CTR Mii Face Library or the GR library, so as not to overwrite the commands.

How do I change a bone pose using TransformAnimEvaluator::Bind and ChangeAnim?

Bone poses change when calling TransformAnimEvaluator::Bind and ChangeAnim (even if the animation is not being evaluated).
The value of each frame does not need to be written for elements not being animated. The bind pose only needs to be written once when calling Bind and ChangeAnim.

How do I execute an IsLightEnabled animation of a light?

IsLightEnabled animations are only enabled when the scene environment light set includes the target light.

The same is true when directly setting a flag without using animation.

How do I improve rough motion that results when changing the playback speed of a frame-format skeletal animation?

Calculate the value of a fractional frame by using linear interpolation to find the value of the previous and next frame.
This algorithm emphasizes accuracy over speed.

How do I make the double buffer work smoothly?

The VBO cache may cause particle behavior such as particles not being displayed in locations where they should exist, particles being displayed in places where they should not exist, and particles not moving smoothly.

See Explicitly Flushing the VBO Cache.

How do I change resource parameters?

See Changing Resource Parameters.

How do I change individual particle values?

See Changing Particle Information

How do I make the initializer disappear?

Sometimes, after attempting to change resources, the initializer cannot be found even if you search for it. This happens because the initializer has been deleted due to optimization.

See Conditions for Optimizing Streams to Parameters.

How do I execute a user-defined process on particles?

See User Updaters.

How do I change the size?

For details on enlarging or reducing the size of the coordinate system, see Usage of Each Scale.

See Enlarging and Reducing Particles During Rendering.

The GPU hangs after certain operations

The command buffer is doubled. If CPU and GPU processes are executing in parallel, any operation that changes the buffer accessed by the GPU can cause rendering corruption, and can cause the GPU to hang.

Do not run the following operations if the GPU might be accessing the buffer (i.e. when particle rendering is not complete).

How do I reduce the binary file size for particles?

Delete the binary resources for the particle default shader. When doing so, your application must load an external shader file and set up the resources. You can further reduce the binary size by deleting any unnecessary animation members. See Delete Unnecessary Animation Members for details.

If the message "Vertex-lights or user-registers might be overridden by bone matrices." appears

This message indicates that vertex lights or user registers may have been overwritten by bone matrices.
If this message appears, be sure to either limit the number of bones using the DCC plug-in or reduce the number of vertex lights and user registers.


CONFIDENTIAL