Blitz3D+ Command Reference

HWMultiTex enable

Parameters

enable - true to enable hardware multitexturing, false to disable; true (default)

Description

Enables or disables hardware multitexturing. A legacy command from the early 3D card era.

Multitexturing displays more than one texture layer on an object at once - a base texture plus a lightmap or detail map, applied with the index parameter of EntityTexture. Some early cards handled this in hardware; for buggy ones, this command let you force Blitz3D's software fallback, which drew duplicated geometry one texture at a time.

On the modern DirectX 12 renderer this command is accepted for compatibility but has no effect: multiple texture layers are always combined in hardware by the shader pipeline, and there is no software fallback to switch to. Existing code that calls HWMultiTex continues to run unchanged.

See also: EntityTexture, HWTexUnits, Dither.

Example

; HWMultiTex Example
; ------------------

Graphics3D 640,480,0,2
SetBuffer BackBuffer()

camera=CreateCamera()
PositionEntity camera,0,0,-4

light=CreateLight()
RotateEntity light,30,-30,0

; A crate with TWO texture layers - the logo multiplied over the mossy ground.
; Multitexturing is exactly what HWMultiTex controls.
crate=CreateCube()
tex1=LoadTexture("media/MossyGround.BMP")
tex2=LoadTexture("media/b3dlogo.jpg")
EntityTexture crate,tex1,0,0
EntityTexture crate,tex2,0,1

enable=1

While Not KeyDown(1)

    ; Space toggles the hardware multitexturing path
    If KeyHit(57) Then enable=1-enable

    ; True uses the graphics card's multitexture support; False falls back to
    ; Blitz3D's software technique. The crate should look the same either way -
    ; the switch exists for cards whose hardware multitexturing misbehaves.
    HWMultiTex enable

    TurnEntity crate,0.3,0.7,0.2

    RenderWorld

    Text 0,0,"Space: toggle hardware multitexturing   Esc: exit"
    If enable Then Text 0,20,"HWMultiTex True" Else Text 0,20,"HWMultiTex False"

    Flip

Wend

End

Index