amélioration de la portabilité des nuanceurs
This commit is contained in:
parent
c4e7bb140a
commit
df2c318429
@ -5,12 +5,10 @@
|
|||||||
|
|
||||||
|
|
||||||
const GLchar *vertex_shader_source = R"glsl(
|
const GLchar *vertex_shader_source = R"glsl(
|
||||||
#version 150 core
|
attribute vec3 pos;
|
||||||
|
attribute vec3 col;
|
||||||
|
|
||||||
in vec3 pos;
|
varying vec3 frag_col;
|
||||||
in vec3 col;
|
|
||||||
|
|
||||||
out vec3 frag_col;
|
|
||||||
|
|
||||||
uniform mat4 proj;
|
uniform mat4 proj;
|
||||||
uniform mat4 view;
|
uniform mat4 view;
|
||||||
@ -23,10 +21,7 @@ void main() {
|
|||||||
)glsl";
|
)glsl";
|
||||||
|
|
||||||
const GLchar *fragment_shader_source = R"glsl(
|
const GLchar *fragment_shader_source = R"glsl(
|
||||||
#version 150 core
|
varying vec3 frag_col;
|
||||||
|
|
||||||
in vec3 frag_col;
|
|
||||||
out vec4 final_col;
|
|
||||||
|
|
||||||
uniform vec3 wf_col;
|
uniform vec3 wf_col;
|
||||||
uniform bool wireframe;
|
uniform bool wireframe;
|
||||||
@ -34,9 +29,9 @@ uniform float alpha;
|
|||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
if (wireframe)
|
if (wireframe)
|
||||||
final_col = vec4(wf_col, alpha);
|
gl_FragColor = vec4(wf_col, alpha);
|
||||||
else
|
else
|
||||||
final_col = vec4(frag_col, alpha);
|
gl_FragColor = vec4(frag_col, alpha);
|
||||||
}
|
}
|
||||||
)glsl";
|
)glsl";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user