1// ---------------------------------------------------------------------------
2//  Project:  NintendoWare
3//  File:     CalcHemiSphereLighting.vsh
4//
5//  Copyright (C)2009-2010 Nintendo Co., Ltd.  All rights reserved.
6//
7//  These coded instructions, statements, and computer programs contain
8//  proprietary information of Nintendo of America Inc. and/or Nintendo
9//  Company Ltd., and are protected by Federal copyright law.  They may
10//  not be disclosed to third parties or copied or duplicated in any form,
11//  in whole or in part, without the prior written consent of Nintendo.
12//
13//  $Revision:$
14// ---------------------------------------------------------------------------
15
16#include "ShaderConfig.h"
17#include "VertexShader.h"
18
19//-----------------------------------------------------------------------------
20// @brief        �������C�e�B���O���v�Z�� TEMP_COLO �Ɍ��ʂ������܂��B
21//-----------------------------------------------------------------------------
22l_calc_hemisphere_lighting:
23    dp3     TEMP1,      TEMP_NORM,                  nw_hemi_sphere_direction._XYZW
24    mov     TEMP2,      nw_hemi_sphere_direction._W
25    mad     TEMP1,      TEMP1,                      TEMP2,         TEMP2
26    mov     TEMP3,      nw_hemi_sphere_ground._XYZW
27    sub     TEMP2,      nw_hemi_sphere_sky._XYZW,         TEMP3
28    mad     TEMP4,      TEMP2,                      TEMP1,         TEMP3
29    ifb     nw_is_hemi_sphere_occlusion
30        mul     TEMP4,  TEMP4,  TEMP_COLO.wwww
31    endif
32    mul     TEMP_COLO.xyz,     TEMP4,     TEMP_COLO
33    ret
34