Skip to content

This library provides wgpu-rs compute shaders for compressing rgba floating-point textures into BC6H compressed textures.

Notifications You must be signed in to change notification settings

expenses/wgpu-bc6h-compression

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wgpu-bc6h-compression

This library provides wgpu-rs compute shaders for compressing rgba floating-point textures into BC6H compressed textures, reducing their size by 16x. These shaders were adapted from the ones provided by GPURealTimeBC6H.

For more information, see the presentation Real-Time BC6H Compression on GPU.

Offline compression

For a slower but higher quality offline BC6H compression library, I hightly recommend intel-tex-rs-2.

Example

For a example, run:

cargo run --example compress_dds examples/lightmap.dds examples/compressed.dds

This will take an existing Rgba32Float DirectDraw Surface file and compress it into a Bc6hRgbUFloat texture. Both files can be opened just by dragging them into RenderDoc.

Features

  • Requires no wgpu::Features, not even wgpu::Features::TEXTURE_COMPRESSION_BC if you simply copy the buffer to a file as in the example.
  • Can use push constants instead of allocating a uniform buffer with the push_constant feature.
  • Can compress 2D and 3D textures.

Unsupported

  • The shaders are designed with unsigned floating point values in mind, so Bc6hRgbUFloat textures are supported but not signed Bc6hRgbSFloat ones.

About

This library provides wgpu-rs compute shaders for compressing rgba floating-point textures into BC6H compressed textures.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published