mirror of https://github.com/teverse/teverse
Compare commits
No commits in common. "6c75e1f15063003e537b11d97faaa098378117c5" and "ff7349f77b0f136ebdffab18fd39bd958a98f7f2" have entirely different histories.
6c75e1f150
...
ff7349f77b
|
@ -10,14 +10,6 @@ $output v_normal, v_colour, v_position, v_pbr
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <teverse.sh>
|
#include <teverse.sh>
|
||||||
#define __BUFFER_XX(_name, _type, _reg, _access) \
|
|
||||||
layout(std430, binding=_reg) _access buffer _name ## Buffer \
|
|
||||||
{ \
|
|
||||||
_type _name[]; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define BUFFER_RO(_name, _type, _reg) __BUFFER_XX(_name, _type, _reg, readonly)
|
|
||||||
|
|
||||||
BUFFER_RO(normalData, vec4, 2);
|
BUFFER_RO(normalData, vec4, 2);
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
|
@ -40,8 +32,8 @@ void main()
|
||||||
gl_Position = mul(u_viewProj, vec4(wpos, 1.0) );
|
gl_Position = mul(u_viewProj, vec4(wpos, 1.0) );
|
||||||
|
|
||||||
vec3 normal = a_normal.xyz * 2.0 - 1.0;
|
vec3 normal = a_normal.xyz * 2.0 - 1.0;
|
||||||
vec3 wnormal = instMul(normalMatrix, normal.xyz);
|
vec3 wnormal = instMul(normalMatrix, vec4(normal.xyz, 0.0));
|
||||||
v_normal = encodeNormalUint(normalize(wnormal.xyz));
|
v_normal = encodeNormalUint(normalize(wnormal.xyz));
|
||||||
v_colour = i_data4;
|
v_colour = i_data4;
|
||||||
v_position = gl_Position.xyz;
|
v_position = gl_Position;
|
||||||
}
|
}
|
Loading…
Reference in New Issue