raduprv / Eternal-Lands

http://www.eternal-lands.com
Other
155 stars 56 forks source link

Intel HD/Windows water reflection #166

Closed gvissers closed 2 years ago

gvissers commented 2 years ago

I have been looking at problems with water reflection using Intel integrated graphics on Windows, see forum thread. I use an Intel HD 530 chipset on Linux without problems, but using Windows in Virtualbox I can see similar issues as described in the thread. I don't know which problems are due to Virtualbox, and which are due to Windows, but so far I have found:

I'll try to come up with a proper patch that detects if the texture is rendered upside down, but the last point will also require a new shader file to be distributed.

gvissers commented 2 years ago

Well, looks like the third point above may be valid after all. I've created a pull request (#167), as I don't feel comfortable pushing this without further testing, but with these changes the water reflection is rendered properly over here, both in Windows/VirtualBox and in Linux/native.

pjbroad commented 2 years ago

I've noticed I get an "OpenGL invalid enumerant" error from the glCullFace(GL_NONE) statement in check_flip_fbo_texture(). Looks like GL_NONE is not a valid mode for the function. It still works but you may want to check.

gvissers commented 2 years ago

I've noticed I get an "OpenGL invalid enumerant" error from the glCullFace(GL_NONE) statement in check_flip_fbo_texture().

And rightfully so. Now how did that end up in there? You'd just disable culling if you wanted to do that. Besides it's useless here, we only draw a single pixel, no faces involved. That's what you get for copying random code off of the internet, I suppose.

Fixed, thanks.

gvissers commented 2 years ago

While the original problem referenced in the original problem description was easily fixed, there were three different problems that needed their own fixes as well, culminating in the creation of an entire new water shader. All known problems seem to be fixed and are in the latest release, so closing this.