Legacy:Color Blending

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to navigation Jump to search

Color blending modes (or rendering modes) specify how the color of an individual texture pixel is merged with the color of the corresponding background pixel it is going to be drawn on.

Color Blending Modes

Graphics are not drawn.
Every pixel is 100% opaque. If you #EXEC IMPORT it with FLAGS=2, then every pixel that uses the first entry in the pallette will be 100% transparent and the rest will be 100% opaque.
The first pixel in the palette is 100% transparent; all others are 100% opaque.
There is a utility called "Bright" distributed by Epic, that helps with this. It has a command line option "-pinkmask" that makes all pink pixels (R=255, G=0, B=255) transparent, and all others opaque.
In UT2003 this will only work with 8bit textures.
The brightness of the color determines it's opacity. i.e.
  • white is 100% opaque
  • a middle bright colour such as grey or medium yellow is partially transparent
  • black is 100% translucent
This doesn't work well in some configurations (possibly MacOS + Glide) unless the #EXEC IMPORT also has FLAGS=2. If you plan to draw STY_Translucent, always use FLAGS=2.
Multiplies the destination pixels by the source if the source is darker than 127,127,127. Screens the destination pixels if the source is brighter than 127,127,127. (like the Photoshop "Overlay" mode). This results in:
  • color 0,0,0 = darken whatever is behind it
  • color 127,127,127 = no change
  • color 255, 255, 255 = brighten whatever is behind it

Additional modes in new engine versions (e.g. UT2003)

Uses an alpha channel to determine the translucency of the texture's pixels.
Adds the color in the source pixels to the background. A red pixel painted onto a blue background will result in a purple pixel being shown. Additive differs from translucent in that translucent actors will can stack up on the screen and become more opaque, where additive actors will not. For example, if you had 100 red translucent clouds in a row, they would stack up and you would see just red if you looked through all of them at once. If it were additive clouds, they would add their red to the background but stop adding when the red was maxed out (R=255) so you could still see what was behind.
This is essentially the same as additive, but the source pixels color is subtracted from the background. This is not that useful of a drawtype, but it does have a strong application in making smoke (bluish-white particles set to subtractive make a nice brownish-black color.)
Only used for Emitters. This causes the Emitter to draw its particles.
what does this do?

Opaque is the opposite of translucent; you can't see through something opaque. If it's 75% opaque (or 25% translucent), it's slightly transparent; you can see through it a slightly. 0% opaque is 100% translucent; it's invisible and not drawn.

#EXEC IMPORT with FLAGS=2 is the same as having the texture property flag bTranslucent set within Ued/2. This makes first colour in the palette 100% transparent.


These rendering modes can apply to:


In UnrealScript, set Canvas.Style.


For Actors, use Display -> Style


Declared as an enum in the Actor class.


<uscript> // Style for rendering sprites, meshes.

var(Display) enum ERenderStyle {


} Style; </uscript>


<uscript> // Style for rendering sprites, meshes. var(Display) enum ERenderStyle { STY_None, STY_Normal, STY_Masked, STY_Translucent, STY_Modulated, STY_Alpha, STY_Additive, STY_Subtractive, STY_Particle, STY_AlphaZ, } Style; </uscript>

Related Topics