my web
demoscence.195_95_256.how.textures



We didn't implement anything new regarding textures for this project. We just used the same techniques as in Paradise, and this allowed us to store about 8 Megabytes of data in "just" one kilobyte. By looking to the original demo by Plastic, we saw we only needed to recreate 4 textures: a marble texture for the diffuse layer in several scenes (this requiring high quality and fidelity to the original texture), a noise texture for the bee model, a background cubemap texture with a beach for the last scene of the intro (the balls) and a cubemap with the Saint Pieters church for almost all the HDRI specular reflections. This last one was maybe the only difference with the Paradise intro, because we had no HDRI in that one.

Finally we had 10 static textures in the intro (plus 5 dynamic textures for shadow maps, reflection maps and bluring, but we don't have to manually create this ones anyway).

The marble texture was done in about 10 minutes, as a test for the model, but it finally survived until the final version without modification (pity). It is basically 4 turbulence-scaled colors ranging from white to grey and green, plus another turbulence for the red veins. The mixing mode was "lerp" as usual, and all the turbulence results were tuned with a smoothstep function to get the desired shapes. Of course, I took the correct (r,g,b) values by just picking from the original texture.



Original texture by Plastic
Our synthetic texture. Far more simple than the
original one, but good enought to make the job.



The real challenge on for the textures this time was the St Piters cube map.




Complete HDR image

Only the high part of the HDR image



This image is a high dymamic range image (left image above), but this is not a problem for our introsystem. In the other hand, the image contains lot of detail that is difficult to synthetice in a few bytes. So what we did, is to realize that this cubemap is mostly used for the specular component of the lighting on the objects, and thus only the high values of the irradiance are visible after reflection. It was good to notice also that most of the details are geometric details and are located in the low range values, while the highlights are in the high part of the range. Thus, the most important features to synthetise where the highlights and not the details. To confirm this, we opened the image in HDRShop and extracted the high range part of the image (right image above).

So, creating this image was not difficult after all. Some smoothstep-ed distance functions where used to create the highlights (after picking the correct texture-space coordinates from HDRShop), and some geometric funcions to draw a few ellipses and squares.





This is the generated cubemap as seen after the shader, even if before the shader it is complete HDRI. However we didn't want to use floating point textures, specially because of the abscence of bilinear interpolation in current hardware. So, what we did was to store the low range in the RGB channels as usual, and the high range part (highligts) in the alpha channel, what gives 16 bit dynamic range with the only restriction that the high range must be white color (what was the case in this cubemap anyway). Then, the shader only needs to do a MAD operaion to recover the 16 range color, what is more than enought for most HDRI images.












iņigo quilez 2005