Anti-aliased Soft Shadows

Publications info:
Valient, M., “Hardware Generated Object Silhouettes“. G – Journal for Geometry and Graphics, No 3, Volume 2, Slovak Society for Geometry and Graphics, 2005, ISSN 1336-524X.

Valient, M., Bujnak, T., “GPU Friendly, Anti-aliased, Soft Shadow Mapping“. Reviewed poster. ACM Proceedings of SCCG 2005, ACM Press, October 2005, ISBN 1-59593-203-6.

How are these articles related:
The first article (Hardware Generated Object Silhouettes) describes in depth the possibility to generate object silhouettes on GPU and the second article (GPU Friendly, Anti-aliased, Soft Shadow Mapping) uses this approach to generate the soft shadows.

Abstract (Hardware Generated Object Silhouettes):
In this article, we present a high performance algorithm that renders thick object silhouettes completely on the GPU using only two passes. We present a new structure called topology aware mesh, which allows us to overcome the lack of global adjacency information during the
vertex processing on GPU. Topology aware mesh stores complete face adjacency information for each vertex and allows edge computations to be performed on graphics hardware. Topology aware mesh consumes about 0.77 times the storage of the original mesh when using 16-bit precision and stream frequency capability of current hardware and it is created only once during the linear-time pre-processing step. Our approach can be used as a replacement for many CPU based silhouette detection algorithms in NPR or shadow rendering.

Abstract (GPU Friendly, Anti-aliased, Soft Shadow Mapping):
In this paper, we present an algorithm that renders anti-aliased, soft edged shadows using a modified shadow-mapping approach. Our algorithm adds the silhouette information to the shadow map, thus allowing rendering precise and continuous shadow boundaries. Soft shadows for small spherical light sources are rendered using a variation of the percentage closer filtering algorithm [Reeves 1987]. The critical improvement of our algorithm over previous approaches is that it runs completely on the GPU using only two passes. This includes the silhouette detection step which is done completely in the vertex and pixel shaders using specially generated version of the mesh.

Download the ‘Hardware Generated Object Silhouettes’
Download the ‘GPU Friendly, Anti-aliased, Soft Shadow Mapping’

Fractional-Disk Soft Shadows

Publication info:
Valient, M., W., H., de Boer., “Fractional-Disk Soft Shadows”, In: Engel, W. F., et al., “ShaderX3: Advanced Rendering With DirectX And OpenGL”, Charles River Media, November 2004, ISBN 1-58450-357-2.

Abstract:
This article describes a simple, practical, and fairly effective way to approximate soft shadows. The actual implementation is a modification of the percentage closer filtering (PCF). PCF was originally designed to address the aliasing problem inherent in shadow mapping. It also has the welcome side effect of generating soft shadow edges, which resemble simple constant-width penumbrae. In this article we show how a modified PCF algorithm can produce more realistic penumbrae. We use stochastic sampling varied per pixel to obtain reasonable results while using fewer shadow map samples.

Download the article
Download the source code

Accelerated real-time rendering

Publication info:
Valient, M., “Accelerated real-time rendering”, Master thesis, Faculty of Mathematics, Physics and Informatics, Comenius University, Bratislava, April 2003.

This publication also contains parts from:
Valient, M., “Advanced lighting and shading with Direct3D 9″, In: Engel, W. F., et al., “ShaderX2 – Shader Introduction & Tutorial”, Wordware Inc., October 2003, ISBN 155622902X.
Valient, M., “Shadow mapping with Direct3D 9″, In: Engel, W. F., et al., “ShaderX2 – Shader Introduction & Tutorial”, Wordware Inc., October 2003, ISBN 155622902X.
Valient, M., “Advanced lighting and shading with Direct3D”, CESCG 2003 poster, April 2003.

Abstract:
Advanced real-time lighting and shading techniques are presented in this thesis. We begin with the per pixel Phong lighting, then explain and implement the bumpy environmental mapping enhanced with a Fresnel term, both with pixel shaders 1.4 and 2.0. After this prelude, advanced lighting models are described. Oren-Nayar lighting is used for rough surfaces such as clay. We implement it with shaders 2.0. Cook- Torrance model is mainly used for shiny metallic surfaces and we show version for pixel shader 1.4 and 2.0. Thesis ends with implementation of soft edged shadows created with the improved shadow mapping technique.

Download the thesis
Download the poster
Download the code

Per-pixel shading and optimizations for Direct3D 8

This is my article from November 2002 about the implementation of per-pixel Phong shading on DX8 class of hardware. Available with the source code.

I re-viewed the article in 2004 and corrected some bugs and grammar.

Also contains:
– Description of the lighting equation
– Description of tangent space
– How to implement a spotlights
– Various implementations for multiple lights per pass.

Download the article
Download the source code

3D Engines in Games

My article from 2001 where I tried to describe what a nice engine should contain, what was the history of 3D games, APIs, what is the point of view of the gamer…

Here is the foreword:
Real-time rendering is one of the most dynamic areas in the computer graphics (later only CG). Three dimensional computer games are in other way one of the most profitable commercial applications of the real-time rendering (and CG as whole). Real-time rendering attracts more and more people every year. With every generation of 3D accelerators we see nicer and more realistic games with new effects and more complex models. This article is meant to be a small introduction to the field of real-time graphics for computer games.
The article is divided into several sections
– History of 3D games – a brief history of real-time 3D games, accelerators and API’s.
– Game engine scheme – parts of generic game engine with description.
– 3D API basics – very basic description of the pipelines.
– World of games – describes the specific world of games, point of view of the gamer and point of view of the programmer.

Download the article