Texture State

From Burnout Wiki
Revision as of 02:09, 21 September 2023 by Burninrubber0 (talk | contribs) (Created page.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
TextureState
aka RwTextureState
No Example
Resource names Unknown
Type ID 0xE
Category Generic
Memory
distribution
Main Memory only
Imports Texture
Imported by Material
Editor
available?
No
Hmmm...
Hmmm...
To do:
Write a description.

Structures

renderengine::TextureState

PlayStation 3

Offset Length Type Name Description Comments
0x0 0x1C SamplerState Base class
0x1C 0x4 Texture texture Texture Imported resource

Xbox 360

Offset Length Type Name Description Comments
0x0 0x1C SamplerState Base class
0x20 0x4 Texture texture Texture Imported resource

PC

Offset Length Type Name Description Comments
0x0 0x3C SamplerState Base class
0x3C 0x4 Texture texture Texture Imported resource

PC (Remastered)

Offset Length Type Name Description Comments
0x0 0x38 SamplerState Base class
0x38 0x4 Texture texture Texture Imported resource

PlayStation 4, Switch

Offset Length Type Name Description Comments
0x0 0x40 SamplerState Base class
0x20 0x4 Texture texture Texture Imported resource

renderengine::SamplerState

PlayStation 3

Offset Length Type Name Description Comments
0x0 0x4 uint32_t m_color
0x4 0x4 uint32_t m_enable
0x8 0x2 uint16_t m_minLod
0xA 0x2 uint16_t m_maxLod
0xC 0x1 uint8_t m_maxAniso
0xD 0x1 uint8_t m_wrapS
0xE 0x1 uint8_t m_wrapT
0xF 0x1 uint8_t m_wrapR
0x10 0x1 uint8_t m_uRemap
0x11 0x1 uint8_t m_zFunc
0x12 0x1 uint8_t m_gamma
0x14 0x2 uint16_t m_bias
0x16 0x1 uint8_t m_min
0x17 0x1 uint8_t m_mag
0x18 0x1 uint8_t m_convolution
0x19 0x3 Padding

Xbox 360

Hmmm...
Hmmm...
To do:
Requires research. Likely related to D3DSAMPLERSTATETYPE from the SDK.
Offset Length Type Name Description Comments
0x0 0x4 float ? Mipmap LOD Bias
0x4 0x1C ? ? TODO

PC

Offset Length Type Name Description Comments
0x0 0x4 D3DTEXTUREADDRESS ? U Addressing Mode
0x4 0x4 D3DTEXTUREADDRESS ? V Addressing Mode
0x8 0x4 D3DTEXTUREADDRESS ? W Addressing Mode
0xC 0x4 D3DTEXTUREFILTERTYPE ? Magnification Filter
0x10 0x4 D3DTEXTUREFILTERTYPE ? Minification Filter
0x14 0x4 D3DTEXTUREFILTERTYPE ? Mipmap Filter
0x18 0x4 uint32_t ? Max Mipmap Level
0x1C 0x4 uint32_t ? Max Anisotropy
0x20 0x4 float ? Mipmap LOD Bias
0x24 0x4 D3DCOLOR ? Border Color
0x28 0x4 ? ? Game doesn't access these members
0x2C 0x4 ? ?
0x30 0x4 ? ?
0x34 0x4 ? ?
0x38 0x4 ? ?

PC (Remastered)

Offset Length Type Name Description Comments
0x0 0x4 D3D11_TEXTURE_ADDRESS_MODE ? Address mode U
0x4 0x4 D3D11_TEXTURE_ADDRESS_MODE ? Address mode V
0x8 0x4 D3D11_TEXTURE_ADDRESS_MODE ? Address mode W
0xC 0x4 D3D11_FILTER_TYPE ? Magnification filter if any filter is set to 2, game uses anisotropic filtering
0x10 0x4 D3D11_FILTER_TYPE ? Minification filter
0x14 0x4 D3D11_FILTER_TYPE ? Mipmap filter
0x18 0x4 float ? Minimum LOD
0x1C 0x4 float ? Maximum LOD
0x20 0x4 uint32_t ? Maximum anisotropy
0x24 0x4 float ? Mipmap LOD bias
0x28 0x4 D3D11_COMPARISON_FUNC ? Comparsion function If set to -1, D3D11_COMPARISON_ALWAYS used
0x2C 0x1 bool ? White border color Set to black if false
0x2D 0x3 ? Padding
0x30 0x4 uint32_t ? Reference count Initially set to 1
Decremented by each call to Release on the interface
0x34 0x4 ID3D11SamplerState* ? Sampler state interface Set at runtime

PlayStation 4, Switch

Offset Length Type Name Description Comments
0x0 0x4 D3D11_TEXTURE_ADDRESS_MODE ? Address mode U
0x4 0x4 D3D11_TEXTURE_ADDRESS_MODE ? Address mode V
0x8 0x4 D3D11_TEXTURE_ADDRESS_MODE ? Address mode W
0xC 0x4 D3D11_FILTER_TYPE ? Magnification filter if any filter is set to 2, game uses anisotropic filtering
0x10 0x4 D3D11_FILTER_TYPE ? Minification filter
0x14 0x4 D3D11_FILTER_TYPE ? Mipmap filter
0x18 0x4 float ? Minimum LOD
0x1C 0x4 float ? Maximum LOD
0x20 0x4 uint32_t ? Maximum anisotropy
0x24 0x4 float ? Mipmap LOD bias
0x28 0x4 D3D11_COMPARISON_FUNC ? Comparsion function If set to -1, D3D11_COMPARISON_ALWAYS used
0x2C 0x1 bool ? White border color Set to black if false
0x2D 0x3 ? Padding
0x30 0x4 uint32_t ? Reference count Initially set to 1
Decremented by each call to Release on the interface
0x34 0x4 ? Padding
0x38 0x8 ID3D11SamplerState* ? Sampler state interface Set at runtime

Typedefs

D3DCOLOR

From the Microsoft Learn page.

Name Type Length Comments
D3DCOLOR DWORD 0x4 A four byte value that typically represents the alpha, red, green, and blue components of a color. It can also represent luminance and brightness.

Enumerations

D3DTEXTUREADDRESS

From the Microsoft Learn page.

Name Value Comments
D3DTADDRESS_WRAP 1 Tile the texture at every integer junction. For example, for u values between 0 and 3, the texture is repeated three times; no mirroring is performed.
D3DTADDRESS_MIRROR 2 Similar to D3DTADDRESS_WRAP, except that the texture is flipped at every integer junction. For u values between 0 and 1, for example, the texture is addressed normally; between 1 and 2, the texture is flipped (mirrored); between 2 and 3, the texture is normal again; and so on.
D3DTADDRESS_CLAMP 3 Texture coordinates outside the range [0.0, 1.0] are set to the texture color at 0.0 or 1.0, respectively.
D3DTADDRESS_BORDER 4 Texture coordinates outside the range [0.0, 1.0] are set to the border color.
D3DTADDRESS_MIRRORONCE 5 Similar to D3DTADDRESS_MIRROR and D3DTADDRESS_CLAMP. Takes the absolute value of the texture coordinate (thus, mirroring around 0), and then clamps to the maximum value. The most common usage is for volume textures, where support for the full D3DTADDRESS_MIRRORONCE texture-addressing mode is not necessary, but the data is symmetric around the one axis.
D3DTADDRESS_FORCE_DWORD 0x7FFFFFFF Forces this enumeration to compile to 32 bits in size. Without this value, some compilers would allow this enumeration to compile to a size other than 32 bits. This value is not used.

D3DTEXTUREFILTERTYPE

From the Microsoft Learn page.

Name Value Comments
D3DTEXF_NONE 0 When used with D3DSAMP_MIPFILTER, disables mipmapping.
D3DTEXF_POINT 1 When used with D3DSAMP_MAGFILTER or D3DSAMP_MINFILTER, specifies that point filtering is to be used as the texture magnification or minification filter respectively. When used with D3DSAMP_MIPFILTER, enables mipmapping and specifies that the rasterizer chooses the color from the texel of the nearest mip level.
D3DTEXF_LINEAR 2 When used with D3DSAMP_MAGFILTER or D3DSAMP_MINFILTER, specifies that linear filtering is to be used as the texture magnification or minification filter respectively. When used with D3DSAMP_MIPFILTER, enables mipmapping and trilinear filtering; it specifies that the rasterizer interpolates between the two nearest mip levels.
D3DTEXF_ANISOTROPIC 3 When used with D3DSAMP_MAGFILTER or D3DSAMP_MINFILTER, specifies that anisotropic texture filtering used as a texture magnification or minification filter respectively. Compensates for distortion caused by the difference in angle between the texture polygon and the plane of the screen. Use with D3DSAMP_MIPFILTER is undefined.
D3DTEXF_PYRAMIDALQUAD 6 A 4-sample tent filter used as a texture magnification or minification filter. Use with D3DSAMP_MIPFILTER is undefined.
D3DTEXF_GAUSSIANQUAD 7 A 4-sample Gaussian filter used as a texture magnification or minification filter. Use with D3DSAMP_MIPFILTER is undefined.
D3DTEXF_CONVOLUTIONMONO 8 Convolution filter for monochrome textures. See D3DFMT_A1. This flag is available in Direct3D 9Ex only. Use with D3DSAMP_MIPFILTER is undefined.
D3DTEXF_FORCE_DWORD 0x7FFFFFFF Forces this enumeration to compile to 32 bits in size. Without this value, some compilers would allow this enumeration to compile to a size other than 32 bits. This value is not used.

D3D11_TEXTURE_ADDRESS_MODE

From the Microsoft Learn page.

Name Value Comments
D3D11_TEXTURE_ADDRESS_WRAP 1 Tile the texture at every (u,v) integer junction. For example, for u values between 0 and 3, the texture is repeated three times.
D3D11_TEXTURE_ADDRESS_MIRROR 2 Flip the texture at every (u,v) integer junction. For u values between 0 and 1, for example, the texture is addressed normally; between 1 and 2, the texture is flipped (mirrored); between 2 and 3, the texture is normal again; and so on.
D3D11_TEXTURE_ADDRESS_CLAMP 3 Texture coordinates outside the range [0.0, 1.0] are set to the texture color at 0.0 or 1.0, respectively.
D3D11_TEXTURE_ADDRESS_BORDER 4 Texture coordinates outside the range [0.0, 1.0] are set to the border color specified in D3D11_SAMPLER_DESC or HLSL code.
D3D11_TEXTURE_ADDRESS_MIRROR_ONCE 5 Similar to D3D11_TEXTURE_ADDRESS_MIRROR and D3D11_TEXTURE_ADDRESS_CLAMP. Takes the absolute value of the texture coordinate (thus, mirroring around 0), and then clamps to the maximum value.

D3D11_FILTER_TYPE

From the Microsoft Learn page.

Name Value Comments
D3D11_FILTER_TYPE_POINT 0 Point filtering used as a texture magnification or minification filter. The texel with coordinates nearest to the desired pixel value is used. The texture filter to be used between mipmap levels is nearest-point mipmap filtering. The rasterizer uses the color from the texel of the nearest mipmap texture.
D3D11_FILTER_TYPE_LINEAR 1 Bilinear interpolation filtering used as a texture magnification or minification filter. A weighted average of a 2 x 2 area of texels surrounding the desired pixel is used. The texture filter to use between mipmap levels is trilinear mipmap interpolation. The rasterizer linearly interpolates pixel color, using the texels of the two nearest mipmap textures.

D3D11_COMPARISON_FUNC

From the Microsoft Learn page.

Name Value Comments
D3D11_COMPARISON_NEVER 1 Never pass the comparison.
D3D11_COMPARISON_LESS 2 If the source data is less than the destination data, the comparison passes.
D3D11_COMPARISON_EQUAL 3 If the source data is equal to the destination data, the comparison passes.
D3D11_COMPARISON_LESS_EQUAL 4 If the source data is less than or equal to the destination data, the comparison passes.
D3D11_COMPARISON_GREATER 5 If the source data is greater than the destination data, the comparison passes.
D3D11_COMPARISON_NOT_EQUAL 6 If the source data is not equal to the destination data, the comparison passes.
D3D11_COMPARISON_GREATER_EQUAL 7 If the source data is greater than or equal to the destination data, the comparison passes.
D3D11_COMPARISON_ALWAYS 8 Always pass the comparison.