{"id":20430770,"url":"https://github.com/whitestormjs/whs-component-glowline","last_synced_at":"2026-02-03T12:09:41.377Z","repository":{"id":126476117,"uuid":"74512402","full_name":"WhitestormJS/whs-component-glowline","owner":"WhitestormJS","description":"Glow effect for lines in 3d. [Component]","archived":false,"fork":false,"pushed_at":"2016-11-25T21:23:54.000Z","size":639,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-26T14:50:31.022Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://whsjs.io/whs-component-glowline/examples/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WhitestormJS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-11-22T20:55:31.000Z","updated_at":"2021-09-17T12:31:57.000Z","dependencies_parsed_at":"2023-06-25T21:09:38.704Z","dependency_job_id":null,"html_url":"https://github.com/WhitestormJS/whs-component-glowline","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhitestormJS%2Fwhs-component-glowline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhitestormJS%2Fwhs-component-glowline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhitestormJS%2Fwhs-component-glowline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WhitestormJS%2Fwhs-component-glowline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WhitestormJS","download_url":"https://codeload.github.com/WhitestormJS/whs-component-glowline/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248630823,"owners_count":21136516,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T08:08:58.818Z","updated_at":"2026-02-03T12:09:41.312Z","avatar_url":"https://github.com/WhitestormJS.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WHS.GlowLine\n\n[![NPM](https://nodei.co/npm/whs-component-glowline.png)](https://nodei.co/npm/whs-component-glowline/)\n\n| Type | Physics? | WHS Version |\n|------|----------|-------------|\n| Component | No  | ^1.1.14     |\n\n\n## Usage\n\n```javascript\nconst glowline = new WHS.GlowLine({\n  geometry: {\n    radius: 0.1,\n    delta: 0.2,\n    curveDetail: 64,\n    curve: new THREE.CubicBezierCurve3(\n      new THREE.Vector3( -10, 0, 0 ),\n      new THREE.Vector3( -5, 15, 0 ),\n      new THREE.Vector3( 20, 15, 0 ),\n      new THREE.Vector3( 10, 0, 0 )\n    )\n  },\n\n  glow: {\n    normalIntensity: 70,\n    cameraIntensity: 0\n  }\n});\n\nglowline.addTo(world);\n```\n\n## Options\n\n### .geometry {...}\n\n- **curve** - `THREE.Curve` instance. Used to create tube. _Default is `new THREE.LineCurve(new THREE.Vector3(0, 0, 0), new THREE.Vector3(0, 10, 0))`. \n- **curveDetail** - `tubularSegments` of Tube geometry. _Default is **20**_\n- **arcDetail** - `radiusSegments` of Tube geometry. _Default is **32**_\n- **radius** - Tube (line) radius. _Default is **2**_\n- **delta** - Glow shadow radius difference compared to tube. _Default is **1**_\n\n### .glow {...}\n\n- **normalIntensity** - Intensity of normal calculations in glow shader. _Default is **70**_\n- **cameraIntensity** - Sensibility of glow to camera position. The closer camera is - the bigger glow will be. _Default is **0**_\n- **margin** - Glow margin. (Used in algorythm to calculate glow). _Default is **0**_\n- **pow** - Glow pow. (Used in algorythm to calculate glow). _Default is **2**_\n- **color** - Glow color. _Default is **0xff0000**_\n\n### .material {...}\n\n**!!! Currently, only basic material is supported.**\n\n- **color** - Color of the tube. _Default is **0xff0000**_\n\n## The algorythm (part)\n\nThe following code is a part of fragmentShader code of glowTube object.\n\n```glsl\n\nvoid main() {\n  float intensity = \n    pow(glowMargin - dot(vNormal1, vec3(0.0, 0.0, 1.0)), glowPow) * normalIntensity\n    + pow(glowMargin - dot(vNormal2, vec3(0.0, 0.0, 1.0)), glowPow) * (1.00 - normalIntensity);\n\n  gl_FragColor = vec4(color, 1.0) * intensity;\n}\n\n```\n\n- **glowMargin** = glow.margin\n- **glowPow** = glow.pow\n- **normalIntensity** = glow.normalIntensity\n- **vNormal1** - static normal.\n- **vNormal2** - dynamic normal (changes with camera position).\n\n## Properties\n\n- **.native** - Three.js mesh of tube.\n- **.glow** - Three.js mesh of glow. (Also is children of a tube)\n\n## Demo (click on image)\n\n[![](https://d1zjcuqflbd5k.cloudfront.net/files/acc_533906/cx2a?response-content-disposition=inline;%20filename=Shot%2011222016-11%3A20.png\u0026Expires=1479849937\u0026Signature=dxaEF7EDW8lxvh8ddVYuOI8Eq-7zRKcmLCWqZq1DuLQSZ1I0PRkzW-1lNQ9ymq6DnN50a57PsHynTK4-~ZaNrmKz0vAQMNsw2ZXNODpy33G0BcVjKFEBi5gxf2lRk66pRnQ1mN2gF3eDZikMe-F8UBVG8DUjz9M0ZCUATA1P9XY_\u0026Key-Pair-Id=APKAJTEIOJM3LSMN33SA)](http://whsjs.io/whs-component-glowline/examples/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhitestormjs%2Fwhs-component-glowline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhitestormjs%2Fwhs-component-glowline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhitestormjs%2Fwhs-component-glowline/lists"}