Open source Star Ruler 2 source code!
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
attribute vec4 in_vertex;
|
||||
attribute vec3 in_normal;
|
||||
attribute vec4 in_tangent;
|
||||
attribute vec2 in_uv;
|
||||
|
||||
uniform mat3 invView;
|
||||
|
||||
varying vec3 forward, right;
|
||||
varying vec3 npos;
|
||||
varying vec3 normal, binormal, tangent;
|
||||
varying vec2 uv;
|
||||
|
||||
void main()
|
||||
{
|
||||
normal = normalize(gl_NormalMatrix * in_normal);
|
||||
tangent = normalize(gl_NormalMatrix * in_tangent.xyz);
|
||||
binormal = normalize(gl_NormalMatrix * cross(normal, in_tangent.xyz * in_tangent.w));
|
||||
|
||||
forward = normalize(invView * vec3(1.0,0.0,0.0));
|
||||
right = normalize(invView * vec3(0.0,0.0,1.0));
|
||||
|
||||
vec4 pos = gl_ModelViewMatrix * in_vertex;
|
||||
npos = -pos.xyz;
|
||||
|
||||
uv = in_uv;
|
||||
gl_Position = gl_ProjectionMatrix * pos;
|
||||
}
|
||||
Reference in New Issue
Block a user