1// ---------------------------------------------------------------------------
2//  Project:  NintendoWare
3//  File:     CalcHemisphereLighting.vsh
4//
5//  Copyright (C)2009-2011 Nintendo/HAL Laboratory, Inc.  All rights reserved.
6//
7//  These coded instructions, statements, and computer programs contain proprietary
8//  information of Nintendo and/or its licensed developers and are protected by
9//  national and international copyright laws. They may not be disclosed to third
10//  parties or copied or duplicated in any form, in whole or in part, without the
11//  prior written consent of Nintendo.
12//
13//  The content herein is highly confidential and should be handled accordingly.
14//
15//  $Revision: $
16// ---------------------------------------------------------------------------
17
18#include "ShaderConfig.h"
19#include "VertexShader.h"
20
21//-----------------------------------------------------------------------------
22// @brief        �������C�e�B���O���v�Z�� TEMP_COLO �Ɍ��ʂ������܂��B
23//-----------------------------------------------------------------------------
24l_calc_hemisphere_lighting:
25    dp3     TEMP1,      TEMP_NORM,                  nw_hemi_sphere_direction._XYZW
26    mov     TEMP2,      nw_hemi_sphere_direction._W
27    mad     TEMP1,      TEMP1,                      TEMP2,         TEMP2
28    mov     TEMP3,      nw_hemi_sphere_ground._XYZW
29    sub     TEMP2,      nw_hemi_sphere_sky._XYZW,         TEMP3
30    mad     TEMP4,      TEMP2,                      TEMP1,         TEMP3
31    ifb     nw_is_hemi_sphere_occlusion
32        mul     TEMP4,  TEMP4,  TEMP_COLO.wwww
33    endif
34    mad     TEMP_COLO.xyz,     TEMP4,     nw_material_diffuse._XYZW,     TEMP_COLO
35    mov     TEMP_STUS.x,        CONST_1
36    ret
37