Closed lmoureaux closed 7 years ago
I have added a water shader based on the Three.js webgl_shaders_ocean example: https://threejs.org/examples/webgl_shaders_ocean.html
It is only available to the high quality graphics setting since it will require a good graphics card.
https://github.com/freeciv/freeciv-web/commit/67458bdf0ffc88ef9bbe9dfcf579d9a96bd98f4e
I'm leaving this issue open still, as there could be some tuning and improvements to be made to the water shader still. Perhaps you have some suggestions Louis?
Is it CPU- or GPU-bound ?
The current rendering in Freeciv-web WebGL is limited by the CPU (one core is running on 100%) on my computer. I'm not sure how to monitor GPU-usage. Perhaps I'll implement some kind of way to benchmark the WebGL performance in Freeciv-web so we can compare the performance impact of various rendering features.
On Linux with Intel IGPs, you can use intel-gpu-tools (run the tools as root). GPU vendors make various programs for Windows.
CPU usage is 100% on one core, while GPU usage is never more than 35%, when testing the game on high quality, on Windows 10 with a NVIDIA GeForce GTX 780 Ti graphics card at 3840x2160. So the game is definitely CPU-bound. It runs in JavaScript in a browser after all. Perhaps some profiling can find things to improve.
Closing this because we have a great water shader now. Performance discussion goes to #56. #57 opened about shader for lower resolutions.
I'd like to admire the Sun being reflected by animated waves.
This can be either vertex+fragment or fragment only. Rivers could use the same logic without waves.