1// ---------------------------------------------------------------------------
2//  Project:  NintendoWare
3//  File:     gfx_ParticleGShader.gsh
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: 15928 $
14// ---------------------------------------------------------------------------
15
16// �W�I���g���V�F�[�_�w��
17#pragma gs_assemble_as_geometry_shader
18
19//------------------------------------------
20//  Definitions
21//------------------------------------------
22
23// �_�~�[�ň�“��͑������`����
24#pragma bind_symbol(geometry_input_dummy, v0, v0)
25
26// �ʏ�̃W�I���g���f�[�^���[�h0�ł��邽��
27// ���_�V�F�[�_���瑗�o���ꂽ�f�[�^�́A���̓��W�X�^��0���珇�ԂɊi�[�����
28#define in_position   v0
29#define in_quaternion v1
30#define in_view       v2
31#define in_color      v3
32#define in_texcoord   v4
33#define in_texoffset  v5
34#define in_posoffset1 v6
35#define in_posoffset2 v7
36
37#pragma output_map(position, o0)
38#pragma output_map(quaternion, o1)
39#pragma output_map(view, o2)
40#pragma output_map(color, o3)
41#pragma output_map (texture0, o4.xy)
42#pragma output_map (texture1, o5.xy)
43//#pragma output_map (texture2, o6.xy)
44
45#define out_pos  o0
46#define out_quat o1
47#define out_view o2
48#define out_col  o3
49#define out_tex0 o4
50#define out_tex1 o5
51//#define out_tex2 o6
52
53// ���W�X�^
54#define TEMP0 r0
55
56main:
57    // ���_�o�́i���ʁj
58
59    // vertex0
60    mov    TEMP0,           in_position
61    add    TEMP0,           TEMP0,          in_posoffset1
62    mov    out_pos,         TEMP0
63
64    mov    out_quat,        in_quaternion
65    mov    out_view,        in_view
66    mov    out_col,         in_color
67
68    mov    TEMP0,           in_texcoord
69    add    TEMP0.xy,        TEMP0.xy,       in_texoffset.xy
70    add    TEMP0.xy,        TEMP0.xy,       in_texoffset.zw
71    mov    out_tex0,        TEMP0
72    mov    out_tex1,        TEMP0
73//    mov    out_tex2,        TEMP0
74
75    smf    0, 0, 0
76    vout
77
78    // vertex1
79    mov    TEMP0,           in_position
80    add    TEMP0,           TEMP0,          -in_posoffset2
81    mov    out_pos,         TEMP0
82
83    mov    out_quat,        in_quaternion
84    mov    out_view,        in_view
85    mov    out_col,         in_color
86
87    mov    TEMP0,           in_texcoord
88    add    TEMP0.xy,        TEMP0.xy,       in_texoffset.xy
89    mov    out_tex0,        TEMP0
90    mov    out_tex1,        TEMP0
91//    mov    out_tex2,        TEMP0
92
93    smf    0, 0, 1
94    vout
95
96    // vertex2
97    mov    TEMP0,           in_position
98    add    TEMP0,           TEMP0,          in_posoffset2
99    mov    out_pos,         TEMP0
100
101    mov    out_quat,        in_quaternion
102    mov    out_view,        in_view
103    mov    out_col,         in_color
104
105    mov    TEMP0,           in_texcoord
106    add	   TEMP0.xy,        TEMP0.xy,       in_texoffset.zw
107    mov    out_tex0,        TEMP0
108    mov    out_tex1,        TEMP0
109//    mov    out_tex2,        TEMP0
110
111    smf    0, 1, 2
112    vout
113
114    // vertex3
115    mov    TEMP0,           in_position
116    add    TEMP0,           TEMP0,          -in_posoffset1
117    mov    out_pos,         TEMP0
118
119    mov    out_quat,        in_quaternion
120    mov    out_view,        in_view
121    mov    out_col,         in_color
122
123    mov    out_tex0,        in_texcoord
124    mov    out_tex1,        in_texcoord
125//    mov    out_tex2,        in_texcoord
126
127    smf    1, 1, 0
128    vout
129
130    end
131
132endmain:
133