Island is a awesome demo that can give max support for any basic organic environment. Though it’s not possible to bring all of it in iPhone as it’s a PHONE ;).
Anyway, in my case I took the Foam Wave animation. Foam Shader is a single pass shader and simple enough for iPhone. In editor it’s looking good and working great as it’s iMAC. In iPhone it’s getting pixeled. Here is the image. 1 which was taken from iPhone and 2nd was taken from iMAC.
Can anyone help to remove the pixeled effect or any suggestions?
Sorry to side track your post but did you say that you’ve got an ocean wave “foam” shader running in Unity? :shock: If so, please post to this thread I started regarding ocean waves / shaders in Unity:
http://forum.unity3d.com/viewtopic.php?t=17621&highlight=ocean+wave
It’s the one from the Island Demo BK
As far as the pixelation is concerned, it’s most likely happening from the UVs being offset to animate the waves… iPhone hardware does not like the UVs to stray too far from the 0-1 range. Plus if I remember correctly that foam mesh is UV mapped into one very long strip that goes way outside the 0-1 UV range probably contributing to the inaccuracies.
Some links to other threads on the topic:
http://forum.unity3d.com/viewtopic.php?t=19172
http://forum.unity3d.com/viewtopic.php?t=19685
Oops! Sorry, didn’t recognize it.
You are right. There are two texture in the Foam Shader. Base texture and CutOff texture. Base texture tilled: x = 1500, y=5.00 and cutoff x=150.0 y=1.0. with out tilling we can’t get effect like Island demo :(. In that case we can do:
- create sea shore wave plane and apply texture 0-1 range
- this texture should contain foam and scroll from 0-1. This will give effect wave coming to sea shore
- overlap sea shore plane with some displacement and used same script to scroll the UV [Prefab or so]
This is will be like Kroll water wave I think.
One thing I need to clarify, in my game I faced that issue before. I used tilled texture there, so it’s the same issue. Another standard is coming for iPhone is: “WE SHOULD NOT TILL mesh texture”- right?
wrong
but you should tile using real quads and having alternating UV positions meaning 0 - 1 - 0 - 1 - 0 if you go along a tiling direction.
you shouldnot tile using UV coordinates of 2 and higher
On the iphone you get into inaccuracy cases very fast, especially on the UV end, leading to ugly visual artifact problems.
That gives me an idea about tiling.
Lets say we have a grid of vertices, and we triangulate those square grid cells randomly, so that some have triangles dividing them in one direction, and some have triangles dividing in the other direction.
We then take a tiling texture - i.e. one that matches on the 4 edges.
But we also make that tiling texture have the property that it can reflect across the diagonals and still match - i.e. we can take one half one the texture, flip it over a diagonal and still have the mirrored texture look good.
basically if you start with a square texture with corners ABCD, you can tile it like this:
AB
DC
now add another grid cell to the right
ABA
DCD
or
ABC
DCD
or
ABA
DCB
as the grid grows, there are constraints, but there are always choices.
not sure how this would end up looking, but its an interesting idea