Browse Source

add globe filterColor

tags/2.10.0
Caven Chen 3 years ago
parent
commit
5b2c5c2599
1 changed files with 10 additions and 0 deletions
  1. 10
    0
      modules/option/ViewerOption.js

+ 10
- 0
modules/option/ViewerOption.js View File

@@ -130,6 +130,16 @@ class ViewerOption {
globeOption?.translucency?.frontFaceAlphaByDistance
})

if (globeOption?.filterColor) {
let filterColor = globeOption?.filterColor
let globeFS = globe._surfaceShaderSet.baseFragmentShaderSource
let oriShder = globeFS.sources[globeFS.sources.length - 1]
globeFS.sources[globeFS.sources.length - 1] = oriShder.replace(
'gl_FragColor = finalColor;',
`gl_FragColor = finalColor * vec4(${filterColor.red},${filterColor.green},${filterColor.blue},${filterColor.alpha});`
)
}

return this
}


Loading…
Cancel
Save