Workaround for water shader bug in landscape orientation

Hi,
We don’t have enough time to fix it properly for 3.2, so here is workaround:

first in Water.cs CreateWaterObjects add this where you create render textures:
m_ReflectionTexture.wrapMode = TextureWrapMode.Repeat;
m_RefractionTexture.wrapMode = TextureWrapMode.Repeat;

Then in shader itself in vertex program locate lines
#if defined(HAS_REFLECTION) || defined(HAS_REFRACTION)
o.ref = ComputeScreenPos(o.pos);
#endif

and change it to

for landscape right orientation:

#if defined(HAS_REFLECTION) || defined(HAS_REFRACTION)
#ifdef SHADER_API_GLES
	float4 ref = ComputeScreenPos(o.pos);
	o.ref = float4(ref.y, -ref.x, ref.z, ref.w);
#else
	o.ref = ComputeScreenPos(o.pos);
#endif
#endif

for landscape left orientation

#if defined(HAS_REFLECTION) || defined(HAS_REFRACTION)
#ifdef SHADER_API_GLES
	float4 ref = ComputeScreenPos(o.pos);
	o.ref = float4(-ref.y, ref.x, ref.z, ref.w);
#else
	o.ref = ComputeScreenPos(o.pos);
#endif
#endif

If you know another broken shaders feel free to poke me (outline is fixed for 3.2)
Hope this helps

Anyone know why reflections look so flat (fresnel ‘look’ where foreground is darker and less reflective) on ipad2? Is this related to the above post or to ipad2 having changed the way luminance displays?

Is outline fast on mobile or is the copy a mesh reverse normals approach still best for mobile?

So, having installed 3.4 and built one of our for the iPad2 I have to wonder…was this really fixed in 3.4 as mentioned in another thread? It would seem it wasn’t?

Taking a look at the code, the changes above are indeed implemented into the script and shader used by Daylight water. However, the result on the iPad is still wrong. Also, whereas before the fixes worked - they don’t seem to any more?

I have tried to make sure I actually have the latest asset package imported and I am fairly sure I have. Any other sources for this error would be very welcome!

Thanks in advance!
Dan

It turns out I had imported the latest asset package - but it does not include the water/fx shader and water.cs script any more. There is now only the Water4 examples and sources. While I understand the focus on a new water rig, it is disappointing to see assets disappear. Especially since they are useful for mobile development and we were promised a fix in 3.4…

Are they anywhere to be found? Am I missing something here?

Cheers,
Dan

Still not fixed in 3.5.5?