1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"[]> 2<html xml:lang="en-US" lang="en-US"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <meta http-equiv="Content-Style-Type" content="text/css" /> 6 <link rel="stylesheet" href="../../css/document.css" type="text/css" /> 7 <title>FAQ</title> 8 </head> 9 <body> 10 <h1 id="newlist1_2_0">Items Added and Revised in 1.3.0</h1> 11 <ul> 12 <li><a href="#gfx_other_renderer">How do I apply lighting and other material settings to a non-<CODE>gfx</CODE> render?</a></li> 13 </ul> 14 15 <h1>Graphics</h1> 16 <ul> 17 18 <li><a href="#gfx_shared_skeleton">How do I display more than one character having the same motion?</a></li> 19 <li><a href="#gfx_world_matrix">How do I dynamically change the world matrix of a model?</a></li> 20 <li><a href="#mesh_node_visibility">How do I set the visibility of a mesh using DCC node names?</a></li> 21 <li><a href="#gfx_node_bone_scale">How do I get the scale for <CODE>TransformNode</CODE> and <CODE>Bone</CODE>?</a></li> 22 <li><a href="#gfx_global_ambient">Ambient light is not applied</a></li> 23 <li><a href="#gfx_mesh_node_visibility_unable">Named visibilities at the node level under DCC are not enabled</a></li> 24 <li><a href="#gfx_other_renderer">How do I apply lighting and other material settings to a non-<CODE>gfx</CODE> render?</a></li> 25 26 27 </ul> 28 <h1>Animation</h1> 29 <ul> 30 31 <li><a href="#bind">How do I change a bone pose using <CODE>TransformAnimEvaluator::Bind</CODE> and <CODE>ChangeAnim</CODE>?</a></li> 32 <li><a href="#light_enabled">How do I execute an <CODE>IsLightEnabled</CODE> animation of a light?</a></li> 33 <li><a href="#koma_precision">How do I improve rough motion that results when changing the playback speed of a frame-format skeletal animation?</a></li> 34 35 </ul> 36 <h1>Particle</h1> 37 <ul> 38 <li><a href="#ptcl_flushvbo">How do I make the double buffer work smoothly?</a></li> 39 <li><a href="#ptcl_changeresource">How do I change resource parameters?</a></li> 40 <li><a href="#ptcl_changestream">How do I change individual particle values?</a></li> 41 <li><a href="#ptcl_optimizestream">How do I make the initializer disappear?</a></li> 42 <li><a href="#ptcl_userupdater">How do I execute a user-defined process on particles?</a></li> 43 <li><a href="#ptcl_drawoffset">How do I change the size?</a></li> 44 <li><a href="#ptcl_gpuhungup">The GPU hangs after certain operations</a></li> 45 </ul> 46 47 <h1>Troubleshooting:</h1> 48 <ul> 49 <li><a href="#trouble_shader">If the message "Vertex-lights or user-registers might be overridden by bone matrices." appears</a></li> 50 </ul> 51 52 <!-- <GFX> --> 53 <h2 id="gfx_shared_skeleton">How do I display more than one character having the same motion?</h2> 54 <div class="section"> 55 See <a href="Coordinate.html#shared_skeleton">Sharing Skeletons</a>. 56 </div> 57 <h2 id="gfx_world_matrix">How do I dynamically change the world matrix of a model?</h2> 58 <div class="section"> 59 See <a href="Coordinate.html#world_matrix">Overwriting the world matrix of a node or bone</a>.<br /> For information regarding callbacks, also see <a href="AdvancedFeature.html#callback">Interrupting updates or rendering using callbacks</a>. 60 </div> 61 <h2 id="mesh_node_visibility">How do I set the visibility of a mesh using DCC node names?</h2> 62 <div class="section"> 63 <p> 64 If the <B>Mesh Visibility Mode</B> option of the DCC exporter is set to <B>Bind By Name</B>, 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. 65 </p> 66 <p> 67 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. 68 </p> 69 <p> 70 The sample code below sets the model node named "Shield" as invisible. 71 </p> 72 <pre> 73Model* model; 74int idx = model->GetResModel().GetMeshNodeVisibilitiesIndex("Shield"); 75NW_ASSERT(idx != -1); // Can't find a node with the specified name 76model->GetResMeshNodeVisibilities(idx).IsVisible = false;</pre> 77 <p> 78 You can also set animations for this visibility table. The method for setting animations is the same as for other visibility animations. 79 </p> 80 </div> 81 <h2 id="gfx_node_bone_scale">How do I get the scale for nodes and bones?</h2> 82 <div class="section"> 83 See <a href="Coordinate.html#node_bone_scale">Handling Scaling</a>. 84 </div> 85 86 <h2 id="gfx_global_ambient">Ambient light is not applied</h2> 87 <div class="section"> 88 <p> 89 Ambient light cannot be applied if at least one fragment light does not exist. This is due to hardware restrictions.<br /> If you want to apply an ambient light only, this can be done by adding a black fragment light. 90 </p> 91 </div> 92 93 <h2 id="gfx_mesh_node_visibility_unable">Named visibilities at the node level under DCC are not enabled</h2> 94 <div class="section"> 95 <p> 96 Set the <B>Mesh Visibility Mode</B> option of the DCC exporter to <B>Bind By Name</B> to sets visibility at the node name level under DCC rather than using mesh numbers. 97 </p> 98 <p> 99 This visibility flag is saved in table format within the model class, rather than as a mesh. You must use the <CODE>GetMeshNodeVisibilitiesIndex</CODE> and <a href="../../nw/gfx/Model/GetResMeshNodeVisibilities.html"><CODE>GetResMeshNodeVisibilities</CODE></a> functions to get the flag. You can also use the <a href="../../nw/gfx/Model/IsMeshVisible.html"><CODE>IsMeshVisible</CODE></a> function to get the bitwise AND of the mesh visibilities and named visibilities.*** 100 </p> 101 <p> 102 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 <CODE>BasicEnqueueModelFunctor</CODE> implementation for details. 103 </p> 104 </div> 105 106 <h2 id="gfx_other_renderer">How do I apply lighting and other material settings to a non-<CODE>gfx</CODE> render?</h2> 107 <div class="section"> 108 <p> 109 When also using non-<CODE>gfx</CODE> 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 <CODE>gfx</CODE> material with another library, use the <a href="../../nw/gfx/DirectMaterialActivator/Overview.html"><CODE>DirectMaterialActivator</CODE></a> function to set a specific command. The following code gives an example of use. 110 <ol> 111 <li> 112 Create a <CODE>DirectMaterialActivator</CODE> object and set the flag. 113 <pre> 114directActivator = nw::gfx::DirectMaterialActivator::Create(allocator); 115directActivator->SetActivateFlags(nw::gfx::Model::MULTI_FLAG_LIGHTING_MATERIAL); 116 </pre> 117 This code sets a lighting material to the flag. 118 </li> 119 <li> 120 Get the <a href="../../nw/gfx/Material/Overview.html"><CODE>Material</CODE></a> from the <a href="../../nw/gfx/Model/Overview.html"><CODE>Model</CODE></a>, and set it to the <a href="../../nw/gfx/RenderContext/Overview.html"><CODE>RenderContext</CODE></a>. Use <CODE>DirectMaterialActivator</CODE> to activate the set material. 121 <pre> 122nw::gfx::Material* material = model->GetMaterial(0); 123renderContext->SetMaterial(material); 124renderContext->ActivateContext(directActivator); 125 </pre> 126 This only sets the commands for the specified material. 127 </li> 128 <li> 129 Render for the non-<CODE>gfx</CODE> libraries, such as the CTR Mii Face Library or the GR library, so as not to overwrite the commands. 130 </li> 131 </ol> 132 </p> 133 </div> 134 135 <!-- <ANIM> --> 136 <h2 id="bind">How do I change a bone pose using <CODE>TransformAnimEvaluator::Bind</CODE> and <CODE>ChangeAnim</CODE>?</h2> 137 <div class="section"> 138 <p> 139 Bone poses change when calling <a href="../../nw/gfx/TransformAnimEvaluator/Bind.html"><CODE>TransformAnimEvaluator::Bind</CODE></a> and <a href="../../nw/gfx/TransformAnimEvaluator/ChangeAnim.html"><CODE>ChangeAnim</CODE></a> (even if the animation is not being evaluated).<br /> 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 <CODE>Bind</CODE> and <CODE>ChangeAnim</CODE>. 140 </p> 141 </div> 142 143 <h2 id="light_enabled">How do I execute an <CODE>IsLightEnabled</CODE> animation of a light?</h2> 144 <div class="section"> 145 <p> 146 <a href="../../nw/gfx/res/ResLight/IsLightEnabled.html"><CODE>IsLightEnabled</CODE></a> animations are only enabled when the scene environment light set includes the target light. 147 </p> 148 <p> 149 The same is true when directly setting a flag without using animation. 150 </p> 151 </div> 152 153 <h2 id="koma_precision">How do I improve rough motion that results when changing the playback speed of a frame-format skeletal animation?</h2> 154 <div class="section"> 155 <p> 156 Calculate the value of a fractional frame by using linear interpolation to find the value of the previous and next frame.<br /> This algorithm emphasizes accuracy over speed. 157 <ul> 158 <li>Vector components used in scale and translate operations are subject to linear interpolation.</li> 159 <li>All quaternion elements are subject to linear interpolation for rotate operations.</li> 160 </ul> 161 </p> 162 </div> 163 164 <!-- <PTCL> --> 165 <h2 id="ptcl_flushvbo">How do I make the double buffer work smoothly?</h2> 166 <div class="section"> 167 <p>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. </p> 168 <p>See <a href="Particle/Draw.html#flushvbo">Explicitly Flushing the VBO Cache</a>. 169 </p> 170 </div> 171 <h2 id="ptcl_changeresource">How do I change resource parameters?</h2> 172 <div class="section"> 173 See <a href="Particle/Calc.html#changeresource">Changing Resource Parameters</a>. 174 </div> 175 <h2 id="ptcl_changestream">How do I change individual particle values?</h2> 176 <div class="section"> 177 See <a href="Particle/Calc.html#changestream">Changing Particle Information</a> 178 </div> 179 <h2 id="ptcl_optimizestream">How do I make the initializer disappear?</h2> 180 <div class="section"> 181 <p>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. </p> 182 <p>See <a href="Particle/Calc.html#optimizestream">Conditions for Optimizing Streams to Parameters</a>. 183 </p> 184 </div> 185 <h2 id="ptcl_userupdater">How do I execute a user-defined process on particles?</h2> 186 <div class="section"> 187 See <a href="Particle/Calc.html#userupdater">User Updaters</a>. 188 </div> 189 <h2 id="ptcl_drawoffset">How do I change the size?</h2> 190 <div class="section"> 191 <p>For details on enlarging or reducing the size of the coordinate system, see <a href="Particle/Coordinate.html#scale">Usage of Each Scale</a>.</p> 192 <p>See <a href="Particle/Draw.html#drawoffset">Enlarging and Reducing Particles During Rendering</a>. 193 </p> 194 </div> 195 <h2 id="ptcl_gpuhungup">The GPU hangs after certain operations</h2> 196 <div class="section"> 197 <p>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.</p> 198 <p>Do not run the following operations if the GPU might be accessing the buffer (i.e. when particle rendering is not complete).</p> 199 <ul> 200 <li><CODE>ParticleSet::ClearParticleCollection</CODE></li> 201 <li>Destroying class instances</li> 202 <li>Changing streams on the <CODE>PARTICLE_BUFFER_BACK</CODE> side.</li> 203 </ul> 204 </div> 205 206 <h2 id="ptcl_gpuhungup">How do I reduce the binary file size for particles?</h2> 207 <div class="section"> 208 <p>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 <a href="Optimization.html#delete_anim_member">Delete Unnecessary Animation Members</a> for details. 209 </p> 210 </div> 211 212 213 <!-- <TROUBLE> --> 214 <h2 id="trouble_shader">If the message "Vertex-lights or user-registers might be overridden by bone matrices." appears</h2> 215 <div class="section"> 216 <p> 217 This message indicates that vertex lights or user registers may have been overwritten by bone matrices.<BR> 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. 218 </p> 219 </div> 220 221<hr><p>CONFIDENTIAL</p></body> 222</html>