// --------------------------------------------------------------------------- // Project: NintendoWare // File: GenTexcoordSphereReflection.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" //----------------------------------------------------------------------------- // @brief 法線か、反射ベクトルの xy を利用してテクスチャ座標を TEMP_TEX に格納します。 //----------------------------------------------------------------------------- l_gen_texcoord_sphere_reflection: #ifdef NW_NORMAL_ENV_MAP mov TEMP1.xy, CONST_HALF mov TEMP1.zw, CONST_0 mad TEMP_TEX, TEMP_NORM, TEMP1, TEMP1 mov TEMP_TEX.zw, CONST_0_0_1_1 #else call l_gen_texcoord_reflection mov TEMP1, TEMP_TEX add TEMP1.z, TEMP1.z, CONST_1 dp3 TEMP1, TEMP1, TEMP1 rsq TEMP2, TEMP1.x mul TEMP2, TEMP2, CONST_HALF mul TEMP_TEX.xy, TEMP_TEX.xy, TEMP2 add TEMP_TEX.xy, TEMP_TEX.xy, CONST_HALF #endif ret