Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (AbrahamR, wdlmaster, 7th_zorro, dr_panther, 1 invisible), 764 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Reflecting and refracting water #218767
07/30/08 14:03
07/30/08 14:03
Joined: Jun 2006
Posts: 379
Flevoland, 5 meters under wate...
Roel Offline OP
Senior Member
Roel  Offline OP
Senior Member

Joined: Jun 2006
Posts: 379
Flevoland, 5 meters under wate...
Hi

Some week ago I was searching for a hlsl shader which supports
both reflection and refraction.
the shader in the templates has some strange distortion if the camera moves close
It might be blind, but I didn't find any
I made my own now, using reflection and refraction.

If you have questions, you may email me at leor_hectometer@hotmail.com
or just pm me


a picture

here is the link
water shader download

note, the refraction uses some fresnel, so it can be hard to see some times


Check out the throwing game here: The throwing game
Re: Reflecting and refracting water [Re: Roel] #218771
07/30/08 14:29
07/30/08 14:29
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline
Serious User
VeT  Offline
Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
looking great smile


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: Reflecting and refracting water [Re: VeT] #218772
07/30/08 14:30
07/30/08 14:30
Joined: Jan 2008
Posts: 1,580
Blade280891 Offline
Serious User
Blade280891  Offline
Serious User

Joined: Jan 2008
Posts: 1,580
Just wondering , does this have things like ripple effects?


My Avatar Randomness V2

"Someone get me to the doctor, and someone call the nurse
And someone buy me roses, and someone burned the church"
Re: Reflecting and refracting water [Re: VeT] #218773
07/30/08 14:33
07/30/08 14:33
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
you should check out lerp() wink
and the fresnel isn´t very correct... You need to get use the pixelposition in worldspace (you will need more vertices for the water...) and I am pretty sure that you don´t have to convert the valuerange.
Other than that it looks very nice smile

Re: Reflecting and refracting water [Re: Slin] #218775
07/30/08 14:59
07/30/08 14:59
Joined: Jun 2006
Posts: 379
Flevoland, 5 meters under wate...
Roel Offline OP
Senior Member
Roel  Offline OP
Senior Member

Joined: Jun 2006
Posts: 379
Flevoland, 5 meters under wate...
thank you for the comments very much

Originally Posted By: Slin
You need to get use the pixelposition in worldspace (you will need more vertices for the water...)


I moved the pixelpositon stuff to the pixel, because this eliminates the distortion when you look at the water really close
I think you mean that?


Check out the throwing game here: The throwing game
Re: Reflecting and refracting water [Re: Roel] #218777
07/30/08 15:04
07/30/08 15:04
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
Nope, I meant for calculating vecView. For calculating it you need the vertexposition in worldspace.

Re: Reflecting and refracting water [Re: Slin] #218779
07/30/08 15:05
07/30/08 15:05
Joined: Jun 2006
Posts: 379
Flevoland, 5 meters under wate...
Roel Offline OP
Senior Member
Roel  Offline OP
Senior Member

Joined: Jun 2006
Posts: 379
Flevoland, 5 meters under wate...
I will look at it, thanks


Check out the throwing game here: The throwing game
Re: Reflecting and refracting water [Re: Roel] #218787
07/30/08 15:35
07/30/08 15:35
Joined: Dec 2005
Posts: 478
India
M
msl_manni Offline
Senior Member
msl_manni  Offline
Senior Member
M

Joined: Dec 2005
Posts: 478
India
Can I have rapidshare download link please? The filefront link is not working for me, cant download anything from filefront.


My Specialities Limited.
Re: Reflecting and refracting water [Re: msl_manni] #218794
07/30/08 15:58
07/30/08 15:58
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
Something you could add is specularity for the sun.
It is very easy to add but improves the look a lot wink You can check out a tutorialchapter about it here: http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series4/Specular_highlights.php

Re: Reflecting and refracting water [Re: Slin] #218806
07/30/08 17:18
07/30/08 17:18
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline
Serious User
Scorpion  Offline
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
normally you could use the out-coordinate of the vs for projecting, but then the effect you described occurs. I didn't find a way to stop the shader doing that.

I think you use tex2Dproj() for it...the problem is, that ps<2.0 don't support it.

Page 1 of 2 1 2

Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1