// --------------------------------------------------------------------------- // Project: NintendoWare // File: GenTexcoordSphereReflection.vsh // // Copyright (C)2009-2011 Nintendo/HAL Laboratory, Inc. All rights reserved. // // These coded instructions, statements, and computer programs contain proprietary // information of Nintendo and/or its licensed developers and are protected by // national and international copyright laws. 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. // // The content herein is highly confidential and should be handled accordingly. // // $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