-
Posts
3.452 -
Joined
-
Last visited
-
Days Won
77
Everything posted by wraitii
-
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.
-
Post-processing effects test (SSAO/HDR/Bloom)
wraitii replied to myconid's topic in Game Development & Technical Discussion
@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. -
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.
-
Well, right now, the ARB and GLSL shaders give the same results and take the same inputs. When myconid implements his post-processing effect, I'll be able to improve the quality of the water with proper knowledge of depth, but in the meanwhile, this will do. I'll try to implement a basic foam, it should not prove too hard. Proper wave breaching is out of the question in the current version of the shader.
-
Post-processing effects test (SSAO/HDR/Bloom)
wraitii replied to myconid's topic in Game Development & Technical Discussion
Was parallax activated on the unit? @Don't overstress yourself: the less I can work on shaders, the more I'll work on my bot -
Post-processing effects test (SSAO/HDR/Bloom)
wraitii replied to myconid's topic in Game Development & Technical Discussion
Very good then... I'll just wait (and no, I indeed didn't need real raycasting, just some info about the heightmap, or the depthbuffer, though I hadn't thought of that). Would this (particularly points 4/5) require rendering the water twice? -
Post-processing effects test (SSAO/HDR/Bloom)
wraitii replied to myconid's topic in Game Development & Technical Discussion
I could use it for improving murkiness (calculating actual distance of light underwater), some sort of advanced refraction, and probably would be nice to have overall. It could also fix a rare, but possible bug with water being incorrectly transparent (if you look at the far side of a steep enough island). -
Post-processing effects test (SSAO/HDR/Bloom)
wraitii replied to myconid's topic in Game Development & Technical Discussion
Myconid, do you believe it would be possible to (at runtime) export an heightmap of the map? I think I could use it in the water shader to start doing some fancy stuff (simulating ray-casting for depth) Edit: scrap it, it may already be in the game…