Jump to content
Sign in to follow this  
wraitii

Of water and waves

Recommended Posts

Okay, updated patch with the new texture, improved positioning for the waves, some basic foam around the waves.

The images should be added by the patch, this time, so nothing else to do.

(updated for the latest SVN revision, too).

I'm thinking this is the first "working" version. Take a look, report problems or inconsistencies, and suggestions for improving. If all goes well, I might be able to commit it before feature freeze.

Should I Trac this in the optic of committing or is it as good in this topic?

Edit: for those who feel it is too slow... I've run the Xcode profiler (really awesome stuff there) and found that creating/destroying textures was really inefficient. So I stored those instead to reuse and now the super fancy water shader is basically two times fast.

Edit: new patch 3 hours later below.

Share this post


Link to post
Share on other sites

Okay, so I'm creating patches way too fast for anybody to follow, but I figured I was kind of "over" with this whole wave business until some people made remarks, so here is the latest version: foam has been slightly improved iirc, a few other stuffs, and a huge speed improvement (on my computer, RenderWater() has gone from being twice as slow as all other rendering functions to being faster than "RenderReflections" on most maps.)

Same thing, just apply the patch and it should work. I've added the test map for those who want to see it, so it's a bit heavier.

water.patch

Share this post


Link to post
Share on other sites

Wijitmaker, thanks for the waves. To clarify what I needed, I needed mostly an image like your "wave_17" one. The animation could be used to introduce slight perturbations on that particular image (I don't need the wave to move in the texture, because of the system I use).

I can do the conversion to normal myself.

Sure, can do. So, no moving and do you want it to rise and fall - or just simply to undulate?

Share this post


Link to post
Share on other sites


patching file binaries/data/mods/public/art/textures/terrain/types/water/foam.png
patch: **** malformed patch at line 1113: \ Pas de retour chariot à la fin du fichier

"No new line at end of file". It also appears in the patch, at the end of all binary files.

Share this post


Link to post
Share on other sites

Looks like SVN adds some stuffs in French here and there ("\pas de retour chariot" and some "Modifications de propriétés"). I removed them all by hand, this should work.

water.patch

In case it didn't, here's the patch without the binaries, and the two texture files separate.

water_nobinary.patch

BTW, it looks like I could use a 3D texture "fairly" easily for the waves. So if someone wants to create some sort of "breaching" animated texture (in the same style: the wave would not actually "move" on the texture but the normal map would transform to simulate breaching), I might be able to achieve some result.

post-9128-0-71927500-1343806156_thumb.pn

post-9128-0-56693800-1343806157.png

Share this post


Link to post
Share on other sites

Not yet. Myconid had done some nice groundwork on it, but I believe he postponed final implementation for the time being.

Share this post


Link to post
Share on other sites

Got this to work again against the latest SVN, no noticeable issues appeared. Should I post a patch to be reviewed or should I commit and then quickfix if by bad luck it does break a few stuffs?

(Asking because it's basically mostly art.)

Share this post


Link to post
Share on other sites

Well, if it affects ARB(?), probably best to post a patch for review. GLSL is slightly different in that it is opt in, so we don't need to worry about it temporarily breaking. But with ARB, we need to make sure it works on most devices.

However, we're still a little while from release so if you feel it's stable, and you'll be online in IRC for a few hours after you commit to fix issues, then maybe it would be alright.

Of course, make sure you code is as clean as possible, complies with coding conventions, etc etc. When you look at the code, you should be able to say "This is clean, simple, and optimized.". We don't want a whole lot of code and complexity for little gain.

Share this post


Link to post
Share on other sites

I think it's only GLSL at the moment, wether it's activated or not. There were no ARB water shaders before, and I haven't ported those yet.

I'll do a series of testing tomorrow, check the code is allright and then commit-IRC if I feel it's allright.

Share this post


Link to post
Share on other sites

Okay, there is a conflict with the post-process manager and the very high quality water shader, which is a bit too bad obviously. I believe it's linked to the depth buffer, Myconid's probably changed something at some point. Should be an 'easy' fix (though not right now, I'm getting a haircut)

Share this post


Link to post
Share on other sites

I'm not sure what the conflict is, and I don't remember what your code does exactly, but if it contains a line similar to this:


pglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);

then you need to do this instead:


// first save postproc fbo:
GLint fbo;
glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &fbo);

// do stuff in another fbo
pglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, wraitiifbo);
...

// rebind previous fbo
pglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);

Share this post


Link to post
Share on other sites

And of course that's what it was, thanks a lot Myconid.

Okay, I'm taking various screenshots because it looks cool and the new post-proc effects are dead awesome, then I'm busy for a while.

I think I'll commit tomorrow morning in case there's any problem. Else I can do it in circa 4 hours, but I'll only be here on and off for 5/6 hours.

Link to said screenshots (I'm digging the full skyboxes BTW, but the lower bound should be slightly below the horizon. On the "man" image, I had to touch up the horizon because there were black lines). Apart from said slight touch-up of the horizon, it's all in-game screenshots.

  • Like 4

Share this post


Link to post
Share on other sites

And of course that's what it was, thanks a lot Myconid.

Okay, I'm taking various screenshots because it looks cool and the new post-proc effects are dead awesome, then I'm busy for a while.

I think I'll commit tomorrow morning in case there's any problem. Else I can do it in circa 4 hours, but I'll only be here on and off for 5/6 hours.

Link to said screenshots (I'm digging the full skyboxes BTW, but the lower bound should be slightly below the horizon. On the "man" image, I had to touch up the horizon because there were black lines). Apart from said slight touch-up of the horizon, it's all in-game screenshots.

Awesome!

-progressive darkening of the water based on depth!

-foam!

-shadows on the water!

-waves!

Really nice Wraitii!!! :D :D

The processing cost is not very high, right?

Share this post


Link to post
Share on other sites

From earlier testing, the medium setting is on par or faster than the regular one. The super high quality one is probably slower, but I believe it's acceptable...

I could fine tune it and add more settings for customization (enabling waves, foam, realistic depth, shadows independently, mainly) if it's needed.

Share this post


Link to post
Share on other sites

@wraitii Good work. Go ahead and commit this, and we'll soon find any issues that need fixing.

@myconid If you can spare some time, after wraitii has committed his code, to review it, that'd be good. It's alway good to have two pairs of eyes on large code changes.

Share this post


Link to post
Share on other sites

Should be committed... And it's probably a bit too late for "before" screenshots, unless someone else wants to do them.

Else I could try recreating an existing screenshot.

Share this post


Link to post
Share on other sites

That would be cool :)

Also: could you write a very short summary of your new water shader? I'm not that technical :P

Share this post


Link to post
Share on other sites

Some before and after screenshots would be fabulous for next week's report ;)

Before:

ivXmJu8E47SGC.png

After:

iir77WdfqibVk.png

wraitii: Is there some way you can make the waves curve to fit the shoreline? I think that would probably help to make them not seem as fake...

Share this post


Link to post
Share on other sites

@Zaggy: frankly, I don't believe there's an easy way. It should be possible, but using a different system than the one I'm currently using, and I'm probably not going to have enough time to do that now.

(note that I'm not completely happy with waves. If most people feel they look fake, I'll deactivate them for the time being).

Share this post


Link to post
Share on other sites

@myconid If you can spare some time, after wraitii has committed his code, to review it, that'd be good. It's alway good to have two pairs of eyes on large code changes.

OK, will do. Over the weekend.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...