Can I either:
a) change the shape of the Nighttime Water prefab to something besides the weird oval?
b) Get it to look like it does in the Prefab on my own geometry? When I place the Nightime Water material on my plane, the water looks thin and stretched - almost like the UV’s were projecting the wrong way (although I’ve checked the UVs and they are correct).
You can use the nighttime water material on any object. Is your plane rotated the right way around? The material really only works on horizontal surfaces; try the built-in plane (Gameobject → create other → plane) which works fine. The prefab just has the water wave scroll script attached, which is used for an effect on old cards that can’t render water properly. So you can add that script to any object too.
Water uses a couple of scripts and materials to actually work. So the easiest way to change the geometry is dragging the example prefab and changing the Mesh it uses. Full docs are here.
Make a lowpoly-copy of the boat, flip it on the horizontal axis, and let the mesh deform a bit back and forth by script… place it under the original boat and make the water slightly transparent… maybe that can fake a little reflection? Also use an animated texture with those typical underwater patterns on the “Mirror-object”. Might help to make it more realistic…
By the way… nice atmosphere in your screenshot! Cant wait to fire some torpedoes there!
You can use the mesh scripting interface to do that. There would be some math involved though, but maybe you could get decent results just by applying some sine waves. You could probably even have some interaction with boats on it, but that would start getting a little complicated. Probably best just to fake that part.
you can access the vertices in the mesh and move them. you’ll probably need a pretty dense mesh and some tweaking to get it good. unity can move a fair amount of verts tho. see the procedural example for how to.
-Crumple mesh is very jerky, I like the mirrored boat idea. I’ve also tried animating it with lots of little bones, but that looks very similar.
Haven’t tried sine curves, that sounds more like it.
Excuse my ignorance but what does it mean at the top of a script where it says… the Author is not responsible for any harm or damage? What sort of damage? If I start writing scripts what sort of potential risk am i facing?
Aras…thanks much. I swear I had read that same documetation 4 times and for some reason misunderstood that Mesh Filter. Thanks for pointing me at it again. Worked great.
The sinus curve modifier worked the best… I tried mesh morphing 3 ocean meshes together but couldn’t get it to cycle.
Not as choppy as I would have liked but it’s a nice rolling sea. how would I modify the script so there is another curve perpendicular to the existing one?
That gives you a wave only on the Z axis. If you change z to x, then you get a wave only on the X axis. Stands to reason that you can combine the two, and cut the scale in half so it stays consistent:
hey all, excellent resources on this page. I also found a couple of interesting things Water Rendering and Simulation and on this opensource opengl project. I’m really interested in the realtime Tessendorf simulation that they discuss and would really like to introduce it into a simple project I’m doing… I guess I wanted to know from you how much I could get out of Unity in terms of real time simulating a single ocean environment vs. coding in pure opengl which i’m a also a bit familiar with. Any tips appreciated.[/url]
How did you go with your projects meshpig and wadamw?Cheers
Still at it… but that’s funny because before danger from the deep was ported to mac, you could download the source files which included all the scripts for the water. I mean i have had them for a while. Now you can just downlaod the game and play it incomplete.
I was just going to post the obvious question, since I think it’s in C sharp, how much of that is usable in unity not being familiar at all with coding and on indie until?
This topic interests me also. How are you making the objects “float”? I added a collider and rigidbody to a sphere, but it doesn’t seem to be interacting with the plane surface properly. How should it be working?
I also thought that the boat’s bobbing could be made a bit more realistic looking by using an collider attached to an empty GO, then attach your boat to that with a spring.