Game Development Community

where's the water foam?

by Michael Taylor · in Torque 3D Professional · 02/10/2011 (8:54 am) · 33 replies

Water foam and whitecaps are almost invisible. I've seen this discussed here before but I can't find even that thread. Nor do I see a bug report for it. Is this a bug for all or just certain video cards?
Page«First 1 2 Next»
#21
03/31/2011 (9:30 am)
To be fair, although i posted above, compared to how it originally looked in the 1.0.1 use, it now looks horrid. whitecaps are redundant as even on the lowest possible setting it looks like your sea is full of fairy liquid...
#22
04/02/2011 (8:07 pm)
Well I looked at it again too and noticed that the foam properties were exposed in the Inspector in T3D 1.1 beta 2. This is also where the visible changes come in. So, I don't know, maybe the devs intended it to look this way.
If I turn off the whitecaps and soften the edges of the foam texture by blurring it a lot, it looks better. But not good enough. I think it needs fixing because even after blurring and turning down the opacity to 8, it still glitters in the distance. Shader problem maybe?
#23
04/04/2011 (4:51 am)
I'm not sure that it will be good enough for you but, using another foam texture might help : pic
#24
04/04/2011 (8:02 am)
Yea, that looks similar to what I'm getting now. I even thought of trying mipmaps to help the fade.
But what I'm really hoping for is that the devs will reinstate the quality rendering of it like beta 1 has! :) please
It's been accepted for review so that's something.
#25
04/09/2011 (12:30 am)
Hey Ladies, I've looked into the issue here...

After much tweaking and twiddling, we've decided to remove the whitecaps feature from Water objects and all classes that derive from it. At the moment it's just not where we want it to be. That being said, make the following changes to fix the ShoreFoam. Now my repo and your repo should be very different, so I'll try and describe the changes as best as I can.

in game\shaders\common\water\waterP.hlsl...

uniform float4	     sunColor;
uniform float        sunBrightness;
uniform float		 reflectivity;
//uniform float        whiteCapAmount; <-- DELETE THIS LINE
//uniform float3     sunColor; <-- DELETE THIS LINE

float2 reflectCoord = viewportCoordToRenderTarget( temp, rtParams1 );     
   
   float2 refractCoord = viewportCoordToRenderTarget( distortPos, rtParams1 );
   
   float4 fakeColor = float4(ambientColor,1); //<-- ADD THIS LINE

float4 foamColor = tex2D( foamMap, IN.foamTexCoords.xy );   
   foamColor += tex2D( foamMap, IN.foamTexCoords.zw ); //<-- LINE CHANGED
   foamColor = saturate( foamColor );

foamColor.rgb = lerp( foamColor.rgb, ambientColor.rgb, FOAM_AMBIENT_LERP );
   
   float foamDelta = saturate( delta / FOAM_MAX_DEPTH );      
   float foamAmt = 1 - pow( foamDelta, 2 ); // <-- LINE CHANGED

//if ( foamAlphaClamp > 0 )
      //foamColor.a = saturate( ( foamColor.a - ( 1.0 - foamAlphaClamp ) ) / foamAlphaClamp );
   foamAmt *= FOAM_OPACITY * foamColor.a; //<--UNCOMMENT THIS LINE

DELETE THE FOLLOWING LINES
float whiteCapFoam = whiteCapAmount + IN.rippleTexCoord2.w;
   if ( whiteCapAmount <= 0.0 )
      whiteCapFoam = 0;
foamAmt = max( whiteCapFoam, foamAmt );

Change the following lines

// If we do not have a reflection texture then we use the cubemap.
   refMapColor = lerp( refMapColor, texCUBE( skyMap, reflectionVec ), NO_REFLECT );
   
   fakeColor = ( texCUBE( skyMap, reflectionVec ) ); //<-- LINE CHANGED
#26
04/09/2011 (2:39 am)
so I dont understand,
are you removing the feature because you cant fix it?
or because no-one can get it back to how it was in 1.1 beta2?
in beta 2 it was great....

will there be foam or not??
#27
04/09/2011 (6:34 am)
That's more like it was Ray.
Personally I like without whitecaps on top of huge waves ... but then I prefer millponds for their reflectivity.

Looks nice with:
overallFoamOpacity = 3;
foamMaxDepth = 3;
foamAmbientLerp = 0.3;
foamRippleInfluence = 0.3;

Oh wait ... I just for a thing for 3's today ...
#28
04/09/2011 (7:25 pm)
@Ray,
Is this it? Is this what we're going to get in T3D final?

@Steve,
You got it to look like it used to with those parameters?
Care to post a screen cap?

I'm asking because aside from no more whitecaps and a lower opacity setting, it looks much the same to me. I can set opacity to 1 so you can barely see foam at your feet but at 100 or 200 yards, it stands out terribly sparkling and glittering.

Update:
I'm getting better results now by further modifying the foam image.
And thanks for looking into it Ray.
#29
04/12/2011 (1:05 pm)
@Deepscratch - We are not removing shorefoam. We only removed the whole "whitecap" feature, which were the little patches of foams that appeared on top of waves from time to time. We looked into the issue, and decided it would be better off to remove the whitecaps and move on to higher priority bugs and features. I've tried my best to restore the shorefoam to it's previous state.

Here's a picture of the shorefoam before the Whitecaps were implemented:

i56.tinypic.com/29gg5ee.png
And here's the shorefoam on a waterblock with the same settings. (Current)
i55.tinypic.com/1zbfmgn.png
There are a couple of changes, but you can get some really awesome looking effects with tweaking the WaterObject settings/Ambient Light/Sun Position/etc.

@Steve - Thanks : )

@Michael - This is what's going into 1.1 final unless there are any problems with it. If you're getting bright white, try tweaking the foamAmbientLerp setting. That should get you the results you're looking for. I'd like to hear everybody's thoughts.
#30
04/12/2011 (2:42 pm)
For what its worth Ray, I would say the foam, and the wave 'highlights'
look way better in your first SS.

Cheers,

Hewster.
#31
04/12/2011 (11:38 pm)
Yea Ray, adjusting foamAmbientLerp helped alot. I guess that replaces foamColorModulate from beta 1. I've been experimenting and I think I can get the look I want from it now. Thanks for all your efforts.
And I want to request a feature: add wave motion back to the two foam layers. But keep the linear motion they have now. ;) The linear motion is good for rivers and falls but I think the wave motion of old looks better in lakes, ponds and the ocean. The wave motion can pass for omnidirectional.
Again thanks for your good work.
#32
04/13/2011 (3:44 am)
thanks Ray, it does seem a bit more acceptable
#33
04/13/2011 (5:42 pm)
Fixed in 1.1 Final. (Should be in the Preview as well)
Page«First 1 2 Next»