git-svn-id: svn://db.shs.com.ru/libs@626 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
24
qglengine/shaders/selection_frame.glsl
Normal file
24
qglengine/shaders/selection_frame.glsl
Normal file
@@ -0,0 +1,24 @@
|
||||
// vert //
|
||||
|
||||
void main(void) {
|
||||
qgl_FragTexture = qgl_Texture;
|
||||
gl_Position = qgl_ftransform();
|
||||
}
|
||||
|
||||
|
||||
// frag //
|
||||
|
||||
uniform vec2 dt, size;
|
||||
uniform float thickness;
|
||||
|
||||
void main(void) {
|
||||
vec2 frame_size = size / dt;
|
||||
vec2 pix_pos = qgl_FragTexture * frame_size;
|
||||
vec2 frame = vec2(1) + step(pix_pos, vec2(thickness)) - step(pix_pos, frame_size - vec2(thickness));
|
||||
vec2 line = frame * step(0.5, fract(pix_pos.yx / thickness / 4.));
|
||||
float fc = max(frame.x, frame.y);
|
||||
float fl = max(line.x , line.y );
|
||||
fl = mix(1, fl, fc);
|
||||
qgl_FragColor = vec4(vec3(fl), fc * 0.8 + 0.2);
|
||||
//qgl_FragColor = vec4(vec3(fl,0),1);
|
||||
}
|
||||
Reference in New Issue
Block a user