Giter Club home page Giter Club logo

wgpu-virtual-texturing's Introduction

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

wgpu-virtual-texturing's People

Contributors

carloskiki avatar

Stargazers

Kotomine Shiki avatar  avatar Maé-Li Doyon avatar David Huculak avatar  avatar Mauro Gentile avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.