-
Posts
3.399 -
Joined
-
Last visited
-
Days Won
76
Everything posted by wraitii
-
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.
-
Yeah, I've checked that out... I'm trying currently trying to get the terrain to give me some useful info, such as the normals (in x-z directions) so that I can put waves in the shaders. With luck, I could reuse Mythos' textures.
-
That helped more than you'd think: I couldn't get the darn texture to work properly.
-
Post-processing effects test (SSAO/HDR/Bloom)
wraitii replied to myconid's topic in Game Development & Technical Discussion
The better solution is always Blender rendering here. But for mod support, it could be practical to either include a script for calling Blender's AO, or having something in the game. It's probably easier to rely on Blender, though. -
FYI, in the current form of the shader, it should try to simulate a wavy ocean, but not one where waves are 3 meters tall. Something like this. It's practical because if can be scaled down fairly nicely. For really stormy seas, the current system is simply not working. BTW myconid, I'm still unsatisfied by the way the game currently gives you water depth and so on, so I think I'll try to do something with the heightmap anyway, in order to have an idea of the direction of the coast (could be used to properly simulate shore waves). I've merged with your waterTest branch, currently recompiling. And yes, new texture. Basically took some stuff on google, and modified it in photoshop. I'm using two textures, one rotated and moving differently, multiplying the result to give randomness, but it's not perfect.
-
The problem is that it is animated. If it is to be improved, we need 60 animated (seamlessy) frames. Current size is 128*128, using at least 256*256 would improve the quality. @Myconid: yeah, that's the idea. I'll scale it with waviness, so that on shallow maps like Oasis, if waviness is low, the foam won't be seen all over the place.