Methods
(static) createBlackAndWhiteStage() → {PostProcessStage}此階段有一個統一的值gradations
,用于縮放每個像素的亮度。
該階段具有以下結構:delta
,sigma
和stepSize
。
delta
和sigma
用于計算高斯濾波器的權重。 等式為exp((-0.5 * delta * delta) / (sigma * sigma))
。 delta
的默認值為1.0
。 sigma
的默認值為2.0
。 stepSize
是到下一個紋理像素的距離。 默認值為1.0
。
此階段有一個統一的值brightness
,用于縮放每個像素的飽和度。
景深模擬相機焦距。場景中處于焦點的對象將是清晰的,而未處于焦點的對象將是模糊的。
此階段有以下結構:focalDistance
、delta
、sigma
和stepSize
。
focalDistance
是從相機到設置相機焦點的距離(米)。
delta
、sigma
和stepSize
與PostProcessStageLibrary#createBlurStage
相同。模糊應用于不聚焦的區域。
將顏色寫入輸出紋理,其中alpha設置為1.0(在邊上)。
此階段有以下結構:color
和length
color
是突出顯示邊緣的顏色。默認值為Color#BLACK
。length
是邊緣的長度(像素)。默認為0.5
。
二維不支持此階段。
Example
// multiple silhouette effects
var yellowEdge = bmgl.PostProcessLibrary.createEdgeDetectionStage();
yellowEdge.uniforms.color = bmgl.Color.YELLOW;
yellowEdge.selected = [feature0];
var greenEdge = bmgl.PostProcessLibrary.createEdgeDetectionStage();
greenEdge.uniforms.color = bmgl.Color.LIME;
greenEdge.selected = [feature1];
// draw edges around feature0 and feature1
postProcessStages.add(bmgl.PostProcessLibrary.createSilhouetteEffect([yellowEdge, greenEdge]);
本階段有以下結構:dirtTexture
、starTexture
、intensity
、distortion
、ghostDispersal
、haloWidth
、dirtAmount
和earthRadius
。
dirtTexture
是為模擬鏡頭上的灰塵而采樣的紋理。starTexture
是為光斑的星型采樣的紋理。intensity
是一個標量乘以鏡頭光斑的結果。默認值為2.0
。distortion
是影響色彩效果失真的標量值。默認值為10.0
。ghostDispersal
是一個標量,指示光環效果距離紋理中心的距離。默認值為0.4
。haloWidth
是一個標量,表示來自重影分散的光暈寬度。默認值為0.4
。dirtAmount
是表示鏡頭上灰塵量的標量。默認值為0.4
。earthRadius
是地球的最大半徑。默認值為Ellipsoid.WGS84.maximumRadius
.
輪廓效果將邊緣檢測過程中的顏色與輸入顏色紋理合成。{9{
當edgeDetectionStages
為undefined
:color
和length
color
為突出顯示邊緣的顏色時,此階段有以下結構。默認值為Color#BLACK
。length
是邊緣的長度(像素)。默認值為0.5
。
此階段需要WebGL_深度_紋理擴展。
Parameters:
此階段需要WebGL_深度_紋理擴展。
Parameters:
此階段需要WebGL_深度_紋理擴展。
Parameters:
此階段需要WebGL_深度_紋理擴展。