Skip to content

Carlosted/wgpu-virtual-texturing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WGPU Virtual Texturing

This is an experimental project which aims at making a Virtual Texturing System with the wgpu library in rust.

TODO's

  • Look into texture compression (Probably going to use astc)
  • Make page table texture (RGBA8Uint is a good bet)

What is Virtual Texturing?

Virtual Texturing tries to solve the issue of sampling massive textures on the GPU. Nowadays, game worlds are huge, and require a ton of texture data. Game developers can solve this issue by using repetitive textures where possible (e.g. repetitive bump maps), which lowers the memory cost on the gpu. This means that artists can't use their full potential to create game objects, because they need to respect GPU constraints. Virtual Texturing solves this issue by making use of partially resident textures (akin to Virtual Memory). This is best represented by the following image: Virtual Texturing Basic Idea

As can be seen, the "virtual" texture is only partly uploaded to the GPU and that part constitutes the "physical" texture.

Terminology

  • Virtual texture: The big texture which texture coordinates point to. The texture that can't be/isn't loaded all at once on the GPU.
  • Physical texture: A texture built every frame that lives on the GPU. It is the required part of the virtual texture.
  • Page table: An indirection table that maps texture coordinates from the virtual texture to the physical texture.

Texture Streaming

Texture streaming is needed to load parts of the virtual texture from the disk to be stored on the GPU.

Tradeoffs:

  • Textures are stored with padding, to avoid padding calculation each load.
  • Texture Texels are stored as Rgba8UnormSrgb

Sources

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published