- Home /
Better water for Unity 3.3 free?
I'm making a level of a seafront Mediterranean style city and of course a main focal point is the water. The water that comes with unity is just the Daylight Simple Water and it looks horrible IMO with no flexibility whatsoever. I've searched for hours now and can't seem to find anything for the free version of unity without having to pay for it. Anyone know how i can get some better water out of unity(free version) 3.3? or at least get some transparency
I usually get my water from the kitchen, but that just me.
maybe you should learn your grammar before being a smart@ss |D
Answer by Hamesh81 · Feb 05, 2012 at 07:41 PM
I realize you've probably already solved this by now, but I think other people will benefit from this since I had the same trouble finding a good answer to this question.
As digitalConundrum suggested, using Pro water and changing a few of the settings will give very good results. I will give the instructions for using the pro Water 4 inside Unity Indie (I know you said you're using 3.3, but hopefully this will help other people with 3.4, and you can use a similar setup with one of the 3.3 waters).
In a new scene, import the Water Pro package and any other packages you need
Setup your scene with a ground (a terrain or primitive will do), FPS character controller (or some way to move around), and a light
Bring the default Plane gameobject into the scene and set it above the ground near the FPS
Change the Plane's material to Water4Example (Water4/Sources/Materials)
If you simulate now, you will see a plane with a fairly decent animated water material (if you want waves, read on)
Add the following scripts to your plane: WaterBase, GerstnerDisplace (Water4/Sources/Scripts)
In the inspector, find the Water Base script you just attached and uncheck "Edge Blend?"
Turn of the mesh collider if you wish
Simulate the game and... tadaa.. you will have the pro animated water with waves in 14 draw calls
Hope that helps, and I wouldn't worry too much about the comments of the other two rude trolls. Let me know if you have any questions about my instructions.
Cheers
Answer by aldonaletto · Jan 22, 2012 at 02:01 AM
You're right: the simple water is awful! You could try the following: create a new material in the Project View (Create/Material) and select the Transparent/Specular shader, then select the Water Fallback texture, a light green for the main color and white for the specular color. Create a simple plane (Hierarchy view, Create/Plane) and assign the new material to it (the Main Color A component sets the transparency).
To make the water move like in the old and good Quake I game, you can use this UV animation script: it adds sinusoidal offsets to the uv coordinates, producing a similar effect (not the underwater effect, unfortunately!). The effects looks better when the plane has more vertices (but also takes more time to animate); a primitive Unity plane has 100 vertices (10x10), and works fine. If you need a different format, create the plane in some 3D editing software and import it.
var rate: float = 10; // number of "waves" * 3.14 var speed: float = 0.9; // cycles per second / 3.14 var intensity: float = 0.003;
private var mesh: Mesh; private var verts: Vector3[]; private var uvs0: Vector2[]; private var uvs: Vector2[]; private var size: int;
function Start(){ mesh = GetComponent(MeshFilter).mesh; verts = mesh.vertices; uvs0 = mesh.uv; // get original uv coordinates size = verts.length; uvs = new Vector2[size]; // create a new uv array }
function Update(){ var t = Time.time speed; for (var i = 0; i < size; i++){ var v = verts[i]; // calculate a local offset for each uv var uv = Vector2(Mathf.Sin(t + v.x rate), Mathf.Cos(t + v.z rate)); uvs[i] = uvs0[i] + intensity uv; // add the offset } mesh.uv = uvs; // assign the modified uv array }
Great script! Does this animate the water similar to the way pro water does?
No, this just moves the water texture like the Quake I water. The complete Pro water have sky reflections, and looks pretty realistic (not the underware effect). I'll check your solution - it seems good.
Answer by Muzz5 · Jan 21, 2012 at 05:41 PM
So you expect to find a free, very pretty water, which you can drag and drop into your scene, which suddenly makes it look nice? Does that sound sort of stupid to you? Keep looking, you won't find anything.
You have three options:
Buy - There is a very nice option, called smart water, by nikko, I think. It works fine in Indie, and isn't that expensive (around $70).
Code your own. Start with a translucent blue plane, and some perlin noise in colour and animation....it'll be great fun for you.
3.Make do with what you've got. This probably sounds like the best option for you, since (please correct me if I'm wrong) you're a beginner. Try changing the textures up a bit, perhaps add some translucency.
Anyway, those are your choices, or, you could keep searching, frustrum.
I actually had some success with importing the pro assets, taking the water4 scripts and tweaking them in the inspector until it works with the feature set in unity free (turn off edge blending and a few other things and you'll be able to get something that looks a bit better than the default free water)
I'm not looking for "very pretty water" just something that doesn't look like completely opaque blue goop. some transparency and color options would suffice
Also @ digitalConundrum
Would you happen to have those assets to share?
There's nothing really to share, I didnt modify any of the scripts directly, just turned off features in the inspector until it actually rendered (iirc i just turned off edge blending and reflections and refractions bc unity free doesnt support them) the assets should already be there if you import water(pro only)...though you may only have water3 if you're running unity 3.3...is there a reason you havent updated to 3.4? the assets I'm referring to (water4) shipped with 3.4 I believe.
I'm attending ITT actually and loving every $$anonymous$$ute of it. I'll have to look into that, hopefully it's too tough as i don't have any experience in shader editing either. thanks for the help and for not being so rude like $$anonymous$$uzz5
@muzz took me 3.5 secs on Google to find a free one better then the pro version.
Answer by 13dnizinski · Jan 03, 2014 at 12:06 AM
If you want nice water, you could try a script like the one above and duplicate your water object. If you make them both a little transparent and have one go at a different speed than the other, it looks pretty sweet.
Your answer
![](https://koobas.hobune.stream/wayback/20220613063202im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Reflective Water 2 Answers
Water with depth using Unity 3~4 0 Answers
Making of mercury,water models in unity 3d? 0 Answers
The water assets aren't showing properly 0 Answers
Unity3 (Free) Simple water jumps back periodically 0 Answers