Skip to content

TextureBlend

Narta Xaymar Dirks edited this page Nov 1, 2026 · 10 revisions
Blitz3D

TextureBlend

TextureBlend:Void texture:Int32, blend:Int32
Parameter Mode Type Default Description
texture In Int32 required The texture to change.
blend In Int32 required Blend mode from the table above.

Description

Chooses how this texture combines with what lies below it. A texture on layer 0 blends with the surface itself, a texture on layer 1 blends with layer 0, and so on up to layer 7. Layers are set with the index argument of EntityTexture or BrushTexture.

Blend Result
0 No blending.
1 Alpha: uses the alpha of the texture.
2 Multiply, the default.
3 Add.
4 Dot3 bump mapping.
5 Multiply twice as bright (x2).

Differences

  • Layers that have no texture or a blend of 0 are left out, and the layers after them move up, so the first of the others is blended with the surface like the original does. Dot3 on a layer after the first one is the dot product of the texture and what the layers before it made, which needs a GPU that can read the target while it draws to it (the ones that support Dither 2); other GPUs and a Graphics with AntiAlias multiply instead.

Examples

Graphics3D 320, 240, 0, 2
SetBuffer BackBuffer()
camera = CreateCamera()
CameraClsColor camera, 70, 100, 160
light = CreateLight()
RotateEntity light, 40, 30, 0

base = CreateTexture(64, 64, 1 + 4096)
SetBuffer TextureBuffer(base)
ClsColor 230, 200, 120
Cls
Color 160, 120, 40
For i = 0 To 63 Step 16
	Rect 0, i, 64, 8, 1
Next
over = CreateTexture(64, 64, 1 + 4096)
SetBuffer TextureBuffer(over)
ClsColor 60, 60, 60
Cls
Color 255, 255, 255
Oval 8, 8, 48, 48, 1
SetBuffer BackBuffer()
TextureBlend over, 3

cube = CreateCube() : PositionEntity cube, 0, 0, 4.4 : TurnEntity cube, 25, 35, 0
EntityTexture cube, base, 0, 0
EntityTexture cube, over, 0, 1
RenderWorld
Flip
WaitKey

Media

TextureBlend

Related Commands

TextureBuffer, TextureCoords, TextureFilter, TextureFrameDelay, TextureFrames, TextureHeight, TextureName, TextureReady 〔BlitzLLVM〕

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally