Skip to content

Commit 64d7d5f

Browse files
committed
.
1 parent b61553e commit 64d7d5f

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

lua/swanky/edit/show_vtoy.lua

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,34 +104,36 @@ uniform mat4 projection;
104104
105105
in float a_idx;
106106
107-
out vec4 v_xyzw;
107+
out vec3 v_xyz;
108+
out vec3 v_nrm;
108109
out vec4 v_uvst;
109-
out vec4 v_position;
110110
111111
void main()
112112
{
113-
mainVertex( v_xyzw , v_uvst , a_idx );
113+
114+
mainVertex( v_xyz , v_nrm , v_uvst , a_idx );
114115
115-
v_position = projection * modelview * vec4(v_xyzw.xyz, 1.0) ;
116+
v_nrm = mat3(modelview) * v_nrm ; // only rotate normal
116117
117-
gl_Position=v_position;
118+
gl_Position = projection * modelview * vec4( v_xyz , 1.0 );
118119
}
119120
120121
#endif
121122
122123
123124
#ifdef FRAGMENT_SHADER
124125
125-
in vec4 v_xyzw;
126+
in vec3 v_xyz;
127+
in vec3 v_nrm;
126128
in vec4 v_uvst;
127-
in vec4 v_position;
128129
129-
out vec4 FragColor;
130+
out vec4 FragColor;
130131
131132
void main()
132133
{
133-
mainFragment( FragColor , v_xyzw , v_uvst );
134+
mainFragment( FragColor , v_xyz , v_nrm , v_uvst );
134135
}
136+
135137
#endif
136138
137139
]]

0 commit comments

Comments
 (0)