Appearance
composer
Composer
Kind: global class
- Composer
- new Composer(opts)
- .enableComposer(enable)
- .enableGammaCorrect(enable)
- .enableSaoPass(enable)
- .enableOutlinePass(enable)
- .enableSsrPass(enable, radius, position)
- .setSsrEnabled(enable)
- .setSsrDistance(maxDistance)
- .setSsrThickness(thickness)
- .enableUnrealBloomPass(unrealBloomEnabled, bloomRadius, bloomStrength, bloomThreshold)
- .setBloomPassEnabled(unrealBloomEnabled)
- .setBloomPassRadius(bloomRadius)
- .setBloomPassThreshold(bloomThreshold)
- .setBloomPassStrength(bloomStrength)
- .enableSsaoPass(ssaoEnabled, ssaoRadius, ssaoMinDistance, ssaoMaxDistance)
- .setSSAOEnabled(ssaoEnabled)
- .setSSAORadius(ssaoRadius)
- .setSsaoMaxDistance(ssaoMaxDistance)
- .setSsaoMinDistance(ssaoMinDistance)
- .enableDofPass(dofEnabled, dofFocus, dofAperture, dofMaxblur)
- .setDofEnabled(dofEnabled)
- .setDofFocus(dofFocus)
- .setDofAperture(dofAperture)
- .setDofMaxblur(dofMaxblur)
- .enableSmaaPass(enable)
- .enableLUTPass(lutEnabled, lutIntensity, lutType, lutUrl)
- .setlutEnabled(lutEnabled)
- .setLutIntensity(lutIntensity)
- .setLutType(lutType)
- .enableDistortPass(enabled, intensity)
- .setDistortPassEnabled(enabled, lutEnabled)
- .seDistortPassIntensity(intensity, lutIntensity)
- .enableEdgeBlurPass(enabled, intensity, radius)
- .setEdgeBlurEnabled(enabled)
- .setEdgeBlurRadius(radius)
- .setEdgeBlurIntensity(intensity)
- .enableMsaa(msaaEnabled, samples)
- .setPostProcessing(opts)
new Composer(opts)
后期处理类
Param | Type | Description |
---|---|---|
opts | object | 后处理参数 |
opts.ssrEnabled | boolean | 是否开启环境反射 |
opts.ssrDistance | number | 环境反射距离 |
opts.ssrThickness | number | 环境反射强度 |
opts.ssaoEnabled | boolean | 全局阴影 |
opts.ssaoRadius | number | 全局投影半径 |
opts.ssaoMinDistance | number | 全局投影最小距离 |
opts.ssaoMaxDistance | number | 全局投影最大距离 |
opts.dofEnabled | boolean | 是否开启景深模糊 |
opts.dofFocus | number | 景深焦距 |
opts.dofAperture | number | 景深孔径 |
opts.dofMaxblur | number | 景深最大模糊程度 |
opts.unrealBloomEnabled | boolean | 是否开启泛光 |
opts.bloomRadius | number | 泛光半径 |
opts.bloomStrength | number | 泛光强度 |
opts.bloomThreshold | number | 泛光线性衰减程度 |
opts.lutEnabled | boolean | 是否开启 |
opts.lutIntensity | number | lut 强度 |
opts.lutType | number | lut 滤镜类型 |
opts.lutUrl | string | lut 滤镜素材地址 |
opts.outlineEnabled | boolean | 是否泛光 |
opts.gammaEnabled | boolean | 是否开启颜色校正 |
opts.smaaEnabled | boolean | 是否开启 smaa 抗锯齿 |
opts.distortEnabled | boolean | 是否开启色差 |
opts.distortIntensity | number | 色差强度 |
opts.fxaaEnabled | boolean | 是否开启 fxaa 抗锯齿 |
opts.msaaEnabled | boolean | 是否开启 msaa 抗锯齿 |
opts.samples | boolean | msaa 的重采样次数 |
composer.enableComposer(enable)
是否开启后处理效果合成器
Kind: instance method of Composer
Param | Type | Description |
---|---|---|
enable | boolean | 是否开启 |
composer.enableGammaCorrect(enable)
是否开启颜色校正
Kind: instance method of Composer
Param | Type |
---|---|
enable | * |
composer.enableSaoPass(enable)
sao 开关
Kind: instance method of Composer
Param | Type |
---|---|
enable | boolean |
composer.enableOutlinePass(enable)
是否开启外轮廓高亮
Kind: instance method of Composer
Param | Type |
---|---|
enable | boolean |
composer.enableSsrPass(enable, radius, position)
镜面反射开关
Kind: instance method of Composer
Param | Type | Description |
---|---|---|
enable | boolean | 是否开启镜面反射 |
radius | number | 反射直径 |
position | Array | 反射平面位置 |
composer.setSsrEnabled(enable)
设置全局镜面反射开关
Kind: instance method of Composer
Param | Type | Description |
---|---|---|
enable | boolean | - 是否开启 |
composer.setSsrDistance(maxDistance)
镜面反射距离
Kind: instance method of Composer
Param | Type | Description |
---|---|---|
maxDistance | number | 距离 |
composer.setSsrThickness(thickness)
镜面反射强度
Kind: instance method of Composer
Param | Type | Description |
---|---|---|
thickness | number | 强度 |
composer.enableUnrealBloomPass(unrealBloomEnabled, bloomRadius, bloomStrength, bloomThreshold)
开启泛光
Kind: instance method of Composer
Param | Type | Description |
---|---|---|
unrealBloomEnabled | boolean | 是否开启泛光 |
bloomRadius | number | 泛光半径 |
bloomStrength | number | 泛光强度 |
bloomThreshold | number | 泛光线性衰减程度 |
composer.setBloomPassEnabled(unrealBloomEnabled)
是否开启泛光
Kind: instance method of Composer
Param | Type | Description |
---|---|---|
unrealBloomEnabled | boolean | 是否开启 |
composer.setBloomPassRadius(bloomRadius)
设置泛光半径
Kind: instance method of Composer
Param | Type | Description |
---|---|---|
bloomRadius | number | 泛光半径 |
composer.setBloomPassThreshold(bloomThreshold)
设置泛光线性衰减程度
Kind: instance method of Composer
Param | Type | Description |
---|---|---|
bloomThreshold | number | 泛光线性衰减程度 |
composer.setBloomPassStrength(bloomStrength)
设置泛光强度
Kind: instance method of Composer
Param | Type | Description |
---|---|---|
bloomStrength | number | 泛光强度 |
composer.enableSsaoPass(ssaoEnabled, ssaoRadius, ssaoMinDistance, ssaoMaxDistance)
全局投影是否开启
Kind: instance method of Composer
Param | Type | Default | Description |
---|---|---|---|
ssaoEnabled | boolean | 全局投影开关 | |
ssaoRadius | number | 12.32 | 全局投影半径 |
ssaoMinDistance | number | 0.001 | 全局投影最小距离 |
ssaoMaxDistance | number | 0.3 | 全局投影最大距离 |
composer.setSSAOEnabled(ssaoEnabled)
设置全局阴影是否开启
Kind: instance method of Composer
Param | Type | Description |
---|---|---|
ssaoEnabled | boolean | 全局阴影是否开启 |
composer.setSSAORadius(ssaoRadius)
设置全局投影半径
Kind: instance method of Composer
Param | Type | Description |
---|---|---|
ssaoRadius | number | 全局阴影半径 |
composer.setSsaoMaxDistance(ssaoMaxDistance)
设置全局投影最大距离
Kind: instance method of Composer
Param | Type | Description |
---|---|---|
ssaoMaxDistance | number | 全局投影最大距离 |
composer.setSsaoMinDistance(ssaoMinDistance)
设置全局投影最小距离
Kind: instance method of Composer
Param | Type | Description |
---|---|---|
ssaoMinDistance | number | 全局投影最小距离 |
composer.enableDofPass(dofEnabled, dofFocus, dofAperture, dofMaxblur)
是否开启景深模糊
Kind: instance method of Composer
Param | Type | Description |
---|---|---|
dofEnabled | boolean | 景深开关 |
dofFocus | number | 景深焦距 |
dofAperture | number | 景深孔径 |
dofMaxblur | number | 景深最大模糊程度 |
composer.setDofEnabled(dofEnabled)
设置是否开启景深
Kind: instance method of Composer
Param | Type | Description |
---|---|---|
dofEnabled | boolean | 景深开关 |
composer.setDofFocus(dofFocus)
设置景深孔径
Kind: instance method of Composer
Param | Type | Description |
---|---|---|
dofFocus | number | 景深孔径 |
composer.setDofAperture(dofAperture)
设置景深焦距
Kind: instance method of Composer
Param | Type | Description |
---|---|---|
dofAperture | number | 景深焦距 |
composer.setDofMaxblur(dofMaxblur)
设置景深最大模糊程度
Kind: instance method of Composer
Param | Type | Description |
---|---|---|
dofMaxblur | number | 景深最大模糊程度 |
composer.enableSmaaPass(enable)
是否开启 smaa 抗锯齿
Kind: instance method of Composer
Param | Type |
---|---|
enable | boolean |
composer.enableLUTPass(lutEnabled, lutIntensity, lutType, lutUrl)
lut 滤镜
Kind: instance method of Composer
Param | Type | Default | Description |
---|---|---|---|
lutEnabled | boolean | 是否开启 | |
lutIntensity | number | 1 | lut 强度 |
lutType | number | Lenox 340 | lut 滤镜类型 |
lutUrl | string | lut 滤镜素材地址 |
composer.setlutEnabled(lutEnabled)
是否开启 lut 滤镜
Kind: instance method of Composer
Param | Type | Description |
---|---|---|
lutEnabled | boolean | 是否开启 |
composer.setLutIntensity(lutIntensity)
设置 lut 滤镜
Kind: instance method of Composer
Param | Type | Description |
---|---|---|
lutIntensity | number | lut 滤镜强度 |
composer.setLutType(lutType)
设置 lut 滤镜类型
Kind: instance method of Composer
Param | Type | Description |
---|---|---|
lutType | string | lut 滤镜类型 |
composer.enableDistortPass(enabled, intensity)
设置色差
Kind: instance method of Composer
Param | Type |
---|---|
enabled | boolean |
intensity | number |
composer.setDistortPassEnabled(enabled, lutEnabled)
是否开启色差
Kind: instance method of Composer
Param | Type | Description |
---|---|---|
enabled | ||
lutEnabled | boolean | 是否开启 |
composer.seDistortPassIntensity(intensity, lutIntensity)
设置色差强度
Kind: instance method of Composer
Param | Type | Description |
---|---|---|
intensity | ||
lutIntensity | number | 强度 |
composer.enableEdgeBlurPass(enabled, intensity, radius)
是否开启边角模糊
Kind: instance method of Composer
Param | Type | Description |
---|---|---|
enabled | boolean | 是否开启 |
intensity | number | 强度 |
radius | number | 半径 |
composer.setEdgeBlurEnabled(enabled)
设置边角模糊是否开启
Kind: instance method of Composer
Param | Type | Description |
---|---|---|
enabled | boolean | 是否开启 |
composer.setEdgeBlurRadius(radius)
设置边角模糊半径
Kind: instance method of Composer
Param | Type | Description |
---|---|---|
radius | number | 半径 |
composer.setEdgeBlurIntensity(intensity)
设置边角模糊强度
Kind: instance method of Composer
Param | Type | Description |
---|---|---|
intensity | number | 强度 |
composer.enableMsaa(msaaEnabled, samples)
是否开启 msaa 抗锯齿
Kind: instance method of Composer
Param | Default | Description |
---|---|---|
msaaEnabled | 是否开启 | |
samples | 4 | 重采样次数 |
composer.setPostProcessing(opts)
设置后处理参数
Kind: instance method of Composer
Param | Type | Description |
---|---|---|
opts | object | 后处理参数 |
opts.ssrEnabled | boolean | 是否开启镜面反射 |
opts.ssrPosition | Array | 镜面坐标数组 |
opts.ssrRadius | number | 镜面反射范围 |
opts.ssrDistance | number | 镜面反射距离 |
opts.ssrThickness | number | 镜面反射强度 |
opts.ssaoEnabled | boolean | 全局阴影 |
opts.ssaoRadius | number | 全局投影半径 |
opts.ssaoMinDistance | number | 全局投影最小距离 |
opts.ssaoMaxDistance | number | 全局投影最大距离 |
opts.dofEnabled | boolean | 是否开启景深模糊 |
opts.dofFocus | number | 景深焦距 |
opts.dofAperture | number | 景深孔径 |
opts.dofMaxblur | number | 景深最大模糊程度 |
opts.unrealBloomEnabled | boolean | 是否开启泛光 |
opts.bloomRadius | number | 泛光半径 |
opts.bloomStrength | number | 泛光强度 |
opts.bloomThreshold | number | 泛光线性衰减程度 |
opts.lutEnabled | boolean | 是否开启 |
opts.lutIntensity | number | lut 强度 |
opts.lutType | number | lut 滤镜类型 |
opts.lutUrl | string | lut 滤镜素材地址 |
opts.outlineEnabled | boolean | 是否泛光 |
opts.gammaEnabled | boolean | 是否开启颜色校正 |
opts.smaaEnabled | boolean | 是否开启 smaa 抗锯齿 |
opts.distortIntensity | number | 色差强度 |
opts.fxaaEnabled | boolean | 是否开启 fxaa 抗锯齿 |
opts.msaaEnabled | boolean | 是否开启 msaa 抗锯齿 |
opts.samples | boolean | msaa 的重采样次数 |