Archive Page 2


Dual depth buffering for translucency rendering

A nice and cheap technique to approximate translucency was presented some time ago at GDC. The original algorithm depended on calculating the “thickness” of the model offline and baking it in a texture (or maybe vertices). Dynamically calculating thickness is often more appealing though since, as in reality, the perceived thickness of an object depends on the view point (or the light’s viewpoint) and also it is easier to capture the thickness of varying volumetric bodies such as smoke and hair. Continue reading ‘Dual depth buffering for translucency rendering’


Correctly interpolating view/light vectors on large triangles

A few days ago an artist came to me scratching his head about a weird distortion he was getting on the specular highlight of his point light with an FX composer generated blinn shader. His geometry was comprised of large polygons and the effect of applying the reflection model to the surface was something like that: Continue reading ‘Correctly interpolating view/light vectors on large triangles’


Parallax-corrected cubemapping with any cubemap

Recently I was using a parallax corrected cubemapping technique to add some glass reflections to a project (you can read about parallax corrected cubemapping in this excellent writeup). In general, doing planar reflections with cubemaps is not that easy, the cubemap is considered “infinite” and since it is accessed only with the reflection vector it has no notion of location (that means it does not register well with the scene, it seems detached from it and the reflections do not correspond to actual scene items/features). Continue reading ‘Parallax-corrected cubemapping with any cubemap’


Instant Radiosity and light-prepass rendering

Global illumination (along with physically based rendering) is one of my favourite graphics areas and I don’t miss the opportunity to try new techniques every so often. One of my recent lunchtime experiments involved a quick implementation of Instant Radiosity,  GI technique that can be used to calculate first bounce lighting in a scene, to find out how it performs visually. Continue reading ‘Instant Radiosity and light-prepass rendering’


SharpDX and 3D model loading

I used to be a great fan of XNA Game Studio as a framework to try new graphics techniques, those that needed a bit more support in the runtime than FX Composer or other shader editors could offer. It hasn’t been updated for quite some time now though, and it is becoming irrelevant in an age of advanced graphics APIs and next gen platforms.

In the past few months I noticed a promising framework, SharpDX, which seems to offer a similar level of abstraction of Direct3D as XNA, ideal for graphics demos, but updated to support D3D11 as well. There is another similar framework, SlimDX, but if I understand correctly it is not being as actively developed. Continue reading ‘SharpDX and 3D model loading’


Using Unity as an FX Composer replacement for shader prototyping

A few days ago, while preparing a presentation on physically based rendering, I needed to create a few shaders to showcase the difference between the various reflectance models. As always I fired up my aging FX composer and tried to load a Stanford Dragon model I found on the internet (various formats and polygon counts). FX Composer consistently failed to cooperate. Then, I remembered Unity and its very capable content pipeline so I thought I’d give it a go. And voila I got my model rendering with two drag-n-drops.

This got me thinking about how good the free version of Unity would be as an FX composer replacement. I am aware that Unity is a game engine and not specifically tuned for material/shader creation, but it has many good features like the price (can’t get a better deal than free), content pipeline, scene editor, material inspector UI and a shader editor that could make it a prime candidate. I’ve been using FX Composer to prototype/try shaders for quite some time now, but it is starting to show its age with its D3D10 support and, frankly, not so slick UI and Editor/Scene Viewer. So I set about investigating it. Continue reading ‘Using Unity as an FX Composer replacement for shader prototyping’


Normal Mapping Without Precomputed Tangents

I came across a very interesting post on performing normal mapping without a precalculated tangent frame. The technique is an extension/optimisation to the one presented by the same author in ShaderX5, and it elegantly and efficiently calculates the tangent frame in the pixel shader removing the need for storing tangent and bitangent vectors in each vertex. Continue reading ‘Normal Mapping Without Precomputed Tangents’