Glass Pane and Rain Drop refraction demo - Source Included

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki

What do you like better?

The glass pane.
73
88%
The rain drops.
10
12%
 
Total votes: 83

BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

JDHunter wrote:Hey BlindSide,

thx for nice tutorial, very nice work...
very helpful... big thx for release the source :D

currently successful tested on laptop with a Radeon XPRESS200 SERIES :wink: 8FPS, all shader run correctly

later i will test it on 8800gts
Believe it or not, this demo was programmed on a laptop with a Radeon 200M series ;) (So was the metaballs one.)
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
JDHunter
Posts: 17
Joined: Tue Jun 20, 2006 6:15 am
Location: Germany
Contact:

Post by JDHunter »

:shock: ...wow develop on a Radeon200M

ok her the result of Geforce8800GTS(640)
230FPS and all run correctly... very... nice... i will ported next time to irrlichtNetCP, if you don't object
nice nice... go on with your'e work ;)
Blue Hampster
Posts: 39
Joined: Tue Apr 29, 2008 1:41 pm
Contact:

Post by Blue Hampster »

Heya, when I try to use it, all it returns is a solid texture on all the models which is made from the terrain, and when the camera is tilted upwards, then the textures become just the same as the sky box. Does anyone know whats happened?
FlyingIsFun1217
Posts: 219
Joined: Fri Apr 13, 2007 8:29 pm
Location: Illinois
Contact:

Post by FlyingIsFun1217 »

Blue Hampster wrote:Heya, when I try to use it, all it returns is a solid texture on all the models which is made from the terrain, and when the camera is tilted upwards, then the textures become just the same as the sky box. Does anyone know whats happened?
Sounds like what I used to get on an intel GPU with linux. Any similarities?

Make sure your GPU supports the shader model.

FlyingIsFun1217
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yes, broken shaders sometimes bring strange render states. I have fixed some things in SVN, not sure if this already fixes all problems for failed shaders, though, especially when only one of the shaders works correctly.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

This requires atleast Shader Model 2.0 in OpenGL. It may work on Intel cards if converted to DX...
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Hi, Blindside.

Tested this on my card (GeForce 9800GX2) on Vista64 and work very well.
Here's a screen:
Image
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

u da man!

thanks for the tutorial, i'll test the code in one of my test programs.

Image
Image
Mirror
Posts: 218
Joined: Sat Dec 01, 2007 4:09 pm

Post by Mirror »

cool work BlindSide!
one question, i was playing around with some values in the shaders and it seems ( though it's not very obvious with the default values ) that when the glasspane intersects with the lower part of the camera viewport and with the left part of it, a weird effect is being produced like having 1 cm line down and left which doesn't look very good
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

u know, i've seen this somewhere not sure if it was on irrlicht forum.

there's the same demo of a stained glass version. i'm hoping it was blindside who wrote that, tho.

anyway, i think it is possible to modulate the basemap texture to the normal map to create that effect.

would appreciate if someone could confirm about the stained glass demo.
Image
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

nope, it was sio who made the stained glass demo.

http://irrlicht.sourceforge.net/phpBB2/ ... ined+glass
Image
Mirror
Posts: 218
Joined: Sat Dec 01, 2007 4:09 pm

Post by Mirror »

Hi, sorry for "Hijacking" this thread, i was playing around with BlindSide's code, so here is some modded code ( not in the shaders, just in the .cpp, in the shaders i just changed a constant value and made it a variable )

actually made it a EMT_TRANSPARENT_REFLECTION_2_LAYER and removed the 0 layer texture ( RTTTex ). added also an RTTTex->drop()

http://irrlichtirc.g0dsoft.com/Ogami_It ... s2-0.1.rar

this results in some kind of fake reflection ( doesn't come out of the shader ). feel free to use it :D

here is an image :
http://img352.imageshack.us/img352/9156/glass3jl5.jpg

there is one issue with this shader ( and also elvman's one about realistic water ) : if you play with Harshness values ( look at the shader ) and have a relatively small value ( close to 0 ) you will notice this problem :

http://img150.imageshack.us/img150/4353/glass2us6.jpg

( it is also present with HarshNess = 2.0 ) but not very visible

there is one more issue, if you move the camera up, the change of the glass reflection from terrain to sky, doesn't take place smoothly
Last edited by Mirror on Mon Jul 07, 2008 1:17 pm, edited 1 time in total.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

That error looks like you're reading over the edge of the texture or you're clamping the texture coords to within the 0-1 range. Not much you can do about that really i suppose as effectively you're wanting to read off the edge of the RTT due to large refraction so i guess the only way to fix it would be to create a larger RTT.
Image Image Image
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

i will not say any word.

this one is worth a thousand words.

for your eyes only.

Image
Image
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

here's another one, fireball added into the scene. notice FPS went down by 20.

Image
Image
Post Reply