Pranabesh Sinha bio photo

Pranabesh Sinha

I am a diehard Tintin enthusiast who likes to learn new things. If the apocalypse comes tomorrow I'd have to reinvent my life, and that kind of makes me yearn for it.

Email LinkedIn Github

This is faking…with style

The purpose of this project was to create a Snapple bottle entirely from textures. The first choice that I was faced with was to decide whether to use Renderman or GLSL. I went for the former because of the ease with which textures can be loaded and displacement shaders can be created.

The next thing to do was create a displacement shader which would give the look of a bottle. My first trial gave me this:

first trial

Though it looks like a bottle it is not THE Snapple bottle. Changing the cosine function with a logarithmic function solved the problem for me. Here is the result:

final shape

Since the intention was to use textures as much as possible I bought a Snapple, removed the label after considerable legedemain and scanned it. From there on it was a simple task of cropping the label ‘Snapple’ and turning it to grayscale so that it could be used for bump mapping. For the thread of the cap I drew some horizontal lines on a black background and used it for bump mapping.

So here is the image, it looks like a plastic bottle.

Plastic bottle

The next step was to render the glass. Now raytracing is surprisingly difficult to do in Renderman, it’s like a classified secret and no one on the web talks about it. Since the essence of Computer Graphics can be summed up in Buzz Lightyear’s slightly modified words as “This is Faking …..with style”, I decided to fake the glass using textures. After a lot of trials I finally found an image which gave me what I wanted, here is the original image:

Glass source

And this is the result of applying it as a texture, it sort of looks like glass but the illusion is incomplete because it doesn’t reflect anything.

Glass source

To add reflections I did environment mapping using the following 180 degree image:

Env mapping source

And the result of applying this is given below:

Final image

Volumetric effects

I played around with some more textures and found that given the right image it is also possible to get volume like effects using just textures. Here are some of the results:

3 week old soup

It reminds me of three week old hot and sour soup

Smoke on the water

And I call this one smoke on the water.