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

VertexShaderGen: Sonic epsilon hack for OpenGL ES #9591

Merged
merged 1 commit into from Apr 2, 2021
Merged

VertexShaderGen: Sonic epsilon hack for OpenGL ES #9591

merged 1 commit into from Apr 2, 2021

Conversation

ghost
Copy link

@ghost ghost commented Mar 16, 2021

#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.

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.
@JMC47
Copy link
Contributor

JMC47 commented Apr 2, 2021

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.

@JMC47 JMC47 merged commit 5513d5f into dolphin-emu:master Apr 2, 2021
@SN902
Copy link

SN902 commented Apr 3, 2021

This hack fixes black screens in Sonic Unleashed and Black Knight.

@mirh
Copy link

mirh commented Apr 6, 2021

https://stackoverflow.com/questions/7408855/clipping-planes-in-opengl-es-2-0
User-defined clipping can also be found natively in GLES devices supporting EXT_clip_cull_distance (my Adreno 630 phone does for example)

@JMC47
Copy link
Contributor

JMC47 commented Apr 6, 2021

Oh that's neat! Maybe we can fix this properly on GLES then.

@ghost
Copy link
Author

ghost commented Apr 7, 2021

There already can be found a mention of this extension in the Dolphin source:

// TODO: Implement support for GL_EXT_clip_cull_distance when there is an extension for
// depth clamping.

But does there exist an "extension for depth clamping"?

@ghost
Copy link
Author

ghost commented Apr 8, 2021

But does there exist an "extension for depth clamping"?

GL_EXT_depth_clamp. It does not have a large number of supporting devices.

@mirh
Copy link

mirh commented Apr 8, 2021

Because it was basically just shipped for mesa purposes KhronosGroup/OpenGL-Registry#240
Not that it couldn't probably be implemented in most phones, but idk how much GLES is still being maintained there.

Btw hrydgard/ppsspp#11399 and hrydgard/ppsspp#14042 sound interesting.

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

Successfully merging this pull request may close these issues.

4 participants