radial: configurable offsets (#73)
* Add: Offset radial visualizer (config) * Add: Offset radial visualizer
This commit is contained in:
@@ -27,6 +27,10 @@
|
|||||||
the background. */
|
the background. */
|
||||||
#define BAR_ALIAS_FACTOR 1.2
|
#define BAR_ALIAS_FACTOR 1.2
|
||||||
#define C_ALIAS_FACTOR 1.8
|
#define C_ALIAS_FACTOR 1.8
|
||||||
|
/* Offset (Y) of the visualization */
|
||||||
|
#define CENTER_OFFSET_Y 0
|
||||||
|
/* Offset (X) of the visualization */
|
||||||
|
#define CENTER_OFFSET_X 0
|
||||||
|
|
||||||
/* Gravity step, overrude frin `smooth_parameters.glsl` */
|
/* Gravity step, overrude frin `smooth_parameters.glsl` */
|
||||||
#request setgravitystep 5.0
|
#request setgravitystep 5.0
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ void main() {
|
|||||||
Alpha layer blending is only applied when `xroot` transparency is enabled. */
|
Alpha layer blending is only applied when `xroot` transparency is enabled. */
|
||||||
|
|
||||||
float /* translate (x, y) to use (0, 0) as the center of the screen */
|
float /* translate (x, y) to use (0, 0) as the center of the screen */
|
||||||
dx = gl_FragCoord.x - (screen.x / 2),
|
dx = gl_FragCoord.x - (screen.x / 2) + CENTER_OFFSET_X,
|
||||||
dy = gl_FragCoord.y - (screen.y / 2);
|
dy = gl_FragCoord.y - (screen.y / 2) + CENTER_OFFSET_Y;
|
||||||
float theta = atan(dy, dx); /* fragment angle with the center of the screen as the origin */
|
float theta = atan(dy, dx); /* fragment angle with the center of the screen as the origin */
|
||||||
float d = sqrt((dx * dx) + (dy * dy)); /* distance */
|
float d = sqrt((dx * dx) + (dy * dy)); /* distance */
|
||||||
if (d > C_RADIUS - (float(C_LINE) / 2.0F) && d < C_RADIUS + (float(C_LINE) / 2.0F)) {
|
if (d > C_RADIUS - (float(C_LINE) / 2.0F) && d < C_RADIUS + (float(C_LINE) / 2.0F)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user