So do you have a shader in Unity that pans the texture for ya?
Would a few particles being animated for foam be a better solution?
Then you'd need to place them in the world, and decide how they lod (if there's a lot of them).
And if you went the mesh route, does unity support non-uniform scaling?
You could emulate subtle wakes, by squashing the mesh.
Depending on the complexity of your existing sea mesh, you could use vertex colour along with a noisy texture to alpha out the edge, and whiten it in the process.
one last thing...
If you are making a custom mesh along the borders, you could just use the UV's v position instead of vertex colour in the alpha calculation.
mesh + one panning texture + simple shader.
(btw that shader code I posted could be optimised to not use the 1-)
diffuse += uv.y; // or add the noise texture.
alpha = step(uv.y, noiseTexture.g); //(terms might need reversing)
and to go even further with optimising, you could channel pack textures say from the sea. (so one texture in r channel, one in g).
Their might be one or 2 hiccups with this step approach.
(As I've only been thinking about the beach edge, not the sea edge).
Replies
[ame="http://www.youtube.com/watch?v=B2sl4nxSeqI"]UDK Ocean Shader Tutorial - Part 1: Setup and Foundation - YouTube[/ame]
My first explanation was a little hard to understand.
What im looking is a animation for waves reach the edge of the beach. (foam)
Are you using UDK mobile?
From what I remember briefly using it - it's materials are fixed function (ie. no shader networks).
Depending on how detailed the coastline is, you could model in planes for the areas where the foam is needed.
Having a flick through this page:
http://udn.epicgames.com/Three/MobileMaterialReference.html
I see you can pan texture, and do vertex animation... use this with vertex colour alpha (if it allows).
But im using Unity3D
So I trying to make it into maya, with UV scroll animation and mesh transform. without vertex animation (it a bit heavy for smartphone)
So do you have a shader in Unity that pans the texture for ya?
Would a few particles being animated for foam be a better solution?
Then you'd need to place them in the world, and decide how they lod (if there's a lot of them).
And if you went the mesh route, does unity support non-uniform scaling?
You could emulate subtle wakes, by squashing the mesh.
The animation is for a landscape, is not so close to the camera and is for Iphone, so not needed big details on it.
I must do it at optimize i can.
So super lowpoly, 2 textures (1 with alpha and other without alpha).
Is pure classic old school job i guess
Would be a simple shader if you could code it.
diffuse += 1 - vertexColour.a; //perhaps weaken this.
step(vertexColour.a, noiseTexture.g); //alpha (terms might need reversing)
If you are making a custom mesh along the borders, you could just use the UV's v position instead of vertex colour in the alpha calculation.
mesh + one panning texture + simple shader.
(btw that shader code I posted could be optimised to not use the 1-)
diffuse += uv.y; // or add the noise texture.
alpha = step(uv.y, noiseTexture.g); //(terms might need reversing)
and to go even further with optimising, you could channel pack textures say from the sea. (so one texture in r channel, one in g).
Their might be one or 2 hiccups with this step approach.
(As I've only been thinking about the beach edge, not the sea edge).