// --------------------------------------------------------------------------- // Project: NintendoWare // File: CalcTexCoord1.vsh // // Copyright (C)2009-2010 Nintendo Co., Ltd. All rights reserved. // // These coded instructions, statements, and computer programs contain // proprietary information of Nintendo of America Inc. and/or Nintendo // Company Ltd., and are protected by Federal copyright law. They may // not be disclosed to third parties or copied or duplicated in any form, // in whole or in part, without the prior written consent of Nintendo. // // $Revision:$ // --------------------------------------------------------------------------- #include "ShaderConfig.h" #include "VertexShader.h" //------------------------------------------ // テクスチャ座標計算 //------------------------------------------ // テクスチャ座標1 l_calc_texcoord1: mov TEMP0.xy, nw_texture_coordinate._Y ifb nw_uv_mapping_position1 // UVマッピング #ifdef NW_FIXED_TEX_SORUCE // テクスチャソースを固定で取得します。 mul TEMP_TEX.xy, nw_texcoord1.xy, nw_attribute_scale1._Y mov TEMP_TEX.zw, CONST_0_0_1_1 #else call l_get_texcoord_source #endif dp4 TRAN_TEX1.x, TEMP_TEX, nw_texture_matrix1[0]._XYWZ dp4 TRAN_TEX1.y, TEMP_TEX, nw_texture_matrix1[1]._XYWZ mov TRAN_TEX1.zw, TEMP_TEX.zw mov o_TexCoord1, TRAN_TEX1 else ifb nw_is_texture1_enabled cmp EQ, EQ, TEMP0.xy, CONST_3_4_4_4 mov TEMP_TEX.zw, CONST_0_0_1_1 mov TRAN_TEX1.zw, TEMP_TEX.zw ifc 0, 0, COND_MODE_AND // 投影マッピング mov TEMP_TEX, WRLD_POSI dp4 TRAN_TEX1.x, TEMP_TEX, nw_texture_matrix1[0]._XYZW dp4 TRAN_TEX1.y, TEMP_TEX, nw_texture_matrix1[1]._XYZW dp4 TRAN_TEX1.z, TEMP_TEX, nw_texture_matrix1[2]._XYZW rcp TEMP_TEX.w, TRAN_TEX1.z mul TRAN_TEX1.xy, TRAN_TEX1.xy, TEMP_TEX.w add TRAN_TEX1.xy, TRAN_TEX1.xy, nw_texture_translate.zw else call l_gen_texcoord_sphere_reflection dp4 TRAN_TEX1.x, TEMP_TEX, nw_texture_matrix1[0]._XYZW dp4 TRAN_TEX1.y, TEMP_TEX, nw_texture_matrix1[1]._XYZW endif // 出力レジスタには全てのコンポーネントに書き込みを行う必要があります。 mov o_TexCoord1, TRAN_TEX1 else mov o_TexCoord1, CONST_0 endif nop endif nop ret