{"action":"created","issue":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/11349","repository_url":"https://api.github.com/repos/mrdoob/three.js","labels_url":"https://api.github.com/repos/mrdoob/three.js/issues/11349/labels{/name}","comments_url":"https://api.github.com/repos/mrdoob/three.js/issues/11349/comments","events_url":"https://api.github.com/repos/mrdoob/three.js/issues/11349/events","html_url":"https://github.com/mrdoob/three.js/pull/11349","id":229180510,"number":11349,"title":"Added linewidth support","user":{"login":"WestLangley","id":1000017,"avatar_url":"https://avatars2.githubusercontent.com/u/1000017?v=4","gravatar_id":"","url":"https://api.github.com/users/WestLangley","html_url":"https://github.com/WestLangley","followers_url":"https://api.github.com/users/WestLangley/followers","following_url":"https://api.github.com/users/WestLangley/following{/other_user}","gists_url":"https://api.github.com/users/WestLangley/gists{/gist_id}","starred_url":"https://api.github.com/users/WestLangley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WestLangley/subscriptions","organizations_url":"https://api.github.com/users/WestLangley/orgs","repos_url":"https://api.github.com/users/WestLangley/repos","events_url":"https://api.github.com/users/WestLangley/events{/privacy}","received_events_url":"https://api.github.com/users/WestLangley/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/mrdoob/three.js/milestones/2","html_url":"https://github.com/mrdoob/three.js/milestone/2","labels_url":"https://api.github.com/repos/mrdoob/three.js/milestones/2/labels","id":3040751,"number":2,"title":"r91","description":"","creator":{"login":"mrdoob","id":97088,"avatar_url":"https://avatars0.githubusercontent.com/u/97088?v=4","gravatar_id":"","url":"https://api.github.com/users/mrdoob","html_url":"https://github.com/mrdoob","followers_url":"https://api.github.com/users/mrdoob/followers","following_url":"https://api.github.com/users/mrdoob/following{/other_user}","gists_url":"https://api.github.com/users/mrdoob/gists{/gist_id}","starred_url":"https://api.github.com/users/mrdoob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrdoob/subscriptions","organizations_url":"https://api.github.com/users/mrdoob/orgs","repos_url":"https://api.github.com/users/mrdoob/repos","events_url":"https://api.github.com/users/mrdoob/events{/privacy}","received_events_url":"https://api.github.com/users/mrdoob/received_events","type":"User","site_admin":false},"open_issues":40,"closed_issues":93,"state":"open","created_at":"2018-01-17T00:14:43Z","updated_at":"2018-03-02T20:57:51Z","due_on":"2018-03-01T08:00:00Z","closed_at":null},"comments":49,"created_at":"2017-05-16T21:55:32Z","updated_at":"2018-03-02T21:38:58Z","closed_at":"2018-03-02T20:57:51Z","author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/mrdoob/three.js/pulls/11349","html_url":"https://github.com/mrdoob/three.js/pull/11349","diff_url":"https://github.com/mrdoob/three.js/pull/11349.diff","patch_url":"https://github.com/mrdoob/three.js/pull/11349.patch"},"body":"This PR adds support for \"fat\" lines. The lines are rendered using instancing, and line segments are rendered in screen space with rounded ends.\r\n\r\n`LineSegmentsGeometry` is a new class which extends `InstancedBufferGeometry`. \r\n\r\nRegardless of the complexity of the line, only 6 faces are pushed to the GPU. The additional data pushed to the GPU is an array of start-end xyz-pairs -- similar to how line segments are specified currently. Instancing makes implementation straight-forward.\r\n\r\n`LineMaterial` is also added. It renders lines in screen-space. The relevant parameter is `lineWidth`, which is specified in _pixels_. A rendered line segment looks like this.\r\n\r\n![screen-space line segment](https://cloud.githubusercontent.com/assets/1000017/26129762/960b4b7c-3a5f-11e7-84e7-2b06d435104b.png)\r\n\r\nThe difficult part in implementing `LineMaterial` was getting the screen-space rendering correct. But once this was done, segments chain together quite nicely.\r\n\r\nI did not implement perspective size attenuation. With that feature, lines close to the camera can be as wide as the screen, and they look terrible. IMHO, `linewidth` should be specified in pixels -- not in world units -- so perspective size attenuation does not make sense.\r\n\r\nLine-joins are round. I think this is preferable to mitering the line-joins; miters are problematic when line segments are nearly parallel.\r\n\r\nI have stubbed out several new classes. We can see if they make sense. Due to name conflicts, I added \"2\" to some of the names for now. This entire API is up for debate.\r\n\r\nNew classes:\r\n```\r\nTHREE.LineSegments2 // extends Mesh\r\nTHREE.Line2\t    // extends LineSegments2\r\nTHREE.Wireframe     // extends LineSegments2\r\n```\r\nNew geometries:\r\n```\r\nTHREE.LineSegmentsGeometry // extends InstancedBufferGeometry\r\nTHREE.LineGeometry         // extends LineSegmentsGeometry\r\nTHREE.WireframeGeometry2   // extends LineSegmentsGeometry\r\n```\r\nNew material:\r\n```\r\nTHREE.LineMaterial // extends ShaderMaterial\r\n```\r\n`THREE.LineMaterial` has not been \"wired-in\" as a built-in material yet.\r\n\r\n![fat line](https://cloud.githubusercontent.com/assets/1000017/26129941/7a78a584-3a60-11e7-86b4-b2776c5c16bd.png)\r\n\r\nIn the demo, I have added an inset viewport to study the effects of the `resolution` parameter and the effects of antialiasing.\r\n\r\n---\r\n\r\nedit: live demo removed\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mrdoob/three.js/issues/comments/370060164","html_url":"https://github.com/mrdoob/three.js/pull/11349#issuecomment-370060164","issue_url":"https://api.github.com/repos/mrdoob/three.js/issues/11349","id":370060164,"user":{"login":"mrdoob","id":97088,"avatar_url":"https://avatars0.githubusercontent.com/u/97088?v=4","gravatar_id":"","url":"https://api.github.com/users/mrdoob","html_url":"https://github.com/mrdoob","followers_url":"https://api.github.com/users/mrdoob/followers","following_url":"https://api.github.com/users/mrdoob/following{/other_user}","gists_url":"https://api.github.com/users/mrdoob/gists{/gist_id}","starred_url":"https://api.github.com/users/mrdoob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrdoob/subscriptions","organizations_url":"https://api.github.com/users/mrdoob/orgs","repos_url":"https://api.github.com/users/mrdoob/repos","events_url":"https://api.github.com/users/mrdoob/events{/privacy}","received_events_url":"https://api.github.com/users/mrdoob/received_events","type":"User","site_admin":false},"created_at":"2018-03-02T21:38:58Z","updated_at":"2018-03-02T21:38:58Z","author_association":"OWNER","body":"@WestLangley Okay, I'll take a look during r92 👌"}}
{"actor":{"display_login":"mrdoob"}}