Tech ENABLE_GLBEGIN_GLEND_SHADERS_ATTRIBUTES - Use vertex attributes and matrices in shaders.
Shader: mm_contour
This commit is contained in:
parent
c17c4d2e9a
commit
66fa2b1e26
9 changed files with 129 additions and 10 deletions
18
resources/shaders/mm_contour_attr.fs
Normal file
18
resources/shaders/mm_contour_attr.fs
Normal file
|
@ -0,0 +1,18 @@
|
|||
#version 110
|
||||
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
uniform vec4 uniform_color;
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
|
||||
const float EPSILON = 0.0001;
|
||||
|
||||
void main()
|
||||
{
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
gl_FragColor = uniform_color;
|
||||
// gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
// Values inside depth buffer for fragments of the contour of a selected area are offset
|
||||
// by small epsilon to solve z-fighting between painted triangles and contour lines.
|
||||
gl_FragDepth = gl_FragCoord.z - EPSILON;
|
||||
}
|
16
resources/shaders/mm_contour_attr.vs
Normal file
16
resources/shaders/mm_contour_attr.vs
Normal file
|
@ -0,0 +1,16 @@
|
|||
#version 110
|
||||
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
attribute vec3 v_position;
|
||||
|
||||
uniform mat4 view_model_matrix;
|
||||
uniform mat4 projection_matrix;
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
|
||||
void main()
|
||||
{
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
gl_Position = projection_matrix * view_model_matrix * vec4(v_position, 1.0);
|
||||
// gl_Position = ftransform();
|
||||
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue