Jump to content

wraitii

WFG Programming Team
  • Posts

    3.395
  • Joined

  • Last visited

  • Days Won

    75

Everything posted by wraitii

  1. 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.
  2. 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.)
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. 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!
  9. 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.
  10. I quite agree, though a warning is always nice (we could deactivate specific stuff it they would cause a bug, however).
  11. 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).
  12. 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.)
  13. Thing is: sometimes there is one tile that's impassable. If there is an entity on it, it's finished, the whole map can be scrapped... I believe this is a huge limitation.
  14. We'd need a script to remove gatherable entities on unwalkable terrain. On most maps, to achieve a good result, we have to have some overlapping (I'm thinking, for example, Pyrennean Sierra).
  15. 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.
  16. 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.
  17. 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.
  18. That helped more than you'd think: I couldn't get the darn texture to work properly.
  19. 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.
  20. 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.
  21. 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.
  22. @HistoricBruno: technically, AO could require a lot of "rays" to be precise. It can probably be approximated fairly well, for example with SSAO. I'm fairly sure we can't get a result as good as Blender's, but for most model, and approximation should be enough. However, I agree that it would be the most straightforward way.
  23. The problem with that system is that it requires the water plane to have more vertices than it currently has (I'd say at least 4 times more), and it would then require to calculate each frame the water physics. While it's certainly possible, it's way slower than what we have know if we want a proper result. It's far from impossible, but it would really only benefit for simulating stormy seas.
×
×
  • Create New...