Jump to content

  • Log In with Google      Sign In   
  • Create Account

Flowmaps distortion


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Ilya.s   Members   -  Reputation: 346

Like
0Likes
Like

Posted 13 December 2012 - 02:45 AM

I've implemented flowmaps based on the following article: http://graphicsrunner.blogspot.ru/2010/08/water-using-flow-maps.html
For smaller values of flowSpeed everything is fine, but for larger values the water surface is getting extremely distorted. Is there any solution to this problem?
Here's how do the FlowMapOffset calculation:
    flowMapOffset0 += flowSpeed * Time.deltaTime;
    flowMapOffset1 += flowSpeed * Time.deltaTime;
    if ( flowMapOffset0 >= cycle )
		 flowMapOffset0 = .0f;

Small flowSpeed:
Posted Image

Large flowSpeed:
Posted Image

Sponsor:

#2 spek   Prime Members   -  Reputation: 996

Like
0Likes
Like

Posted 13 December 2012 - 04:08 AM

Not sure, but in the lower picture it seems as if you can see "tiles", where a tile is probably mapped on a single pixel of the flowmap. Using a larger resolution flowmap and having linear-filtering on that texture enabled helps? What doe you see if you directly draw the flowmap itself on the waterplane, instead of the water?

#3 Postie   Members   -  Reputation: 965

Like
0Likes
Like

Posted 13 December 2012 - 06:40 AM

My guess is that setting the offset back to 0 when it exceeds the cycle length is the culprit. At faster flow rates the offset will overshoot by more than with a slower rate, so there will be a more obvious discontinuity. Try subtracting cycle from the offset instead of setting it to 0.
Currently working on an open world survival RPG - For info check out my Development blog: ByteWrangler

#4 Ilya.s   Members   -  Reputation: 346

Like
0Likes
Like

Posted 13 December 2012 - 10:53 AM

My guess is that setting the offset back to 0 when it exceeds the cycle length is the culprit. At faster flow rates the offset will overshoot by more than with a slower rate, so there will be a more obvious discontinuity. Try subtracting cycle from the offset instead of setting it to 0.

No luck so far... Any other ideas? Using higher resolution flowmap didn't solve the problem.

#5 Ilya.s   Members   -  Reputation: 346

Like
0Likes
Like

Posted 14 December 2012 - 06:06 AM

I was able to solve the issue. In case somebody else encounters the problem, you just have to set the cycle to a much lower value. The optimal value for cycle is somewhere around:
cycle = 15.0f;





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS