|
@@ -274,7 +274,7 @@ ShaderLib[ 'line' ] = {
|
|
|
offset *= lineWidth;
|
|
|
|
|
|
// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...
|
|
|
- offset /= resolution.y * devicePixelRatio;
|
|
|
+ offset /= resolution.y; //* devicePixelRatio;
|
|
|
|
|
|
// select end
|
|
|
vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;
|
|
@@ -860,7 +860,7 @@ class LineMaterial extends ShaderMaterial {
|
|
|
this.events = {
|
|
|
setSize:(e)=>{//如果出现横条状的异常,往往是viewportOffset出错 //地图不需要
|
|
|
let viewport = e.viewport
|
|
|
- this.uniforms.resolution.value.copy(viewport.resolution)
|
|
|
+ this.uniforms.resolution.value.copy(viewport.resolution2)
|
|
|
this.uniforms.devicePixelRatio.value = window.devicePixelRatio
|
|
|
this.lineWidth = this.lineWidth_ //update
|
|
|
if(!this.useDepth || !e.viewport.camera.isPerspectiveCamera || !e.viewport)return
|