How to use the RGBA_S3TC_DXT3_Format function from three

Find comprehensive JavaScript three.RGBA_S3TC_DXT3_Format code examples handpicked from public code repositorys.

three.RGBA_S3TC_DXT3_Format is a constant that represents the compressed texture format for RGBA color data with S3TC DXT3 compression in the Three.js library.

115
116
117
118
119
120
121
122
123
124
    blockBytes = 8;
    dds.format = three_1.RGB_S3TC_DXT1_Format;
    break;
case FOURCC_DXT3:
    blockBytes = 16;
    dds.format = three_1.RGBA_S3TC_DXT3_Format;
    break;
case FOURCC_DXT5:
    blockBytes = 16;
    dds.format = three_1.RGBA_S3TC_DXT5_Format;
fork icon1
star icon3
watch icon0

+ 8 other calls in file

159
160
161
162
163
164
165
166
167
  break;

case FOURCC_DXT3:
  
  blockBytes = 16;
  dds.format = THREE.RGBA_S3TC_DXT3_Format;
  break;

case FOURCC_DXT5:
fork icon0
star icon3
watch icon0

+ 3 other calls in file

How does three.RGBA_S3TC_DXT3_Format work?

three.RGBA_S3TC_DXT3_Format is a constant representing the RGBA S3TC DXT3 compressed texture format used in the Three.js library, which is a widely used library for creating 3D graphics and animations in the browser. It is used to specify the texture format when creating textures that use this format, allowing the renderer to properly decode the texture data and display it on the screen. The format uses 4 channels for each texel (texture element) and employs a lossy compression algorithm to reduce the amount of data required to represent the texture.

120
121
122
123
124
125
126
127
128
129
  dds.format = _three.RGB_S3TC_DXT1_Format;
  break;

case FOURCC_DXT3:
  blockBytes = 16;
  dds.format = _three.RGBA_S3TC_DXT3_Format;
  break;

case FOURCC_DXT5:
  blockBytes = 16;
fork icon0
star icon1
watch icon1

+ 12 other calls in file

Ai Example

1
2
3
const textureLoader = new THREE.TextureLoader();
const texture = textureLoader.load("path/to/texture.png");
texture.format = THREE.RGBA_S3TC_DXT3_Format;

In this example, we create a new TextureLoader object and use it to load a texture file. We then set the format property of the resulting texture object to THREE.RGBA_S3TC_DXT3_Format to specify that the texture is in this format.

Other functions in three

Sorted by popularity

function icon

three.Vector3 is the most popular function in three (22341 examples)