File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -104,34 +104,36 @@ uniform mat4 projection;
104
104
105
105
in float a_idx;
106
106
107
- out vec4 v_xyzw;
107
+ out vec3 v_xyz;
108
+ out vec3 v_nrm;
108
109
out vec4 v_uvst;
109
- out vec4 v_position;
110
110
111
111
void main()
112
112
{
113
- mainVertex( v_xyzw , v_uvst , a_idx );
113
+
114
+ mainVertex( v_xyz , v_nrm , v_uvst , a_idx );
114
115
115
- v_position = projection * modelview * vec4(v_xyzw.xyz, 1.0) ;
116
+ v_nrm = mat3(modelview) * v_nrm ; // only rotate normal
116
117
117
- gl_Position=v_position ;
118
+ gl_Position = projection * modelview * vec4( v_xyz , 1.0 ) ;
118
119
}
119
120
120
121
#endif
121
122
122
123
123
124
#ifdef FRAGMENT_SHADER
124
125
125
- in vec4 v_xyzw;
126
+ in vec3 v_xyz;
127
+ in vec3 v_nrm;
126
128
in vec4 v_uvst;
127
- in vec4 v_position;
128
129
129
- out vec4 FragColor;
130
+ out vec4 FragColor;
130
131
131
132
void main()
132
133
{
133
- mainFragment( FragColor , v_xyzw , v_uvst );
134
+ mainFragment( FragColor , v_xyz , v_nrm , v_uvst );
134
135
}
136
+
135
137
#endif
136
138
137
139
]]
You can’t perform that action at this time.
0 commit comments