|
|
This guide shows how to develop a shader for procedural marble. The ideas
are illustrated step by step, so you may find inspirations for other types
of material shaders as well.
Procedural textures can easily scale in size without repeating anywhere
or showing tiling artifacts. However, you need to pay attention to aliasing
issues, which regular textures handle by mipmapping.
Procedural Marble in GLSL.
|
Generic vertex attributes are massively useful for for passing arbitrary
information to the GPU, offloading processing work to the graphics card.
Tangent vectors allow for accelerated bump map or displacement shading,
models may be rendered in false colors to show physical properties like
pressure or tension, particle speeds, etc.
This guide shows how to use generic attributes and organise data to
gain performance.
Generic vertex attributes
|
|
|
Partially resident textures (aka sparse textures) allow to
allocate virtual memory for textures without immediately committing
the entire memory in one chunk. Instead, pages of texels can be swapped
into GPU memory on demand.
This guide shows the basic technique using the initial AMD extension
and how it is used in tinySG to
create textures or arbitrary size (MegaTextures).
Partially resident textures
|
The OpenGL architecture review board has taken the initial, AMD specific
extension and released an ARB, cross-vendor version.
This guide explains how to use the ARB version of partially resident
textures and explains differences wrt the former AMD implementation.
Partially resident textures - reloaded
|
|
|
OpenGL indexed data supports just one shared index for all vertex attributes.
Although easy to handle and fast to render, it causes some geometry to
duplicate vertices in order to have different normals at the same position
(i.e. for cube corners).
tinySG uses indexed data only on the host side and avoids it on
the GPU almost entirely. When uploading data to the GPU, tinySG unrolls
indexed data and stores attributes in an interleaved array. Read more on
tinySG index management.
|
This guide explains how to convert a polygon scene into a voxel texture.
The technique may be useful for i.e. shadow calculations - a shader may
sample the 3D texture multiple times to find occluders. tinySG's CFD
module tinyFluids uses the technique to divide 3D space in
fluid obstacles and empty space for calculating flow.
Render to 3D Texture
|
|
|
The asset import library assimp is an open-source, cross platform
dataset loader with little to no external dependencies. Integration
into 3D applications is very easy, all that needs to be done is to
traverse the data structures returned by assimp and translate them into
the applications scene graph.
This guide explains how it is done.
Assimp loader
|
Instanced Rendering is a way to render a vast amount of geometry
with very few API calls and state changes. Thus, it is well suited
to tune performance.
This guide gives code examples on instanced rendering and shows some
use cases that you may not have in mind, yet.
Instanced Rendering
|
|
|
An x-ray effect is amazingly simple to create using standard OpenGL
blending. It produces nice images and, like real x-rays, provides
a quick insight in a model's complexity.
tinySG's scene editor implements an x-ray mode that basically
disables rendering of shader- and material nodes, so all geometry in
a scene is rendered with the x-ray blending settings. See how it is
done in the guide on
x-ray rendering
|
Tessellation shader introduce a new stage in the programmable
OpenGL pipeline. Sitting in between the vertex- and the geometry-shader,
they allow to tessellate patches on the GPU, multiplying geometry
send by the application.
This guide explains how to setup tessellation shaders and shows some
sample use cases you may not have thought of, yet..
GPU tessellation
|