Last change
on this file since 82 was 2, checked in by Dmitry A. Kuminov, 16 years ago |
Initially imported qt-all-opensource-src-4.5.1 from Trolltech.
|
File size:
680 bytes
|
Line | |
---|
1 | #include "ellipse_functions.glsl"
|
---|
2 |
|
---|
3 | uniform sampler1D palette;
|
---|
4 | uniform vec2 fmp;
|
---|
5 | uniform float fmp2_m_radius2;
|
---|
6 | uniform vec4 inv_matrix;
|
---|
7 | uniform vec2 inv_matrix_offset;
|
---|
8 |
|
---|
9 | void main()
|
---|
10 | {
|
---|
11 | // float2 A = frag_coord.xy;//mul(inv_matrix, frag_coord.xy) + inv_matrix_offset;
|
---|
12 | mat2 mat;
|
---|
13 | mat[0][0] = inv_matrix.x;
|
---|
14 | mat[0][1] = inv_matrix.y;
|
---|
15 | mat[1][0] = inv_matrix.z;
|
---|
16 | mat[1][1] = inv_matrix.w;
|
---|
17 | vec2 A = gl_FragCoord.xy * mat + inv_matrix_offset;
|
---|
18 | vec2 B = fmp;
|
---|
19 | float a = fmp2_m_radius2;
|
---|
20 | float b = 2.0*dot(A, B);
|
---|
21 | float c = -dot(A, A);
|
---|
22 | float val = (-b + sqrt(b*b - 4.0*a*c)) / (2.0*a);
|
---|
23 | gl_FragColor = texture1D(palette, val) * ellipse_aa();
|
---|
24 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.