About Store Forum Documentation Contact
Donations:
309$/mo



Post Reply 
Screen Space Water
Author Message
fatcoder Offline
Member

Post: #1
Screen Space Water
Have you seen this?

Article: http://www.gamedev.net/reference/article...le2642.asp
PowerPoint Presentation: http://www.mediafire.com/?0tnll50fh4n

It looks amazing in motion. The author provides full HLSL source in the article. Any chance something like this will find its way into Esenthel as another water technique? lol
(This post was last modified: 05-24-2010 08:42 AM by fatcoder.)
05-24-2010 08:41 AM
Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #2
RE: Screen Space Water
I liked the water (especially the Ocean) in Esenthel; but this.. argh, must have! grin
05-24-2010 10:18 AM
Find all posts by this user Quote this message in a reply
Barthap Offline
Member

Post: #3
RE: Screen Space Water
If you change water parametrs (for example in WE), texture, you will have very good effects like those in that article. Sky color and sand texture - no problem.
05-24-2010 12:07 PM
Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #4
RE: Screen Space Water
I agree that the current ocean shader in Esenthel is good. But there are a few things that I think are missing. Perhaps Esenthel can add to the existing ocean shader to provide for these, in which case the screen space water technique may not be required. However I believe it would perform better.

1. Correct color loss with depth. For example, the red channel should fade faster, followed by green, then blue last. The water in the article does this, which gives it the interesting color change with depth. This shouldn't be too hard to do either. The current ocean shader already fades color with depth, it just needs to do it differently for each color channel.

2. Foam around edges and on tops of waves. This could be added to the current ocean shader by sampling an additional foam texture and blending it based on depth. This would allow form to appear around the shore, where the water touches the land. In addition, it could also appear when waves reach a set height.

3. Caustics based on depth. A set of caustic textures (used to animate the caustics) could be blended to the ocean floor. The blending would be based on depth so the caustics fade with depth. They would also need to blur with depth. The Hydrax plugin for Ogre has a good implementation of caustics, however I don't think they fade and blur the texture very well with depth.

What do you think Esenthel? Any chance of upgrading the ocean shader to include these effects?
05-24-2010 02:38 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #5
RE: Screen Space Water
In future of course.
You can always write custom shaders after purchasing the license.
05-25-2010 10:27 AM
Find all posts by this user Quote this message in a reply
iamcreasy Offline
Member

Post: #6
RE: Screen Space Water
It would be a pleasure to see this shader in esenthel.
(This post was last modified: 05-25-2010 05:55 PM by iamcreasy.)
05-25-2010 05:52 PM
Find all posts by this user Quote this message in a reply
Barthap Offline
Member

Post: #7
RE: Screen Space Water
I've never tried to set custom water shader but I think I can't do it, It is possible to be too difficult for me. But I'll try do it.
05-26-2010 05:48 AM
Find all posts by this user Quote this message in a reply
lovee Offline
Member

Post: #8
RE: Screen Space Water
http://http.developer.nvidia.com/CgTutor...ter01.html
show you, how custom shader work!
But for me, even more difficult is math, so an elementary mathematics and university mathematics, including mathematical formulas manual is necessary.

(My English is poor, use google translation, I hope you can understandwink)
(This post was last modified: 05-26-2010 07:12 AM by lovee.)
05-26-2010 07:10 AM
Find all posts by this user Quote this message in a reply
Barthap Offline
Member

Post: #9
RE: Screen Space Water
I'm bad for mathematics. I know the basics of HLSL but I can't use it in practice.
05-26-2010 11:10 AM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #10
RE: Screen Space Water
I'm not a wiz at shader coding, but I can tell you that Cg and HLSL are two seperate things. HLSL only works with DirectX, whereas, Cg works with DirectX and OpenGL. Normally shaders have to be written twice, once in HLSL and once in GLSL, if games want to support both DirectX and OpenGL, but Cg allows you to only write 1 as it works for both.

The shader in that article is written using HLSL. You don't necessarily need to know much about HLSL to be able to implement the shader since it is provided for you in its entirety. All you have to do is set the variables to the appropriate values.

Code:
heightMap – height-map used for waves generation as described in the section “Modifying existing geometry”
backBufferMap – current contents of the back buffer
positionMap – texture storing scene position vectors
normalMap – texture storing normal vectors for normal mapping as described in the section “The computation of normal vectors”
foamMap – texture containing foam – in my case it is a photo of foam converted to greyscale
reflectionMap – texture containing reflections rendered as described in the section “Reflection and refraction of light”

For instance, all these variables need are textures set to them. Although, most of them (backBufferMap, positionMap, normalMap, reflectionMap) are code-generated I'd imagine. However, all of these are probably already implemented in Esenthel's current shader code for water so that shouldn't be too much of a problem.

It could possibly be as easy as just swapping out the shaders and setting a texture to the foamMap variable as Esenthel doesn't use foam at the moment. However, you still have to have a paid license to be able to even try it, which I do not at the moment. Good luck to anyone who does!
05-26-2010 04:14 PM
Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #11
RE: Screen Space Water
I pretty much agree with you there Driklyn. It should be quite easy as I believe EE already produces most if not all of the maps required (except for the foam texture, which would be a static texture anyway) through its current water and deferred rendering implementation.

I don't own a license yet either, so I can't try it out. I'm wondering though, if you purchase a license, do you get access to the existing ocean shader to modify or use as a reference? Anyone know, or can Esenthel answer?
05-27-2010 01:32 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #12
RE: Screen Space Water
hi, water shader is not supplied in the license (only in ultimate version)
05-31-2010 04:18 PM
Find all posts by this user Quote this message in a reply
dylantan Offline
Member

Post: #13
RE: Screen Space Water
(05-31-2010 04:18 PM)Esenthel Wrote:  hi, water shader is not supplied in the license (only in ultimate version)

Not all can afford the Ultimate version i assume. For the good of the community, i hope you would consider include this in all the licensed version. This is something the community would greatly benefit and a plus to Esenthel Engine as some engines already included this. Hope to see the good work being put in good use and good showcase for Esenthel as well smile
02-27-2011 05:38 AM
Visit this user's website Find all posts by this user Quote this message in a reply
crymantt Offline
Member

Post: #14
RE: Screen Space Water
(05-26-2010 04:14 PM)Driklyn Wrote:  For instance, all these variables need are textures set to them. Although, most of them (backBufferMap, positionMap, normalMap, reflectionMap) are code-generated I'd imagine. However, all of these are probably already implemented in Esenthel's current shader code for water so that shouldn't be too much of a problem.

Do we have access to (backBufferMap, positionMap, normalMap, reflectionMap)? if not can I render my own RT's of these?(but whats the point as its already rendered for the deffered system?
03-12-2011 04:51 AM
Find all posts by this user Quote this message in a reply
Post Reply