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>Particle shaders</title>
8  </head>
9  <body>
10    <h1>Particle shaders</h1>
11  <div class="section">
12    <h2>Overview</h2>
13    <p>Particles use a standard default shader specially intended for particles that differs from the gfx standard default shader.<br /> Under CreativeStudio, the default shader applied to a model is selected automatically. It does not need to be selected by the user even during binary output.<br /> Even on actual hardware, there is no particular procecure that must be executed. <br /> However, there is increased processing cost from switching shaders when mixing 3D models and rendering. Rendering is therefore faster if it is split up for 3D models and particles. In GraphicsSystem of the demo library, this type of layering is performed as standard.</p>
14    <div>
15      <h2>Geometry shaders</h2>
16    </div>
17    <p>The geometry shaders used with NintendoWare particles differ from the geometry shaders used with DMP particles.<br /> Geometry shaders used for NintendoWare particles function as follows. Do not use geometry shaders as specifications are subject to future change without prior notice.</p>
18    <p>Input register</p>
19    <table border="1" cellspacing="0" cellpadding="0" width="415">
20      <tr>
21        <th width="72" nowrap="nowrap">Name </th>
22        <th width="72" nowrap="nowrap">Registers </th>
23        <th width="72" nowrap="nowrap">Number </th>
24        <th width="199" nowrap="nowrap">Description </th>
25      </tr>
26      <tr>
27        <td width="72" nowrap="nowrap" align="left">position</td>
28        <td width="72" nowrap="nowrap" align="center">v0</td>
29        <td width="72" nowrap="nowrap" align="center">1</td>
30        <td width="199" nowrap="nowrap" align="left">Center position.</td>
31      </tr>
32      <tr>
33        <td width="72" nowrap="nowrap" align="left">quaternion</td>
34        <td width="72" nowrap="nowrap" align="center">v1</td>
35        <td width="72" nowrap="nowrap" align="center">1</td>
36        <td width="199" nowrap="nowrap" align="left">Quaternion.</td>
37      </tr>
38      <tr>
39        <td width="72" nowrap="nowrap" align="left">view</td>
40        <td width="72" nowrap="nowrap" align="center">v2</td>
41        <td width="72" nowrap="nowrap" align="center">1</td>
42        <td width="199" nowrap="nowrap" align="left">View.</td>
43      </tr>
44      <tr>
45        <td width="72" nowrap="nowrap" align="left">color</td>
46        <td width="72" nowrap="nowrap" align="center">v3</td>
47        <td width="72" nowrap="nowrap" align="center">1</td>
48        <td width="199" nowrap="nowrap" align="left">The color.</td>
49      </tr>
50      <tr>
51        <td width="72" nowrap="nowrap" align="left">texcoord</td>
52        <td width="72" nowrap="nowrap" align="center">v4</td>
53        <td width="72" nowrap="nowrap" align="center">1</td>
54        <td width="199" nowrap="nowrap" align="left">Center of texture coordinate.</td>
55      </tr>
56      <tr>
57        <td width="72" nowrap="nowrap" align="left">texoffset</td>
58        <td width="72" nowrap="nowrap" align="center">v5</td>
59        <td width="72" nowrap="nowrap" align="center">1</td>
60        <td width="199" nowrap="nowrap" align="left">Base vector for texture coordinates.</td>
61      </tr>
62      <tr>
63        <td width="72" nowrap="nowrap" align="left">posoffset1</td>
64        <td width="72" nowrap="nowrap" align="center">v6</td>
65        <td width="72" nowrap="nowrap" align="center">1</td>
66        <td width="199" nowrap="nowrap" align="left">Base vector 1 for position.</td>
67      </tr>
68      <tr>
69        <td width="72" nowrap="nowrap" align="left">posoffset2</td>
70        <td width="72" nowrap="nowrap" align="center">v7</td>
71        <td width="72" nowrap="nowrap" align="center">1</td>
72        <td width="199" nowrap="nowrap" align="left">Base vector 2 for position.</td>
73      </tr>
74    </table>
75    <p>Four vertices are created from one vertex worth of data from the input register.</p>
76    <p>Vertex information to output</p>
77    <table border="1" cellspacing="0" cellpadding="0" width="485">
78      <tr>
79        <th width="47" nowrap="nowrap">Vertex number</th>
80        <th width="155" nowrap="nowrap">Position </th>
81        <th width="283" nowrap="nowrap">Texture coordinates </th>
82      </tr>
83      <tr>
84        <td width="47" nowrap="nowrap" align="center">0</td>
85        <td width="155" nowrap="nowrap">position + posoffset1</td>
86        <td width="283" nowrap="nowrap">texcoord.xy    + texoffset.xy + texoffset.zw</td>
87      </tr>
88      <tr>
89        <td width="47" nowrap="nowrap" align="center">1</td>
90        <td width="155" nowrap="nowrap">position - posoffset2</td>
91        <td width="283" nowrap="nowrap">texcoord.xy    + texoffset.xy</td>
92      </tr>
93      <tr>
94        <td width="47" nowrap="nowrap" align="center">2</td>
95        <td width="155" nowrap="nowrap">position + posoffset2</td>
96        <td width="283" nowrap="nowrap">texcoord.xy    + texoffset.zw</td>
97      </tr>
98      <tr>
99        <td width="47" nowrap="nowrap" align="center">3</td>
100        <td width="155" nowrap="nowrap">position – posoffset1</td>
101        <td width="283" nowrap="nowrap">texcoord.xy</td>
102      </tr>
103    </table>
104    <p>Other attributes are shared in common by all four vertices, and the contents of the input register are output as-is.</p>
105    <div>
106      <h2>Vertex shader limitations</h2>
107    </div>
108    <p>Because vertex shaders are unlike default shaders for 3D models, out of all material features, most features realized using vertex shaders cannot be used. These features will be implemented in the fugure in order of necessity.<br /> Currently,</p>
109    <ul>
110      <li>texture matrices for simple mapping</li>
111    </ul>
112    <p>are supported.</p>
113    <p>Only one set of texture coordinates is generated. The same content is output for texcoord0 and texcoord1.</p>
114  </div>
115  <hr><p>CONFIDENTIAL</p></body>
116</html>