Jump to content
Eternal Lands Official Forums
Lachesis

Patch: nicer rain, perspective view

Recommended Posts

Hi dear reader :D

 

I need some help testing a patch for nicer rain. This is the full featureset:

  • rain in 3D
  • full perspective view
  • rain starts and stops gradually
  • foggy view depending on light level and rain
  • variable rain heaviness (only on server eternal-lands.solexine.fr:2002)

Report problems* to this thread please. Thank you!

 

Update: This patch has been merged to CVS. You can test it using a normal CVS client now.

 

With regards

Lachesis

 

*) No compile problems please, unless they are really specifically for this patch.

Edited by Lachesis

Share this post


Link to post
Share on other sites
sounds cool! I'd love to try it..please let me know when there's a windows client available :)

182552[/snapback]

 

my words *g* :D

Share this post


Link to post
Share on other sites

this patch is now included in my precompiled windows file, you can grab it from http://ttlanhil.tripod.com/EL/client_102.htm

this is only for if you already have a set-up for the testing server. if not, see the testing server thread in programming for how to get going there.

 

all people who've been using the testing server, please update to this so we can give the patch a good work over to make sure we can get it in 1.0.2

 

and it really does look good :D

 

 

oh yes, the all important screenie! new rain

 

notice what happens to the reflections and in the distance on the stone

 

edit: man, the rain even turns gold near the lighposts... this is so much better!

Edited by ttlanhil

Share this post


Link to post
Share on other sites

hmm. first issue, not sure if it's a bug report or not. the distance checking to see how white something should be doesn't take into account the camera, so even if the camera is half a meter from the roof of a building, the building looks white

 

also, even at night things fade to white. perhaps fading to grey would work better at night (how much hassle would it be to have a regular early morning fog like this? :D )

 

and while it seems wrong to point out something not done when it looks so good, the complete mirror of the water surface kinda ruins the illusion of rain. that and the clouds being on the surface of the water

yeah, that's a whole 'nother issue I know.

I don't expect real-world interaction like this any time soon, but it's a point that could be added to the list (if I thought I'd have any hope I'd look at it myself... but no)

 

oh, and dunians' post is about how with perspective you can see a bit further in front than the renderer realises, and thigns may not get drawn on time

Edited by ttlanhil

Share this post


Link to post
Share on other sites

Its awsome! :D

 

The only thing is that when you have perspective you can see farther than the client realises.

Its sorta hard to see, so its not that big of a deal, but if you go to WS [504, 23], zoom all the way out, and rotate 360*, you'll see that the water is black. Its only a little corner thats visible, though. When i switched to isometric view i couldn't see the water at all.

 

Edit: Sorta gave a better description

Edited by Dunian

Share this post


Link to post
Share on other sites

I really love it, especially the fog adds to the overall atmosphere and experience of the world. I'm really looking forward to the rest of the atmospherics.

 

The only tiny little problem I noticed so far is, that relations and proportions have changed with the perspective view. Models that are closer to the 'camera' now take up much more place on the screen. Maybe the max zoomlevel could be increased for maybe 1 meter.

 

Great work Lachesis :)

Share this post


Link to post
Share on other sites

Darker fade at night

This is already implemented, I'm using the current ambient and diffuse light as well as the rain strength to determine the fog color (check weather.c:render_fog()). I even give a penalty on diffuse light at night and in dungeons because there is less lighting overall. Maybe I should mix the sky color in, too.

Update: done

 

Full reflections

Yes, actually the water surface should be messed up by the rain. Especially light rain is a problem here because it distorts the reflections but doesn't completely hide them. And even for heavy rain we need new textures and animation mechanisms. Maybe we can add that in a later patch. There we can remove the clouds, too.

 

Foggy objects close to the camera

This is because the fog is not calculated with respect to the camera, but your actor's view. Objects very close to the camera are as far from your actor as objects very far from the camera, thus they look as foggy. Changing this would require quite a bit work because we had to keep the projection matrix at identity and put the projection into the modelview matrix, or we'd have to use a more expensive alternative to glFog(). It may look a little unfamilar at first, but I think it's better to leave it the way it is, so you see what your actor sees.

Update: Fog is now relative to camera position. This means your actor will be fogged if you zoom out in heavy rain!

 

Parts of the scene missing

Please give me some more informations on that, maybe a location where I can see it and a screenshot. The number of ground tiles drawn has already been changed, maybe we need to modify nearby objects a little or zoom a little further in.

 

Bigger objects in front of the camera

This is typical for perspective view and I wouldn't want to avoid it, because it's what makes you feel to be right there in that foreign world :) If it disturbs you in gameplay, you can switch back to orthogonal projection at any time using the "isometric" config option. A greater viewing distance would not help much here unfortunately, because only more objects would appear in front of your actor. A smaller viewing distance might help though.

Update: Moved the clipping planes to cut off objects behind camera. Camera movement should look more realistic now.

Update: You can set the distance for the clipping plane in the config window now (see below).

 

With regards

Lachesis

Edited by Lachesis

Share this post


Link to post
Share on other sites

I have 30-50% performance drop when fog is enabled.

 

Without: 34-36 FPS

With: 18-25 FPS

Chipset: nVidia GeForce FX 5200, 128 MB RAM PC3200

Platform: AMD Athlon XP 1800, 256 MB RAM PC2100

 

But please don't clutter the thread with such information now. If we have five examples that's enough.

 

Lachesis

Edited by Lachesis

Share this post


Link to post
Share on other sites

Looks really good :)

 

only problem/bug I saw was that the objects with alpha are not rendered properly in the rain/fog. (like the ss gravito posted)

Share this post


Link to post
Share on other sites

