aeonios Posted February 8, 2016 Report Share Posted February 8, 2016 I've been working on water rendering and mostly figured out how it works. It isn't yet screenshot worthy (and screenshots are terrible for conveying water effects) but I have made some definite progress already. Thus far: -I reduced the refraction displacement by half, which looks a lot better -I reduced the reflection distortions by more than half, which also looks a lot better (although it still needs some tuning for distance effects) --Currently I'm working on tuning the intensity of reflections and the fresnel factor used for intensity scaling. To Do: -Shore waves need more foam, and should produce foam trails when receding as well as when advancing. Also: shore waves seem to be recalculating the shoreline every frame, which may be contributing to the expensiveness. The shoreline really should only need recalculating if the terrain is modified or if you change maps entirely (ie in atlas), and should additionally be cheap to cache. It seems like someone was aware of that at one time but it just never got done. 4 Quote Link to comment Share on other sites More sharing options...
aeonios Posted February 8, 2016 Author Report Share Posted February 8, 2016 I found a weird bug with ocean waves. If you set the wind direction north (or move the slider to the left in atlas) at some point it starts producing weird black patches where the waves should be. Moving the wind slider to the right gets rid of the artifacts, and they don't seem to appear if you rotate the camera around the waves, only when changing wind angle. 1 Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted February 8, 2016 Report Share Posted February 8, 2016 1 hour ago, aeonios said: I found a weird bug with ocean waves. If you set the wind direction north (or move the slider to the left in atlas) at some point it starts producing weird black patches where the waves should be. Moving the wind slider to the right gets rid of the artifacts, and they don't seem to appear if you rotate the camera around the waves, only when changing wind angle. I confirm this bug. 1 Quote Link to comment Share on other sites More sharing options...
Stan` Posted February 8, 2016 Report Share Posted February 8, 2016 Can confirm too. I discussed about it with wraitii but he wasn't able to reproduce it with his laptop. Quote Link to comment Share on other sites More sharing options...
niektb Posted February 8, 2016 Report Share Posted February 8, 2016 When it's ready I want to cross-compare it with this one @render glitches: Yes, happened here too more than often. I also have some red water at certain camera angles. Quote Link to comment Share on other sites More sharing options...
aeonios Posted February 8, 2016 Author Report Share Posted February 8, 2016 (edited) 6 hours ago, niektb said: When it's ready I want to cross-compare it with this one @render glitches: Yes, happened here too more than often. I also have some red water at certain camera angles. Another thing I found out was that the refraction map is super low res, which apparently was an aesthetic decision. Can also confirm the red water artifacts. There was a horrible hack in the shader to try to prevent it but that didn't work. It mostly seems to occur around map edges when facing the center of the map, but I have no idea where it's getting the red from. Ultimately it's an issue with how the refraction map is rendered, with the relevant part being in renderer.cpp. I'm not really sure where the black waves issue is coming from since I haven't tracked down exactly where the normal map is applied (which is the likely culprit). The fact that it depends on wind direction is the biggest clue in any case, and I'm pretty sure it's not shader side (although I need to recheck that). EDIT: Ok it's definitely in the shader. It seems to be related to some issue with CosSin, which might explain why it fails over half of angles, but I don't understand why it only happens with ocean waves. Edited February 8, 2016 by aeonios Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted February 9, 2016 Report Share Posted February 9, 2016 13 hours ago, aeonios said: EDIT: Ok it's definitely in the shader. It seems to be related to some issue with CosSin, which might explain why it fails over half of angles, but I don't understand why it only happens with ocean waves. Could it be relate to the pathfinding map? For example, water is red in Atlas if I choose a pathfinder overlay. Quote Link to comment Share on other sites More sharing options...
aeonios Posted February 10, 2016 Author Report Share Posted February 10, 2016 (edited) I don't think the red water issue is related to any special overlays since it appears even when they're disabled. I think the red/black water issues should be moved to bugs, which I'll do shortly. I got everything cleaned up fairly well and made a PR. I also got specular reflections cleaned up and working. (I don't know if they were but they are now!) Also notice the foam caps in the screen shot. Code for drawing them has been around for a while but it was set to only show them from certain narrow camera angles. Now foam caps are visible from all directions (as they should be). Edited February 10, 2016 by aeonios 8 Quote Link to comment Share on other sites More sharing options...
niektb Posted February 10, 2016 Report Share Posted February 10, 2016 You might want to press Alt+G before taking a screenshot (hides the UI) Quote Link to comment Share on other sites More sharing options...
wackyserious Posted February 10, 2016 Report Share Posted February 10, 2016 Plus, can we see a photo comparison between the old and new one? (With the same sun rotation and elevation, plus other visual tweaks) Quote Link to comment Share on other sites More sharing options...
aeonios Posted February 10, 2016 Author Report Share Posted February 10, 2016 Can do. Old shader (same water/sky/sun settings, almost same angle): More screenshots soonish. 1 Quote Link to comment Share on other sites More sharing options...
gameboy Posted February 10, 2016 Report Share Posted February 10, 2016 @aeonios: Do you optimize the water surface texture code? This looks great.You have solved the problem of black and red fish? Can you provide your patch, let us all to help you test, this is OK? Quote Link to comment Share on other sites More sharing options...
aeonios Posted February 10, 2016 Author Report Share Posted February 10, 2016 (edited) The patch is here. The refraction texture is higher resolution in the new shader (requires a C++ recompile) and reflections are toned down quite a bit. Specular reflections might be tunable further, but I'd need to find some good reference photos to see what I need to aim for. EDIT: I dunno about black and red fish. I've seen fish get discolored in weird ways, but usually by the water's colors. Edited February 10, 2016 by aeonios Quote Link to comment Share on other sites More sharing options...
gameboy Posted February 10, 2016 Report Share Posted February 10, 2016 About red fish and black water, which does exist, which is related to the depth and angle of the water. Quote Link to comment Share on other sites More sharing options...
wowgetoffyourcellphone Posted February 10, 2016 Report Share Posted February 10, 2016 On 2/8/2016 at 3:22 PM, aeonios said: EDIT: I dunno about black and red fish. I've seen fish get discolored in weird ways, but usually by the water's colors. Yes it seem like fish are renered as a transp[arency? I can see the coral through the fish models for some reason, but not through the water (because of depth rendering). Quote Link to comment Share on other sites More sharing options...
gameboy Posted February 10, 2016 Report Share Posted February 10, 2016 This is very good about your patch, and we are more expect you to solve the depth of the problem of the patch Quote Link to comment Share on other sites More sharing options...
fabio Posted February 10, 2016 Report Share Posted February 10, 2016 aeonios, it's looking good, you should read this for submitting patches: http://trac.wildfiregames.com/wiki/SubmittingPatches You may also want to explain why you left some commented code rather than removing it. 1 Quote Link to comment Share on other sites More sharing options...
Itms Posted February 10, 2016 Report Share Posted February 10, 2016 As I stated earlier you can give a link to your fork in the ticket you will create. 1 Quote Link to comment Share on other sites More sharing options...
aeonios Posted February 10, 2016 Author Report Share Posted February 10, 2016 @fabio: Ah that's a good point. I went through and cleaned out all the old commented code just now, there wasn't a lot left but there was some that I missed. @Itms Is that an alternative to making a diff file or just extra? Quote Link to comment Share on other sites More sharing options...
gameboy Posted February 10, 2016 Report Share Posted February 10, 2016 (edited) Their advice is very good, you can see very good results. Edited February 10, 2016 by feneur Removed distracting formatting Quote Link to comment Share on other sites More sharing options...
Itms Posted February 10, 2016 Report Share Posted February 10, 2016 46 minutes ago, aeonios said: Is that an alternative to making a diff file or just extra? Depends If you really hate making diffs we can content ourselves with the link, but in both cases it's nice to know where your work is! 1 Quote Link to comment Share on other sites More sharing options...
gameboy Posted February 11, 2016 Report Share Posted February 11, 2016 (edited) We are looking forward to your latest patch, thank you! Can you show us your latest achievements, such as the latest surface texture screenshot? Edited February 11, 2016 by feneur Removed distracting formatting Quote Link to comment Share on other sites More sharing options...
Itms Posted February 11, 2016 Report Share Posted February 11, 2016 gameboy, please stop harassing people, that doesn't make things easier to program... Plus that makes us all uncomfortable when you target newcomers who already do their best and who don't know you yet. 1 Quote Link to comment Share on other sites More sharing options...
Lion.Kanzen Posted February 11, 2016 Report Share Posted February 11, 2016 17 minutes ago, Itms said: gameboy, please stop harassing people, that doesn't make things easier to program... Plus that makes us all uncomfortable when you target newcomers who already do their best and who don't know you yet. I say before, his acts needs a punishment 1 Quote Link to comment Share on other sites More sharing options...
gameboy Posted February 11, 2016 Report Share Posted February 11, 2016 (edited) OK, I apologize, thank you for reminding me. Edited February 11, 2016 by feneur Removed distracting formatting 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.