-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
VertexShaderGen: Sonic epsilon hack for OpenGL ES #9591
Conversation
debaf63 moved the "Sonic epsilon hack" to vertex shaders. However, it was only done for targets with depth clamping. If this is not available, for example the target is OpenGL ES, the Sonic problem appears (https://bugs.dolphin-emu.org/issues/11897). A version of the "Sonic epsilon hack" is added for targets without depth clamping.
This has been tested on multiple Sonic Games. Appears to work. It's a small change so if there is some kind of weird regression, it's easy to change back. Looks good to me. |
This hack fixes black screens in Sonic Unleashed and Black Knight. |
https://stackoverflow.com/questions/7408855/clipping-planes-in-opengl-es-2-0 |
Oh that's neat! Maybe we can fix this properly on GLES then. |
There already can be found a mention of this extension in the Dolphin source: dolphin/Source/Core/VideoBackends/OGL/OGLRender.cpp Lines 506 to 507 in 5513d5f
But does there exist an "extension for depth clamping"? |
GL_EXT_depth_clamp. It does not have a large number of supporting devices. |
Because it was basically just shipped for mesa purposes KhronosGroup/OpenGL-Registry#240 Btw hrydgard/ppsspp#11399 and hrydgard/ppsspp#14042 sound interesting. |
#4164 moved the "Sonic epsilon hack" to vertex shaders. However, it was only done for targets with depth clamping. If this is not available, for example the target is OpenGL ES, the Sonic problem appears (https://bugs.dolphin-emu.org/issues/11897).
A version of the "Sonic epsilon hack" is added for targets without depth clamping.