When I was playing Portal 2 I was intrigued by the light window containers in the game.

(not my video)
So I made a shader in Rendermonkey to recreate the principle of this effect (See attachment
light_glass_container.zip (1000.16K)
downloads: 23!).

Basically it is just simple Parallax mapping + texture coordinate distortion to simulate the refraction.
I still need to do some tinkering to have the same results but the basic idea is there. (I haven't figured out how they blend the texture colors inside the shader yet, I quickly made up my refraction distortion up etc.)
Interesting resources:
http://www.valvesoftware.com/publications/2004/GDC2004_Half-Life2_Shading.pdf page 91 about the refraction shader that Half-Life 2 uses.
http://snarf-life-2.googlecode.com/svn/trunk/src/materialsystem/stdshaders/SDK_Refract_ps20.fxc
* The media in the attachment contains only programmer art and media from the examples of rendermonkey.
* Theresources of the real material in Portal 2 can be found in the main *.VPK:
materials\glass\glasswindow_refract01.vmt
materials\glass\refract_light_color.vtf
materials\glass\refract_light_normal.vtf

(not my video)
So I made a shader in Rendermonkey to recreate the principle of this effect (See attachment
light_glass_container.zip (1000.16K)
downloads: 23!).

Basically it is just simple Parallax mapping + texture coordinate distortion to simulate the refraction.
I still need to do some tinkering to have the same results but the basic idea is there. (I haven't figured out how they blend the texture colors inside the shader yet, I quickly made up my refraction distortion up etc.)
Interesting resources:
http://www.valvesoftware.com/publications/2004/GDC2004_Half-Life2_Shading.pdf page 91 about the refraction shader that Half-Life 2 uses.
http://snarf-life-2.googlecode.com/svn/trunk/src/materialsystem/stdshaders/SDK_Refract_ps20.fxc
* The media in the attachment contains only programmer art and media from the examples of rendermonkey.
* Theresources of the real material in Portal 2 can be found in the main *.VPK:
materials\glass\glasswindow_refract01.vmt
materials\glass\refract_light_color.vtf
materials\glass\refract_light_normal.vtf
Create a custom theme





