@graspologic/renderer-glsl
Advanced tools
Comparing version
@@ -0,0 +0,0 @@ module.exports = `#version 300 es |
@@ -38,4 +38,2 @@ module.exports = `#version 300 es | ||
varying float vOnScreen; | ||
void main() { | ||
@@ -68,37 +66,11 @@ picking_setPickingColor(aPickingColor); | ||
vColor.a = aSaturation; | ||
// float f = 1.0 - aSaturation; | ||
// float L = (0.3 * vColor.r + 0.6 * vColor.g + 0.1 * vColor.b); | ||
// L += (1.0 - L) * 0.5; | ||
// vColor.r += f * (L - vColor.r); | ||
// vColor.g += f * (L - vColor.g); | ||
// vColor.b += f * (L - vColor.b); | ||
vColor.a = aSaturation * vColor.a; | ||
/* calculate the center of the node with respect to the screen (-1, -1) to (1, 1) */ | ||
vec4 center = uProjection * uModelView * vec4(position, 1.0); | ||
vec2 center2D = center.xy / center.w; | ||
#ifdef SHOW_FILTERED_OUT_NODES | ||
/* calculate the current vertex with respect to the screen (-1, -1) to (1, 1) */ | ||
vec2 vertex2D = gl_Position.xy / gl_Position.w; | ||
/* half the offset between the center to the vertex */ | ||
vec2 offset = (vertex2D - center2D) * 0.5; | ||
/* axis lengths to the center */ | ||
vec2 lengths = abs(offset); | ||
/* calculate the center of the quadrant defined by the center and this vertex */ | ||
vec2 quadCenter = center2D + offset; | ||
/* check if the quadrant defined by the center and this vertex overlaps with the screen */ | ||
vOnScreen = | ||
step(0.0, center.w) * // the center is in front of the screen AND | ||
step(quadCenter.x - lengths.x, 1.0) * // left side of the quad is less than the right side of the screen AND | ||
step(-1.0, quadCenter.x + lengths.x) * // left side of the screen is less than the right side of the quad AND | ||
step(quadCenter.y - lengths.y, 1.0) * // bottom side of the quad is less than the top side of the screen AND | ||
step(-1.0, quadCenter.y + lengths.y); // bottom side of the screen is less than the top side of the quad | ||
#ifdef ALPHA_MODE | ||
// This one hides nodes that are fully saturated | ||
float saturationScale = 1.0 - step(1.0, aSaturation); | ||
#else | ||
// This one hides nodes that aren't fully saturated | ||
float saturationScale = step(1.0, aSaturation); | ||
@@ -105,0 +77,0 @@ #endif |
@@ -0,0 +0,0 @@ export default `#version 300 es |
@@ -38,4 +38,2 @@ export default `#version 300 es | ||
varying float vOnScreen; | ||
void main() { | ||
@@ -68,37 +66,11 @@ picking_setPickingColor(aPickingColor); | ||
vColor.a = aSaturation; | ||
// float f = 1.0 - aSaturation; | ||
// float L = (0.3 * vColor.r + 0.6 * vColor.g + 0.1 * vColor.b); | ||
// L += (1.0 - L) * 0.5; | ||
// vColor.r += f * (L - vColor.r); | ||
// vColor.g += f * (L - vColor.g); | ||
// vColor.b += f * (L - vColor.b); | ||
vColor.a = aSaturation * vColor.a; | ||
/* calculate the center of the node with respect to the screen (-1, -1) to (1, 1) */ | ||
vec4 center = uProjection * uModelView * vec4(position, 1.0); | ||
vec2 center2D = center.xy / center.w; | ||
#ifdef SHOW_FILTERED_OUT_NODES | ||
/* calculate the current vertex with respect to the screen (-1, -1) to (1, 1) */ | ||
vec2 vertex2D = gl_Position.xy / gl_Position.w; | ||
/* half the offset between the center to the vertex */ | ||
vec2 offset = (vertex2D - center2D) * 0.5; | ||
/* axis lengths to the center */ | ||
vec2 lengths = abs(offset); | ||
/* calculate the center of the quadrant defined by the center and this vertex */ | ||
vec2 quadCenter = center2D + offset; | ||
/* check if the quadrant defined by the center and this vertex overlaps with the screen */ | ||
vOnScreen = | ||
step(0.0, center.w) * // the center is in front of the screen AND | ||
step(quadCenter.x - lengths.x, 1.0) * // left side of the quad is less than the right side of the screen AND | ||
step(-1.0, quadCenter.x + lengths.x) * // left side of the screen is less than the right side of the quad AND | ||
step(quadCenter.y - lengths.y, 1.0) * // bottom side of the quad is less than the top side of the screen AND | ||
step(-1.0, quadCenter.y + lengths.y); // bottom side of the screen is less than the top side of the quad | ||
#ifdef ALPHA_MODE | ||
// This one hides nodes that are fully saturated | ||
float saturationScale = 1.0 - step(1.0, aSaturation); | ||
#else | ||
// This one hides nodes that aren't fully saturated | ||
float saturationScale = step(1.0, aSaturation); | ||
@@ -105,0 +77,0 @@ #endif |
{ | ||
"name": "@graspologic/renderer-glsl", | ||
"version": "0.7.0-7", | ||
"version": "0.7.0-8", | ||
"description": "Graph data visualization core renderer (GLSL Code)", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
42237
-9.43%843
-5.17%