#1572 closed enhancement (fixed)
[PATCH] Water effects enhancements.
Reported by: | wraitii | Owned by: | wraitii |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Alpha 12 |
Component: | Core engine | Keywords: | water, shader, graphics, patch |
Cc: | Patch: |
Description (last modified by )
(creating a ticket since it seems more convenient and Kieran recommended it on another matter).
So I've been working on updating the water shader effects. This features: -A new setting: "superfancy", in-game "advanced effects" I believe, which activates : coastal foam, waves, more realistic water depth and thus water rendering. -For fancy and superfancy water, a nicer and more customizable system for choosing the color of the water, based on both the tint and the color of the water. -The normal map that simulates waves has been enhanced: it's smoother on superfancy as it interpolates more between each frame(thanks to myconid), its effect scales with the waviness (which thus becomes much more visible a factor).
It's already pretty much up-and-running, and should be reasonably fast. The basic mode has practically not been modified, the "fancy" has been slightly but should be about as fast, while the "superfancy" is a bit slower, but not by too much on my computer.
Waves are still sort of a WIP at the moment.
This patch would fix #932, myconid added shadows on water. This patch sort of references #1501 (ship sinking effects could fairly easily be added, I believe). This patch may reference #1380. I don't believe it fixes it but it may change a few things (haven't checked myself).
(I'm still having a few troubles with this "patch" thing, so if it doesn't work, do report).
Attachments (3)
Change History (9)
by , 12 years ago
Attachment: | water.patch added |
---|
comment:1 by , 12 years ago
Component: | Art & Animation → Core engine |
---|---|
Description: | modified (diff) |
Keywords: | patch review added |
Milestone: | Backlog → Alpha 12 |
by , 12 years ago
by , 12 years ago
Attachment: | shore_wave.png added |
---|
comment:2 by , 12 years ago
Done. They should go in "binaries/data/mods/public/art/textures/terrain/types/water/".
(thanks for fixing my formatting errors).
comment:4 by , 11 years ago
Some comments about r12802:
It doesn't compile in MSVC, due to ambiguous use of sqrt
in WaterManager.cpp. I can fix the build error by casting its argument as a float, but you might want to look at this line and check that it's doing what you expect (especially w.r.t/ rounding).
Then about the entire file, there are issues with floating point types. Generally in C/C++ you should add an "f
" suffix to float constants, so 1.0
becomes 1.0f
. Otherwise the compiler will default to double precision which is probably not intended. In some cases, that causes a compiler warning (MSVC) when the assumed double value is stored to a float variable. See r12797 if it's not clear what I mean. You might look over the rest of your commit for this same issue.
Here's another example of ambiguity:
terrain->GetExactGroundLevel( (i+xx)*4, (j+yy)*4 );
The parameters of GetExactGroundLevel are float, i/j are signed integers, xx /yy are floats, and 4 is an integer. Personally I prefer making it explicit by casting integers as floats when they're used in float expressions, instead of relying on strange compiler rules :)
In that same line, some of the formatting is unconventional (we don't put spaces before and after parentheses).
comment:6 by , 8 years ago
Keywords: | review removed |
---|
Can you attach the textures separately?