The issue with close objects being fogged shouldn't happen with perspective projection. Fog distance is calculated from the origin(0,0,0), where the camera is supposed to be, unless you have put the code where you set the camera position inside the projection matrix.

 

Also, to avoid handling problems differently between ortho and perspective, you can ditch ortho altogether and "fake" it by using perspective projection with really low FOV. It appears almost the same as orthographic.

Share this post


Link to post
Share on other sites

Hi,

 

Personally I find the new rain too visible, it disturbs the sight. It is extremely tiring for the eyes, which tend to try to follow the droplets. Therefore the eyes and brain concentrate on the rain instead of the game.

Share this post


Link to post
Share on other sites

I noticed this while watching the rain in VotD.

 

FogShadow.jpg

 

To me the shadow of the arch is out of place when there is fog on the ground. I don't know if you want it this way but to me it looks odd.

Share this post


Link to post
Share on other sites
The issue with close objects being fogged shouldn't happen with perspective projection. Fog distance is calculated from the origin(0,0,0), where the camera is supposed to be, unless you have put the code where you set the camera position inside the projection matrix.

 

Also, to avoid handling problems differently between ortho and perspective, you can ditch ortho altogether and "fake" it by using perspective projection with really low FOV. It appears almost the same as orthographic.

182665[/snapback]

Unfortunately, the camera position is at your actor's eyes, which didn't matter for orthographic projection. For perspective, of course I had to move the camera back a little (exactly 33.0) to achieve the same scale of your actor. However, that messed the shadows up completely, and also most of the scene disappears in the fog. Let's assume I can fix the shadows. Then I have to reduce fog. But because all of the scene is that far away, the fog blending value is almost the same, so it just looks like gray curtains. The problem is that the fog equation is

 

fog_alpha = 1 - exp(-density*z)^2

 

What we'd need would be

 

fog_alpha = 1 - exp(-density*(z-33.0f))^2

 

for it to look good, so that the fog doesn't start in front of the actor. I tried linear fog which has a near distance, but it looks like crap. The experienced eye requests exponential falloff it seems. So I have to make the z coordinate attain zero at the actors position. But that causes objects between the camera and the actor to be fogged. No idea how to work around. :/

 

Update: found a trick

Edited by Lachesis

Share this post


Link to post
Share on other sites

as far as where parts as missing, I can give a couple of examples. edges of maps can cause issues, and you can see these in places... the VOTD exit to NC, or going to the east side of the docks in PL, you can see the waters' edge. neither of these are that noticable until the rain falls on them (and stays when it hits) though... I'm sure there's more, those are just the ones that come straight to mind

 

also, reflections are an issue here (of course. depending on the height of the tree/etc, you could be seeing up to 3x as far as you should(and that extra distance means they're extra fog-white, as another issue :hiya: ))

if you want an example, in VOTD facing SE, going from 67.46 to 68.45 will cause a tree's reflection to appear in the lake

 

increasing the amount of land rendered just for shadows, though... probably not worth it

Share this post


Link to post
Share on other sites
I think it should be a bit lighter too. More transparent... It a bit disturbing, but looks so nice :P

182708[/snapback]

Update: The rain is way more transparent now.

 

 

Hi everyone,

 

I have updated the patch and incorporated some of the suggestions mentioned here. Please see BerliOS for full details of the changes, or just check them out yourself :hiya:

 

With regards

Lachesis

Share this post


Link to post
Share on other sites

If you are standing and sea level (0.0), this shouldn't happen. The min zoom was changed to avoid that, maybe these hunks of the patch failed with you? If you are in the mountains, this is because you are moving the camera inside the mountains. I changed the zoom to true camera movement on request, unfortunately this is the one of its effects. If it wasn't too expensive in development and processor time I would prevent moving the camera inside objects. Yet we have to choose between camera movement and zoom. Camera movement means looking inside objects, zoom means objects behind camera are drawn. Any position between these extremes is possible, like drawing objects that are not more than a certain distance behind camera, but the tradeoff remains. Sorry :D

 

Update: the distance of the clipping plane is configurable now. Set it to 40.0 for the old behavior (no clipping), and to 1.0 for the modified behavior (full clipping), or experiments with values between.

Edited by Lachesis

Share this post


Link to post
Share on other sites

Hm, why not just do both? Have the option to set the camera distance from the player, and also the zoom. For example PgUp/PgDn(IIRC that's the keys) will zoom in/out, SHIFT+PgUp/PgDn will set the camera distance.

 

Also, a nice effect on rain drops is to not make them have a solid alpha all over. If you give low alpha to the vertex that "points" up and higher alpha to the vertex that points to the ground, it looks much better.

Share this post


Link to post
Share on other sites
Hm, why not just do both? Have the option to set the camera distance from the player, and also the zoom. For example PgUp/PgDn(IIRC that's the keys) will zoom in/out, SHIFT+PgUp/PgDn will set the camera distance.

 

Also, a nice effect on rain drops is to not make them have a solid alpha all over. If you give low alpha to the vertex that "points" up and higher alpha to the vertex that points to the ground, it looks much better.

182917[/snapback]

I think having both would be too confusing, also we'd have to check how both values add up to the final scaling so that we don't get more than 4x zoom. But maybe an options flag which mode to use or a float value between 0 (plain zoom) and 1 (plain camera movement) would be desirable? The gradient alpha is a great idea, however it'd mean that I cannot use a single glColor4f() call for all drops anymore. Since they're rendered using glVertexPointer(), I'd either have to split that up into a loop or use a color or tex coord array. So that'd be the usual niceness / performance / memory consumption tradeoff. Not sure which solution to choose here. What would you do?

 

Update: Implemented a configurable distance between clipping plane and your actor (see above).

 

Info: This patch has been merged into CVS. That means it'll be probably included in the next release.

 

With regards

Lachesis

Edited by Lachesis

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×