Editor.Assets.BlendMode
EnumThe blendmode of a Editor.Assets.PassInfo.
Index
Enumeration Members
- Add
- AddLegacy
- AlphaTest
- AlphaToCoverage
- Average
- Bright
- Color
- ColorBurn
- ColorDodge
- ColoredGlass
- Custom
- Darken
- Diff
- Disabled
- Division
- Exclusion
- Forgray
- Glass
- HardGlow
- HardLight
- HardMix
- HardPhoenix
- HardReflect
- Hue
- Intense
- Lighten
- LinearLight
- Luminosity
- Max
- Min
- Multiply
- MultiplyLegacy
- Negation
- Normal
- NotBright
- Overlay
- PinLight
- PremultipliedAlpha
- PremultipliedAlphaAuto
- Realistic
- Saturation
- Screen
- SoftLight
- Subtract
- VividLight
Example
const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
const assetManager = model.project.assetManager;
// Find a Material and configure its blend mode
const materials = assetManager.assets.filter(a => a.isOfType('Material')) as Editor.Assets.Material[];
if (materials.length === 0) {
console.log('No materials in project');
return;
}
const mat = materials[0];
const passes = mat.passInfos;
if (passes.length > 0) {
const pass = passes[0];
// Set to normal alpha blending
pass.blendMode = Editor.Assets.BlendMode.Normal;
// Switch to additive blending
pass.blendMode = Editor.Assets.BlendMode.Add;
console.log(`Material "${mat.name}" pass 0 blendMode: Add (${pass.blendMode})`);
}
Enumeration Members
Add
Add:
number
Adds colors together, brightening the result.
AddLegacy
AddLegacy:
number
Legacy additive blend mode.
AlphaTest
AlphaTest:
number
Binary alpha testing without blending.
AlphaToCoverage
AlphaToCoverage:
number
Converts alpha to coverage for anti-aliasing.
Average
Average:
number
Averages color values.
Bright
Bright:
number
Brightens based on blend color.
Color
Color:
number
Blends using hue and saturation of blend color.
ColorBurn
ColorBurn:
number
Darkens by increasing contrast.
ColorDodge
ColorDodge:
number
Lightens by decreasing contrast.
ColoredGlass
ColoredGlass:
number
Colored glass transparency effect.
Custom
Custom:
number
Custom blend mode.
Darken
Darken:
number
Selects darker colors only.
Diff
Diff:
number
Subtracts colors to show differences.
Disabled
Disabled:
number
No blending applied.
Division
Division:
number
Divides base by blend color.
Exclusion
Exclusion:
number
Similar to difference with lower contrast.
Forgray
Forgray:
number
For grayscale blending.
Glass
Glass:
number
Glass-like transparency effect.
HardGlow
HardGlow:
number
Hard glow effect.
HardLight
HardLight:
number
Hard overlay effect.
HardMix
HardMix:
number
Posterizes to primary colors.
HardPhoenix
HardPhoenix:
number
Hard phoenix effect.
HardReflect
HardReflect:
number
Hard reflection effect.
Hue
Hue:
number
Blends using hue of blend color.
Intense
Intense:
number
Intensifies colors.
Lighten
Lighten:
number
Selects lighter colors only.
LinearLight
LinearLight:
number
Linear version of vivid light.
Luminosity
Luminosity:
number
Blends using luminosity of blend color.
Max
Max:
number
Selects maximum color channel values.
Min
Min:
number
Selects minimum color channel values.
Multiply
Multiply:
number
Multiplies colors, darkening the result.
MultiplyLegacy
MultiplyLegacy:
number
Legacy multiply blend mode.
Negation
Negation:
number
Inverted difference blend.
Normal
Normal:
number
Standard alpha blending.
NotBright
NotBright:
number
Inverse of bright mode.
Overlay
Overlay:
number
Combines multiply and screen based on color.
PinLight
PinLight:
number
Pins colors to lighten or darken based on blend.
PremultipliedAlpha
PremultipliedAlpha:
number
Blends with premultiplied alpha.
PremultipliedAlphaAuto
PremultipliedAlphaAuto:
number
Auto-converted premultiplied alpha blending.
Realistic
Realistic:
number
Physically-based realistic blending.
Saturation
Saturation:
number
Blends using saturation of blend color.
Screen
Screen:
number
Inverts multiply, brightening overall.
SoftLight
SoftLight:
number
Soft overlay effect.
Subtract
Subtract:
number
Subtracts blend color from base.
VividLight
VividLight:
number
Intense contrast between lighten and darken.