1======================================================================
2 CsdrUpdater for CTR
3                                                           2010/04/06
4======================================================================
5
6* Table of Contents
7 - Revision History
8 - Introduction
9 - Operating Environment
10 - Usage
11
12======================================================================
13 Revision History
14======================================================================
152010/01/14 Created ShbinToCsdr.
162010/04/06 Changed the name to CsdrUpdater.
17           Changed the NWCS intermediate file format from a template to a format to be loaded.
18======================================================================
19 Introduction
20======================================================================
21CsdrUpdater for CTR is a script for Base64 encoding the shader binary and swapping it with the binary part of the template NWCS intermediate file.
22
23Note: This script is provisional and may be removed if an equivalent function is implemented for NWCS.
24======================================================================
25 Operating Environment
26======================================================================
27Python 2.6 System
28
29======================================================================
30 Using the Tool
31======================================================================
32CsdrUpdater is executed as follows from the command prompt.
33
34   python CsdrUpdater.py [option] <input binary file name>
35
36If not specified by option, DefaultShader.csdr is used for the template NWCS intermediate file.
37
38If not specified by option, the output file name is created by removing the file extension from the input binary file name.
39
40The following options can be specified.
41   -i, --intermediate= : Specifies the template NWCS intermediate file name.
42   -o, --output=       : Specifies the output filename.
43   -h, --help          : Displays help.
44
45
46In order to use the output intermediate file with NWCS, it must be edited according to the user shader.
47It may not be possible to use the file with NWCS if the format is incorrect.
48A description of some attributes and elements is given below.
49
50■ ShaderCtr
51   -Name
52     The shader name.
53     This corresponds to the name displayed on the NWCS Contents manager.
54   -Binary
55     The shader binary.
56     Created by the shader assembler, Base64 encoded values are stored here.
57
58   -ShaderKinds
59    The kind of shader object.
60    According to the number and types of shader objects
61    Give this VertexShader or GeometryShader.
62
63    Example: <ShaderKindCtr>VertexShader</ShaderKindCtr>
64
65   ■ Descriptions
66     The program object description.
67
68     ■ Symbols
69       The shader symbol.
70      For the user-defined reserved uniform
71      you can specify bool or Vector1-4 values.
72
73       <B>Example:</B> <Vector4ShaderSymbolCtr>
74            <Vector4Xml X="1" Y="1" Z="1" W="1" />
75           </Vector4ShaderSymbolCtr>
76
77       -Name
78         The reserved uniform name.
79
80       -IsEnabled
81         Sets whether to use user-defined values.
82         DefaultValue, given below, is used if false.
83
84       -DefaultValue
85         The default value if not using a user-defined value,
86         or if there is no corresponding uniform value for the shader parameter.
87
88         <B>Example:</B> <Vector1Xml X="0" />
89            <Vector2Xml X="0" Y="1" />
90            <Vector3Xml X="0" Y="1" Z="2" />
91            <Vector4Xml X="0" Y="1" Z="2" W="3" />
92            <boolean>true</boolean>
93
94     ■ AttributeSymbols
95       The attribute symbols.
96       Specifies the vertex attribute and name.
97
98       <B>Example:</B> <AttributeSymbolCtr Usage="Position" Name="aPosition" />
99
100       -Name
101         The vertex attribute name.
102
103       -Usage
104         The vertex attribute.
105