Big reorganization
This commit is contained in:
parent
b903eced97
commit
44fb4197ca
11 changed files with 45 additions and 40 deletions
8
gl/gl.qrc
Normal file
8
gl/gl.qrc
Normal file
|
@ -0,0 +1,8 @@
|
|||
<RCC>
|
||||
<qresource prefix="gl/">
|
||||
<file>mesh.frag</file>
|
||||
<file>mesh.vert</file>
|
||||
<file>quad.frag</file>
|
||||
<file>quad.vert</file>
|
||||
</qresource>
|
||||
</RCC>
|
15
gl/mesh.frag
Normal file
15
gl/mesh.frag
Normal file
|
@ -0,0 +1,15 @@
|
|||
#version 120
|
||||
|
||||
varying vec3 ec_pos;
|
||||
|
||||
void main() {
|
||||
vec3 base3 = vec3(0.99, 0.96, 0.89);
|
||||
vec3 base2 = vec3(0.92, 0.91, 0.83);
|
||||
vec3 base00 = vec3(0.40, 0.48, 0.51);
|
||||
vec3 ec_normal = normalize(cross(dFdx(ec_pos), dFdy(ec_pos)));
|
||||
float a = dot(ec_normal, vec3(0.0, 0.0, 1.0));
|
||||
float b = dot(ec_normal, vec3(-0.57, -0.57, 0.57));
|
||||
|
||||
gl_FragColor = vec4((a*base2 + (1-a)*base00)*0.5 +
|
||||
(b*base3 + (1-b)*base00)*0.5, 1.0);
|
||||
}
|
13
gl/mesh.vert
Normal file
13
gl/mesh.vert
Normal file
|
@ -0,0 +1,13 @@
|
|||
#version 120
|
||||
attribute vec3 vertex_position;
|
||||
|
||||
uniform mat4 transform_matrix;
|
||||
uniform mat4 view_matrix;
|
||||
|
||||
varying vec3 ec_pos;
|
||||
|
||||
void main() {
|
||||
gl_Position = view_matrix*transform_matrix*
|
||||
vec4(vertex_position, 1.0);
|
||||
ec_pos = gl_Position.xyz;
|
||||
}
|
7
gl/quad.frag
Normal file
7
gl/quad.frag
Normal file
|
@ -0,0 +1,7 @@
|
|||
#version 120
|
||||
|
||||
varying vec3 frag_color;
|
||||
|
||||
void main() {
|
||||
gl_FragColor = vec4(frag_color, 1.0);
|
||||
}
|
10
gl/quad.vert
Normal file
10
gl/quad.vert
Normal file
|
@ -0,0 +1,10 @@
|
|||
#version 120
|
||||
attribute vec2 vertex_position;
|
||||
attribute vec3 vertex_color;
|
||||
|
||||
varying vec3 frag_color;
|
||||
|
||||
void main() {
|
||||
gl_Position = vec4(vertex_position, 0.9, 1.0);
|
||||
frag_color = vertex_color;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue