Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Water shader #50

Closed
lmoureaux opened this issue Jan 16, 2017 · 6 comments
Closed

Water shader #50

lmoureaux opened this issue Jan 16, 2017 · 6 comments

Comments

@lmoureaux
Copy link
Contributor

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.

@ghost
Copy link

ghost commented Jan 20, 2017

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.

67458bd

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?

@lmoureaux
Copy link
Contributor Author

  • Maybe we could test medium quality without mirrors. But I don't fully understand how it works...
  • At low quality, we could use a tiled normal map, and pass some dynamic offset as an uniform. Or even two maps (map + same map, rotated?) with offsets going in different directions to make it less monotonic.

Is it CPU- or GPU-bound ?

@ghost
Copy link

ghost commented Jan 21, 2017

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.

@lmoureaux
Copy link
Contributor Author

On Linux with Intel IGPs, you can use intel-gpu-tools (run the tools as root). GPU vendors make various programs for Windows.

@ghost
Copy link

ghost commented Jan 21, 2017

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.

@lmoureaux
Copy link
Contributor Author

Closing this because we have a great water shader now. Performance discussion goes to #56. #57 opened about shader for lower resolutions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant