12
2012
Fake Water Shader
Testing “fake” water shader & trying to make a nice looking river scene (with unity free version..)
Webplayer(s):
http://unitycoder.com/upload/demos/mFakeRiver4/ (*7mb)
http://unitycoder.com/upload/demos/mFakeRiver5/
Current “features”:
- Terrain textures & stones are from: Advanced Terrain Shaders v2
- Terrain modeled with heightmap, imported to Unity with mTerrain
- Unity Terrain + normal flat mesh plane for the river
- Custom “water” shader: Kind of fake reflection/refraction look by using 2 textures (*image#2)
- UV anim + Weird Waves “DepthBlur” or Refraction (?)
- Problem: Cannot see through the water at all..
Ideas / Todo/ItWontWork:
- Perlin noise for the waves?
- Normal / Vertex Bump/Displacement?
- Extra Texture layers (one more thin surface fx? more visible river bottom texture?)
- Cubemap reflection?
- Distance Blur?
- Interactive object-on-water fx? (water texture color based on object distance? animated ripples coming out from the object?)
- Sides should have slower speed + less sky reflection + more ground color (transparency?)
- Add particles for water splashing (but a rock on the river?)
- Fake vignetting with unity free version? (screen sized plane, with vignette texture, drawn on top of everything?)
- Fake Caustics with caustics map?, heres a nice Caustics Generator
Download source:
—
(below) Image#2 : Current water shader with 2 textures (12.02.2012)
—
(below) Image#3: Had to redo the shader.. couldnt make it work with 1 sided planes.. Now using 2 sided box.
Starting to get some see thru effects, just need to animated it and add the surface blurring again.
Made a quick cut on the terrain..doesnt look so nice (see the edges of the terrain near river), but enough for a quick test..
—
(below) Image#4: Notes
– Added Foam map (currently not moving and it looks like the river has thin ice and the water is flowing under it..)
– Added Cubemap reflection (not strong enough?..have to try fix that & need to find better cubemaps..
– Problems adding vertex waves, but actually rivers dont have “sea waves”.. have to try with moving normals..(?)
– Idea: Create Foam around objects (based on distance?..but then cannot have many objects to do that inside shader?)
– Added webplayer of this version (without the foam)
—
(below) Image#5 : Current water shader with 4 textures (13.02.2012)
—
(below) Image#6
– Water is more transparent now (Transparency is based on normals)
– Got few highlights on the water, just by doubling some color values, not sure how(?) (still would need more “fake light highlights”)
– Tried speedMask texture (middle of the river flowed faster than the sides..but that caused texture stretching problems)
– Foam map failed with speedMask texture (strecthing)
– Tried “BlinnPhong”, but that killed Cubemap..(?) so back to “Lambert”
– In the image there are few stones in the water, looks ok thru the water also
– Maybe needs extra highlight map, middle depth map (some junk flowing inside water..)
– Stone should have foam around it.. (failed to get distance to stone in shader, trying again later..)
– Added webplayer
Related Posts
36 Comments + Add Comment
Leave a comment
Recent posts
- [GreaseMonkey] Unity Forum Fixer
- UnityHub: Make Hub application background Translucent
- Customize SpriteShapeRenderer quality (but has issues)
- Editor tool: Copy selected gameobject’s names into clipboard as rows (for Excel)
- Editor tool: Replace string in selected gameobject’s names
- UnityHub: Enable built-in Login Dialog (no more browser login/logout issues!)
- Use TikTok-TTS in Unity (with WebRequest)
- Create Scene Thumbnail Image using OnSceneSaved & OnPreviewGUI
- webgl+javascript TTS
- Using Moonsharp (LUA) + Unity Webgl
- Using 3D gameobject prefabs with Unity Tilemap + NavMesh Surface
- Custom Unity Hub Project Template Preview Image/Video (using HTML+CSS in package description)
Recent Comments
- Vector3 maths for dummies! on
- UnityHub: Make Hub application background Translucent on
- UnityHub: Make Hub application background Translucent on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
- [Asset Store] Point Cloud Viewer & Tools on
- [Asset Store] Point Cloud Viewer & Tools on
- ffmpeg stream raw video into Unity Texture2D on
I am just wondering when and where you can download this shader(s)? This is most probably the best free water shader I’ve ever seen and I would really like to use it. Really nice looking work 🙂
The last version still has some “freezing pixels”-issues..and would need a bit of cleanup anyways, but i’ll try to publish atleast some version in a week or so..
Added example scene+shader download..(it doesnt have the AdvancedTerrainShader-pack or skybox included, so add those to make it look nicer..). Notes: its not optimized or cleaned up, the river is just fast cut to the terrain, doesnt look nice and cannot see / use bottom textures effects nicely..
Now, this really eats resources. My PC which isn’t slow, well perhaps I could do with a better video card, really slows down when I load the demonstration in my browser. Is it just me or the way it is?
yes thats the way it is : )..
Is there a place where i can download this from? It looks really good man!
Currently the download link is only in the toolbar.. (Links / UnityCoder.com / Sources / April2012 / FakeWaterShader.unityPackage)
(But actually its not really usable.. would have to clean it up and fix many things)
okay thanks man
Actually seems the available pack in toolbar is not equal to that screenshots result above.
It’s possible download the latest version from some link?
Thanks in advance
That is the current latest version, but it has some problems and I dont have the previous version anymore (it was a bit better)..Oo
Also terrain textures & stones are from those Advanced Terrain Shaders package (free from asset store)
I like fake river 4 because for large rivers like Thames or Danube you never get to see the river bed or any kind of transparency.
Really nice thankyou.
But is there anyway to change the direction of the water flow?
Using it in conjunction with free river script the water flows across the river rather than down.
Try editing the line with:
“float2(IN.uv_MainTex.x,IN.uv_MainTex.y+waveslide)”
Reverse direction:
“float2(IN.uv_MainTex.x,IN.uv_MainTex.y-waveslide)”
Or add the values to .x instead.. and so on.
But I guess your river is not a straigth line..?
Then it would need some more work.. maybe something like flow maps,
http://forum.unity3d.com/threads/97662-Animate-water-using-Flow-Maps
http://forum.unity3d.com/threads/156119-Flow
Thankyou for you reply. I instead found a quick and dirty work around. I dropped the y surface texture tiling down to .2 and this altered the direction of the water flow very nicely.
Here’s something nice, “precomputed two sets of tiling and cycling wave displacements”..
http://www.fxguide.com/featured/assassins-creed-iii-the-tech-behind-or-beneath-the-action/
Hmm, just would need to know, how to make loopable waves in 3ds max with free houdini waves plugin..
Hello
Sorry for my English, I write through Google Translator.
I really liked your shader for water.
But I can not try it. I can’t download.
I use UnityCoder.com toolbar, but for some reason it does not give me a link to the download. On the other files in your blog such problems.
Please tell me what to do?
Hi,
Easy solution: Use Firefox or IE for the download..
With Chrome there are many problems.
Sometimes disabling adblock helps.
Thanks
IE helped to solve the problem.
Noticed that the shader was used here,
http://www.kongregate.com/games/ErwanB/survival-island-developers-cut
Community sea shader would had been better there,
http://forum.unity3d.com/threads/16540-Wanted-Ocean-shader/page37
Why not supported IOS (iPhone4s) normally?
What can i do to run this shader on iPhone4s normally ?
Thanks.
This shader is too heavy for anything, I suggest you try checking something designed for mobiles in asset store/forum, maybe like http://forum.unity3d.com/threads/169586-Water-%28for-Unity-Free-and-Mobile%29 or maybe
Translucent Shader for Unity3D
http://www.farfarer.com/blog/2012/09/11/translucent-shader-unity3d/
Hi, I really like this! I only have one problem. Part of the river, in the distance is not being rendered; as such when I view the river in game, I see the river perfectly at close/medium distance, but the segment of the river in the distance is not rendered. Any help on this one?
Animated Water Shader + flowmaps:
http://algoholic.eu/animated-water-shader/
water shader:
http://forum.unity3d.com/threads/210212-Terrain-Challenge-for-Indie-Devs?p=1414706&viewfull=1#post1414706
Reflect River shader:
http://forum.unity3d.com/threads/234565-Need-fresnel-in-this-shader-but-not-enough-interpolators-%28-Please-help
RiverWater: the free epic water solution for unity free users!
http://forum.unity3d.com/threads/235860-RiverWater-the-free-epic-water-solution-for-unity-free-users!
ocean shader:
http://armedunity.com/topic/7935-ocean-shader-indie/
Fake reflections revisited
http://mtnphil.wordpress.com/2012/09/15/water-shader-follow-up/
Faking water reflections with fourier coefficients:
http://mtnphil.wordpress.com/2012/09/12/faking-water-reflections-with-fourier-coefficients/
thanks
very excellent
good ocean water/shader here:
https://github.com/eliasts/Ocean_Community_Next_Gen
Nice shaders for water. Is this the best we can do up to date or does water can be emulated as real as possible nowadays?
here’s some proper new waters,
https://www.assetstore.unity3d.com/en/content/47961 (paid)
https://www.assetstore.unity3d.com/en/content/47203 (paid)
https://github.com/eliasts/Ocean_Community_Next_Gen (free)
cryengine water shader:
https://github.com/CRYTEK-CRYENGINE/CRYENGINE/blob/release/Engine/Shaders/HWScripts/CryFX/Water.cfx
Thanks. I added this to my project and everything got screwed up. : (
well this package is already 5 years old, so always use version control as undo. (although it shouldnt contain anything weird, just some shader and test scene)