$(NW4C_ROOT)\SampleData\Graphics\Shader\UserShader or $(NW4C_ROOT)\SampleData\Graphics\Shader\MultiplyShader.$(NW4C_ROOT)\SampleData\Graphics\Shader\UserShader.UserShader adds a feature for extending vertex coordinates in the normal vector direction and a feature for adding a particular color to the output color.$(NW4C_ROOT)\sources\shaders\gfx\DefaultShader directory. Now, copy the files in the following table and rename them as shown.| Files to Copy | Rename As |
|---|---|
gfx_DefaultShader0.vsh | gfx_UserShader.vsh |
TransformMatrix.vsh | UserTransformMatrix.vsh |
CalcColor.vsh | UserCalcColor.vsh |
ShaderConfig.h | Do not change (must be copied for each shader) |
ShaderConfig.h.define new_user_register_start from a value of c60 to a value of c48.c22 to extension_deform and c74 to extension_color.gfx_UserShader.vsh file.#pragma bind_symbol(NDeform, c22, c22) as a register for extending a vertex in the normal vector direction, and add #pragma bind_symbol(ExColor, c74, c74) as a register for adjusting the output color. You can also reduce the number of vertex lights to make the universal register region available for users.#pragma bind_symbol(UnivReg, c25, c84) to #pragma bind_symbol(UnivReg, c25, c73).UserTransformMatrix.vsh and UserCalcColor.vsh.ctr_VertexShaderLinker32 links shaders is the same as when shader types are assigned when creating the shader intermediate file.
$(CTRSDK_ROOT)\tools\CommandLineTools\ctr_VertexShaderAssembler32.exe gfx_UserShader.vsh -I$(NW4C_ROOT)\sources\shaders\gfx
$(CTRSDK_ROOT)\tools\CommandLineTools\ctr_VertexShaderAssembler32.exe UserTransformMatrix.vsh -I$(NW4C_ROOT)\sources\shaders\gfx
$(CTRSDK_ROOT)\tools\CommandLineTools\ctr_VertexShaderAssembler32.exe UserCalcColor.vsh -I$(NW4C_ROOT)\sources\shaders\gfx
$(CTRSDK_ROOT)\tools\CommandLineTools\ctr_VertexShaderAssembler32.exe $(NW4C_ROOT)\sources\shaders\gfx\DefaultShader\CalcTexcoord0.vsh -I$(NW4C_ROOT)\sources\shaders\gfx
$(CTRSDK_ROOT)\tools\CommandLineTools\ctr_VertexShaderAssembler32.exe $(NW4C_ROOT)\sources\shaders\gfx\DefaultShader\CalcTexcoord1.vsh -I$(NW4C_ROOT)\sources\shaders\gfx
$(CTRSDK_ROOT)\tools\CommandLineTools\ctr_VertexShaderAssembler32.exe $(NW4C_ROOT)\sources\shaders\gfx\DefaultShader\CalcTexcoord2.vsh -I$(NW4C_ROOT)\sources\shaders\gfx
$(CTRSDK_ROOT)\tools\CommandLineTools\ctr_VertexShaderAssembler32.exe $(NW4C_ROOT)\sources\shaders\gfx\DefaultShader\CalcQuaternion.vsh -I$(NW4C_ROOT)\sources\shaders\gfx
$(CTRSDK_ROOT)\tools\CommandLineTools\ctr_VertexShaderAssembler32.exe $(NW4C_ROOT)\sources\shaders\gfx\DefaultShader\GetTexcoordSource.vsh -I$(NW4C_ROOT)\sources\shaders\gfx
$(CTRSDK_ROOT)\tools\CommandLineTools\ctr_VertexShaderAssembler32.exe $(NW4C_ROOT)\sources\shaders\gfx\DefaultShader\CalcVertexLighting.vsh -I$(NW4C_ROOT)\sources\shaders\gfx
$(CTRSDK_ROOT)\tools\CommandLineTools\ctr_VertexShaderAssembler32.exe $(NW4C_ROOT)\sources\shaders\gfx\DefaultShader\CalcHemisphereLighting.vsh -I$(NW4C_ROOT)\sources\shaders\gfx
$(CTRSDK_ROOT)\tools\CommandLineTools\ctr_VertexShaderAssembler32.exe $(NW4C_ROOT)\sources\shaders\gfx\DefaultShader\GenTexcoordReflection.vsh -I$(NW4C_ROOT)\sources\shaders\gfx
$(CTRSDK_ROOT)\tools\CommandLineTools\ctr_VertexShaderAssembler32.exe $(NW4C_ROOT)\sources\shaders\gfx\DefaultShader\GenTexcoordSphereReflection.vsh -I$(NW4C_ROOT)\sources\shaders\gfx
$(CTRSDK_ROOT)\tools\CommandLineTools\ctr_VertexShaderLinker32.exe gfx_UserShader.obj UserTransformMatrix.obj UserCalcColor.obj CalcTexcoord0.obj CalcTexcoord1.obj CalcTexcoord2.obj CalcQuaternion.obj GetTexcoordSource.obj CalcHemisphereLighting.obj CalcVertexLighting.obj GenTexcoordReflection.obj GenTexcoordSphereReflection.obj -OUserShader.shbin
UserShader.shbin.Viewer or another tool.UserShader to Male.
CONFIDENTIAL