Direct3D 8 - Pixel Shader - Instructions - texbem

Last edited 2026-02-20


The tex applies texture coordinate distortion based on vertex data from another texture


The texbem syntax looks like this:

texbem x, y;


x: This is the target texture register (e.g., t1) where the texture sample will be sent after distortion.

y: This is source register containing bump map data.


This instruction may not work properly!

Example code:


texture T_Image;

texture T_Background;


technique tech_main

{

    pass P0

    {

        Texture[0] = <T_Image>;

        Texture[2] = <T_Background>;

        PixelShader = asm

        {

            ps.1.1;


            tex t0;                         // <- Load the T_Image texture

            texbem t1, t0;                  // <- Apply a fake bump from T_Image and assign to T_Background texture register


            mov r0, t1;                     // <- Assign the result

        };

    }

}


This example requires the following in the .XML file:
  • Flag <dx8>yes</dx8>
  • Flag <BackgroundTexture>1</BackgroundTexture>


(More information about .XML files can be found here)

Details table:

Type

Instruction

Description

Instruction slots

ps.1.0

ps.1.1

ps.1.2

ps.1.3

ps.1.4

Note

asm

texbem

Apply a fake bump environment-map transform

1

Yes

Yes

Yes

Yes

No

(Possibly a broken instruction) Assigns a texture with a fake dump transformation applied based on another texture register to the register.

Created with the Personal Edition of HelpNDoc: Full-featured EPub generator