Page 1 of 2

Glass Refraction Demo

Posted: Fri Feb 09, 2007 7:00 pm
by sio2
I've posted a demo of dynamic glass refraction on my website: http://sio2.g0dsoft.com

Image

From the Readme:
Glass Refraction Demo for Irrlicht 3D Engine
===============================================

sio2 'at' users.sourceforge.net

This is a demo of realtime dynamic glass refraction.
The scene - minus any refraction geometry - is rendered into an Irrlicht-managed rendertarget. When rendering the refraction geometry an HLSL shader takes the rendertarget, refraction texture, diffuse texture and calculates the per-pixel refraction.

Usage
=====
WASD keys or arrow (cursor) keys to move camera.
Alt-F4 or Escape key to exit.
Space - Move refracting window to just infront of the camera's current position.

Requirements
============
Drivers:
Latest DirectX 9.0b drivers [www.microsoft.com/directx],
Latest DirectX9 drivers for your graphics hardware [from your HW vendor].

Graphics hardware with:
Vertex Shader 2.0 support, or better
Pixel Shader 2.0 support, or better.

Notes
=====
1. This demo may require the Visual Studio 2005 Redistributable Files installed on your machine. These can be obtained from http://www.sio2.g0dsoft.com in the "Misc" section in "Downloads".

2. The background scene is the PerPixelLighting sample from the Irrlicht SDK. Since the refraction shader requires PS2.0, the PerPixelLighting scene is fixed to use the best normal mapping (parallax normal mapping).

3. This Irrlicht build is based on Irrlicht Subversion revision 467.

Credits
=======
1. The base scene for this demo is the PerPixelLighting sample from the Irrlicht SDK.
2. The stained-glass window texture and bumpmap are from the ATI Treasure Chest demo.
3. The HLSL refraction shader was written by myself (SiO2).

Posted: Fri Feb 09, 2007 7:40 pm
by RapchikProgrammer
Awesome stuff sio2! Its gr8 to see you releasing such eye candy for irrlicht, irrlicht really does need em!

Posted: Sat Feb 10, 2007 2:29 am
by Midnight
that is awsome stuff man keep it up 8)

Posted: Sat Feb 10, 2007 12:50 pm
by JPulham
SWEET! :shock:
that web page is possibly THE best Irrlicht page about at the moment! :D

Posted: Sat Feb 10, 2007 2:06 pm
by belfegor
Are you going to release the source?

Posted: Sat Feb 10, 2007 11:32 pm
by bitplane
cool effect :)
I guess refraction would also look on a particle system to create a heat wave effect

Posted: Sun Feb 11, 2007 1:21 am
by afecelis
OMG Sio! :shock: :shock: :shock:
Will it run on a 486? :wink:

EDIT:superb fine work! :D Had 3 more examples to catch up.

Posted: Sun Feb 11, 2007 10:29 am
by sio2
afecelis wrote:OMG Sio! :shock: :shock: :shock:
Will it run on a 486? :wink:
Yes, of course! You'll need to overclock it though. :twisted:

I originally used your "giroom" b3d mesh for the background scene, but it didn't have enough "noise" - the flat grey walls didn't give much of a distortion effect. So I switched to the PerPixelLighting room.

I also had three "windows": stained glass; an embossed Irrlicht logo (a bumpy logo I threw together); and a heat-haze effect. I couldn't fit them nicely in the PerPixelLighting room so I just went with stained glass. Then I added the ability to move the glass around with the space bar.

I may go back to the "three window" demo sometime. It's neat seeing them interact with each other; Irrlicht sees them as standard transparent primitives. They all share a single rendertarget which makes it cheap to render more than one - cheaper than if they all needed their own rendertarget, anyway. :wink:

Posted: Sun Feb 11, 2007 11:09 am
by BlindSide
Haha this is too much good stuff in a very short amount of time sio2. I wish we can organize all of this quickly so we can all start using it in our projects :D Would you mind sticking some example code in code snippets if you are planning on releasing the code that is? (If you are not that I would like to hear about the project you will be using it in, because it must look stunning by now 8) )

Posted: Sun Feb 11, 2007 11:30 am
by Virion
my only get 13-14fps >_<"
my card is Nvidia fx5200 :oops:
hope to get a better graphic card lol

Posted: Sun Feb 11, 2007 2:51 pm
by Julian
nice sio2 :)

Posted: Mon Feb 12, 2007 1:12 am
by noreg
nice. could you mark on your website where there is source included and where not? Much better for people on dial-up.

Posted: Mon Feb 12, 2007 9:50 am
by sio2
noreg wrote:nice. could you mark on your website where there is source included and where not? Much better for people on dial-up.
Every demo that has source code is clearly marked "Source code included" in the description on the Download page.

Posted: Mon Feb 12, 2007 10:22 pm
by noreg
Thanks for answering my rant. You are right, i have even seen that. The reason why i am ranting is, that i am such a bad programmer that i have to rely to a certain amount on sourcecode supplied from others more gifted. You simply did not mark the examples with no source code as such and i (evil-minded like @ssholes are) picked that up. Nevertheless, your work is remarkable.
Hope you don't get my drunk writing in the wrong throat, mate. :P

Posted: Tue Feb 13, 2007 3:50 am
by cypher543
That is amazing! Now all it needs are light beams that pass through the glass and it'll be just like something from The Elder Scrolls: Oblivion! :D