Location renderer improvements #321
This commit is contained in:
parent
c6be08a903
commit
347c1d31bb
@ -7,8 +7,8 @@ uniform float u_scale;
|
|||||||
attribute vec2 a_pos;
|
attribute vec2 a_pos;
|
||||||
varying vec2 v_tex;
|
varying vec2 v_tex;
|
||||||
void main() {
|
void main() {
|
||||||
gl_Position = u_mvp * vec4(a_pos * u_scale * u_phase, 0.0, 1.0);
|
gl_Position = u_mvp * vec4(a_pos * u_scale * u_phase, 0.0, 1.0);
|
||||||
v_tex = a_pos;
|
v_tex = a_pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
$$
|
$$
|
||||||
@ -23,7 +23,7 @@ uniform vec2 u_dir;
|
|||||||
uniform int u_mode;
|
uniform int u_mode;
|
||||||
void main() {
|
void main() {
|
||||||
float len = 1.0 - length(v_tex);
|
float len = 1.0 - length(v_tex);
|
||||||
if (u_mode == 1) {
|
if (u_mode == -1) {
|
||||||
gl_FragColor = vec4(0.2, 0.2, 0.8, 1.0) * len;
|
gl_FragColor = vec4(0.2, 0.2, 0.8, 1.0) * len;
|
||||||
} else {
|
} else {
|
||||||
// outer ring
|
// outer ring
|
||||||
|
@ -7,8 +7,8 @@ uniform float u_scale;
|
|||||||
attribute vec2 a_pos;
|
attribute vec2 a_pos;
|
||||||
varying vec2 v_tex;
|
varying vec2 v_tex;
|
||||||
void main() {
|
void main() {
|
||||||
gl_Position = u_mvp * vec4(a_pos * u_scale * u_phase, 0.0, 1.0);
|
gl_Position = u_mvp * vec4(a_pos * u_scale * u_phase, 0.0, 1.0);
|
||||||
v_tex = a_pos;
|
v_tex = a_pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
$$
|
$$
|
||||||
@ -23,7 +23,7 @@ uniform vec2 u_dir;
|
|||||||
uniform int u_mode;
|
uniform int u_mode;
|
||||||
void main() {
|
void main() {
|
||||||
float len = 1.0 - length(v_tex);
|
float len = 1.0 - length(v_tex);
|
||||||
if (u_mode == 1) {
|
if (u_mode == -1) {
|
||||||
gl_FragColor = vec4(0.2, 0.2, 0.8, 1.0) * len;
|
gl_FragColor = vec4(0.2, 0.2, 0.8, 1.0) * len;
|
||||||
} else {
|
} else {
|
||||||
// outer ring
|
// outer ring
|
||||||
|
@ -7,8 +7,8 @@ uniform float u_scale;
|
|||||||
attribute vec2 a_pos;
|
attribute vec2 a_pos;
|
||||||
varying vec2 v_tex;
|
varying vec2 v_tex;
|
||||||
void main() {
|
void main() {
|
||||||
gl_Position = u_mvp * vec4(a_pos * u_scale * u_phase, 0.0, 1.0);
|
gl_Position = u_mvp * vec4(a_pos * u_scale * u_phase, 0.0, 1.0);
|
||||||
v_tex = a_pos;
|
v_tex = a_pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
$$
|
$$
|
||||||
@ -23,7 +23,7 @@ uniform vec2 u_dir;
|
|||||||
uniform int u_mode;
|
uniform int u_mode;
|
||||||
void main() {
|
void main() {
|
||||||
float len = 1.0 - length(v_tex);
|
float len = 1.0 - length(v_tex);
|
||||||
if (u_mode == 1) {
|
if (u_mode == -1) {
|
||||||
gl_FragColor = vec4(0.2, 0.2, 0.8, 1.0) * len;
|
gl_FragColor = vec4(0.2, 0.2, 0.8, 1.0) * len;
|
||||||
} else {
|
} else {
|
||||||
// outer ring
|
// outer ring
|
||||||
|
@ -234,11 +234,13 @@ public class LocationRenderer extends LayerRenderer {
|
|||||||
gl.uniform2f(hDirection,
|
gl.uniform2f(hDirection,
|
||||||
(float) Math.cos(Math.toRadians(rotation)),
|
(float) Math.cos(Math.toRadians(rotation)),
|
||||||
(float) Math.sin(Math.toRadians(rotation)));
|
(float) Math.sin(Math.toRadians(rotation)));
|
||||||
gl.uniform1i(uMode, 3); // With bearing
|
gl.uniform1i(uMode, 1); // With bearing
|
||||||
} else
|
} else {
|
||||||
gl.uniform1i(uMode, 2); // Without bearing
|
gl.uniform2f(hDirection, 0, 0);
|
||||||
|
gl.uniform1i(uMode, 0); // Without bearing
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
gl.uniform1i(uMode, 1); // Outside screen
|
gl.uniform1i(uMode, -1); // Outside screen
|
||||||
|
|
||||||
gl.drawArrays(GL.TRIANGLE_STRIP, 0, 4);
|
gl.drawArrays(GL.TRIANGLE_STRIP, 0, 4);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user