-
Posts
3.434 -
Joined
-
Last visited
-
Days Won
76
Everything posted by wraitii
-
I dunno. I fear all maps would have to be reworked: since waviness has been completely changed, all oasis maps for example look quite wrong. The different murkiness means that tint also looks differently on some map, it may be darker/lighter than expected. I'll try to make sure that all settings give out about the same expected result for water tint, and more generally murkiness (I might put the depth buffer trick even in the regular fancy shader, it's not that expensive and it looks so right). But I think most maps would have to be redone. Again, I'd ask some of the game mapmakers/artists. base specular strength may also need to go from 0.4 to something like 0.6/0.7.
-
Well, my understanding of the "murkiness" factor was that it did not represent actual murkiness, but rather was an abstraction of how clear a water was. The "tint" being the color of the water (so if you'd want a muddy water, you'd set murkiness high and the tint would be brown). Color extinction is simulated in that the refraction color gets more tinted (sunColor*tint) as the depth increases, with murkiness as the parameter (see my first sentence). I could mingle with the parameters to make it happen earlier, but I'm not sure it's necessary, I think this decision should be up to the team's artists anyway.
-
That's the last I uploaded, so that's a yes. Well, thanks then
-
1. On the optimized version? I've moved things around, so I may have missed a few stuffs, but I thought the second (optimized) version was right. 2. hadn't thought of that, and it seemed to work for me, but I'll change, thanks.
-
Can you debug that? I'll see if it's the same cause as mines. Anyway, I've finished modifying to take the depth buffer into account (using gl_fragcoord). Here's some candy: The "normal" fancy shader shows the same transparency everywhere. The "super" fancy shows the water getting more tinted with "eye depth". You'll notice that you can make out the blob in the background, underwater: it looks clearer as it's nearer from the surface and eye. I'd need a proper luminance map to make it perfect. On the tower shot, you'll notice refraction going stronger as the depth rises. (Still have to fix the shores, though). (no foam, waviness is too low).
-
Always? By loading, you mean load a map? I get a few segfaults now and then which I'll have to track, but not always. @zoot: I need to know if x is [PI/2;-PI/2 ] or [-PI/2;PI/2], pretty much.
-
I dunno how I got it to work, but I did the same z_n/z_b stuff to gl_fragCoord.z and the depth texture, and by substracting the two I have a usable value. I dunno if it represents the distance accurately (in game tiles) but it works (I've had to distort the coords along the water normals arbitrarily too, or models close under the surface did weird things). The only problem is that it looks like gl_fragcoord.z is glitched on some ATI cards…
-
Well, I tried to do it, but I guess my island is either too smooth (highly possible) or my parameters are wrong. I'm still messing around with the depth buffer… Had a fun problem with fishes that made everything wrong. Darn fishes.
-
How would you fix that, Shield bearer? Or rather, what result would you expect? I'm working on using the depthbuffer for (more) realistic water murkiness.
-
It's not too surprising that it's slow: with Myconid's improvements, it's gone from 4 texture sampling to 9, and more calculations are added. I've committed a new version, which features many small optimizations (won't make it twice faster, but could gain a few FPS). I also added an option in default.cfg to enable/disable advanced effect, so now you can choose between three LOD: (the superfancywater adding foam, shadows on water, normal interpolation, which incidentally is what myconid and I added to the basic fancywater.)
-
I just did a fair share of optimizations... Zooming as far back as legally allowed, it takes about 7ms on my computer, and the water refraction/reflection take about 5, I think it's okay given the effects. We might want to consider updating the refraction/reflection maps one at a time for a cheap optimization, too.
-
Just realized I did a ton of unuseful stuffs with my texture, I hadn't noticed that PatchRData was about setting up this sort of stuff... I'll update, and keep my texture for other info I might find useful. @Zoot: I'll probably do something along those lines. Edit: ah, nah, I'll have to do with the texture for the normals but won't need the heightmap.
-
SimCity 4 (at least) had a nice erosion script. I'm sure you can find some references online for how they did it. The basic idea is to accentuate small local discrepancies. The problem arises when there is no discrepancy, as you have to create them. To simulate it properly, we'd have to consider the terrain (rock, grass…). I'm sure we could get a nice result for any map in under 5 seconds of computation, which remains acceptable to me.
-
Okay, I've committed the foam. No proper waves for now, I'm not sold on how to do it... Should it be on the shader, using the distance to the coast as a reference? A decal? I'll probably try to add some sea foam on high waviness later. It only works on GLSL for now (the code is messy and I do a fair amount of calculations, so I haven't yet bothered porting). Needs recompiling (tell me if something goes wrong, I've had some serious troubles with git at some point and some files may be missing/corrupted). The effect is scaled with waviness and slope, it's not perfectly realistic but I think the result is quite all-right already. If someone wants to give a look at the code, I've modified slightly WaterManager.cpp/h and TerrainRenderer.cpp (more). There's a "WaterTest" demo that showcases it on small island. Check out the Mediterranean Coves scenario, too.
-
Well, what I tried yesterday was "difference between 1 and the Y value of the normal". That gave me an indication of how slopes the ground was, which seemed to work fairly nicely. I'll try to add some basic wave effect today, and if I succeed or fail, will clean things up and commit. The last improvement would then be to use the z buffer to have a more realistic water depth.
-
Previewing a map in the game setup screen.
wraitii replied to Spahbod's topic in Game Development & Technical Discussion
Looks really nice. I still think we could have, on the map list, a "All" setting that shows them all split into categories, but other than that it looks really nice! -
It would, but it gives weird results on maps like Oasis, and generally shallow maps. Technically, realistic result would be achieved by calculating "difference in water depth", which I might try. @Myconid: actually, I ended up using the x-z vectors of the terrain normal, so I get the "direction" of shore. With a bit of blurring, the effect is very nice.
-
Post-processing effects test (SSAO/HDR/Bloom)
wraitii replied to myconid's topic in Game Development & Technical Discussion
I quite agree, though a warning is always nice (we could deactivate specific stuff it they would cause a bug, however). -
Post-processing effects test (SSAO/HDR/Bloom)
wraitii replied to myconid's topic in Game Development & Technical Discussion
I'm not sure we'd need that level of realism, though of course it could be "easily" implemented, it's just a matter of computing power. BTW, Myconid, you/we'd have to start thinking about adding new graphical stuff as options that can be activated/deactivated easily. Some of this stuff is CPU/GPU intensive. (And if you check this thread, you'll see I finally managed to solve my GlTexImage2D issues). -
Not yet, I had another git problem. Here's a screenshot in the meantime. (this shows my waviness improvements, Myconid's shadow on the water, Myconid's smoothing of the water texture and the foam) Of course, it looks much better animated… But I'd rather wait to have added a few more stuffs before uploading (namely, a "distance to shore" parameter for some stuffs.)
-
Okay, I got the foam to move to properly simulate wave coming and going on the shores depending on the shore direction. It's still not perfect, but it's better.
-
This looks good, but fairly small, which could make it look not too good. For "dynamic" water, the usual cheap system is using two textures and multiplying their normals. For those who have it, start Anno 1404: on low quality settings for the water, if you speed time up, you'll clearly notice it. The fact that negative values of the displacement map are not computed is bad, that'd look very weird in-game, I think.