Ver código fonte

add globe filterColor

tags/2.10.0
Caven Chen 3 anos atrás
pai
commit
5b2c5c2599
1 arquivos alterados com 10 adições e 0 exclusões
  1. 10
    0
      modules/option/ViewerOption.js

+ 10
- 0
modules/option/ViewerOption.js Ver arquivo

@@ -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
}


Carregando…
Cancelar
Salvar