gl-draw 0.15.21 → 0.15.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/WebGPULineSegments2.js +12 -11
- package/dist/WebGPULineSegments2.module.js +173 -166
- package/dist/core/Pencil.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/index.module.js +427 -332
- package/dist/objects/line/meshLine/MeshLineMaterial.d.ts +2 -0
- package/dist/objects/line/meshLine/fragment.d.ts +1 -1
- package/dist/objects/line/meshLine/vertex.d.ts +1 -1
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/index.module.js +10 -10
- package/dist/utils/Timer.d.ts +72 -0
- package/package.json +1 -1
|
@@ -64,6 +64,8 @@ export declare class MeshLineMaterial extends ShaderMaterial {
|
|
|
64
64
|
set color(value: ColorRepresentation);
|
|
65
65
|
get opacity(): number;
|
|
66
66
|
set opacity(value: number);
|
|
67
|
+
get alphaTest(): number;
|
|
68
|
+
set alphaTest(value: number);
|
|
67
69
|
get map(): Texture | null;
|
|
68
70
|
set map(value: Texture | null);
|
|
69
71
|
get repeat(): Vector2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const fragmentShader
|
|
1
|
+
export declare const fragmentShader = "\n #include <fog_pars_fragment>\n #include <logdepthbuf_pars_fragment>\n\nuniform float useDash;\nuniform float dashArray;\nuniform float dashOffset;\nuniform float dashRatio;\nuniform sampler2D alphaMap;\nuniform float useAlphaMap;\n\nvarying vec2 vUV;\nvarying vec4 vColor;\nvarying float vCounters;\n\nuniform sampler2D map;\nuniform float useMap;\nuniform vec2 repeat;\nuniform float offsetLoop;\nuniform float alphaTest;\n\n\n\nvoid main()\t{\n\t#include <logdepthbuf_fragment>\n\n\tvec4 c = vColor;\n\n\tif( useMap == 1. ) c *= texture2D( map, vUV * repeat );\n\tif( useAlphaMap == 1. ) c.a *= texture2D( alphaMap, vUV * repeat ).r;\n\tif(offsetLoop!=1.0){\n if(vUV.x>1.0 || vUV.x<0.0){\n c.a = 0.0;\n }\n }\n if (c.a < alphaTest) discard;\n\tif( useDash == 1. ){\n\t\t\tc.a *= ceil(mod(vCounters + dashOffset, dashArray) - (dashArray * dashRatio));\n\t}\n\tgl_FragColor = c;\n \t#include <fog_fragment>\n #include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}\n";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const vertexShader
|
|
1
|
+
export declare const vertexShader = "\n #include <common>\n #include <logdepthbuf_pars_vertex>\n #include <fog_pars_vertex>\n\n attribute vec3 previous;\n attribute vec3 next;\n attribute float side;\n attribute float width;\n attribute float counters;\n\n uniform vec2 resolution;\n uniform float lineWidth;\n uniform vec3 color;\n uniform float opacity;\n uniform float sizeAttenuation;\n uniform float scaleDown;\n uniform vec2 offset;\n\n varying vec2 vUV;\n varying vec4 vColor;\n varying float vCounters;\n\n vec2 intoScreen(vec4 i) {\n return resolution * (0.5 * i.xy / i.w + 0.5);\n }\n\n void main() {\n float aspect = resolution.y / resolution.x;\n\n mat4 m = projectionMatrix * modelViewMatrix;\n\n vec4 currentClip = m * vec4( position, 1.0 );\n vec4 prevClip = m * vec4( previous, 1.0 );\n vec4 nextClip = m * vec4( next, 1.0 );\n\n vec4 currentNormed = currentClip / currentClip.w;\n vec4 prevNormed = prevClip / prevClip.w;\n vec4 nextNormed = nextClip / nextClip.w;\n\n vec2 currentScreen = intoScreen(currentNormed);\n vec2 prevScreen = intoScreen(prevNormed);\n vec2 nextScreen = intoScreen(nextNormed);\n\n float actualWidth = lineWidth * width;\n\n vec2 dir;\n if(nextScreen == currentScreen) {\n dir = normalize( currentScreen - prevScreen );\n } else if(prevScreen == currentScreen) {\n dir = normalize( nextScreen - currentScreen );\n } else {\n vec2 inDir = currentScreen - prevScreen;\n vec2 outDir = nextScreen - currentScreen;\n vec2 fullDir = nextScreen - prevScreen;\n\n if(length(fullDir) > 0.0) {\n dir = normalize(fullDir);\n } else if(length(inDir) > 0.0){\n dir = normalize(inDir);\n } else {\n dir = normalize(outDir);\n }\n }\n\n vec2 normal = vec2(-dir.y, dir.x);\n\n if(sizeAttenuation != 0.0) {\n normal /= currentClip.w;\n normal *= min(resolution.x, resolution.y);\n }\n\n if (scaleDown > 0.0) {\n float dist = length(nextNormed - prevNormed);\n normal *= smoothstep(0.0, scaleDown, dist);\n }\n\n vec2 offsetInScreen = actualWidth * normal * side * 0.5;\n\n vec2 withOffsetScreen = currentScreen + offsetInScreen;\n vec3 withOffsetNormed = vec3((2.0 * withOffsetScreen/resolution - 1.0), currentNormed.z);\n\n vCounters = counters;\n vColor = vec4( color, opacity );\n vUV = uv;\n vUV=uv+offset;\n\n gl_Position = currentClip.w * vec4(withOffsetNormed, 1.0);\n\n #include <logdepthbuf_vertex>\n #include <fog_vertex>\n }\n";
|