-
Notifications
You must be signed in to change notification settings - Fork 63
screenSpace: make it work when GL_EXT_gpu_shader4 is missing #1739
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
Conversation
Sadly I do not have the artistic talent to render a new coordinate system for the ASCII art square so I had to delete it :-( --slipher Co-Authored-By: slipher <[email protected]>
I tried it and it rendered correctly only the upper right quarter of the screen. So I tried this and it worked: --- a/src/engine/renderer/tr_vbo.cpp
+++ b/src/engine/renderer/tr_vbo.cpp
@@ -555,7 +555,7 @@ void R_BindNullIBO()
static void R_InitGenericVBOs() {
// Min and max coordinates of the quad
- static const vec3_t min = { 0.0f, 0.0f, 0.0f };
+ static const vec3_t min = { -1.0f, -1.f, -1.0f };
static const vec3_t max = { 1.0f, 1.0f, 0.0f };
{
/* I don't know why it would be necessary to use -1 to 1 now if 0 to 1 worked before. Note that this might break other, non-screenspace uses of Your screenshot seems to have additional bugs so I guess there must be more incompatible things if you have the real old hardware. |
We switched something from a quad to a triangle, this explains why: And to have a triangle covering all the screen we need the triangle being larger than the screen. So maybe that's related. We may have modified some generic defaults for the triangle code, and when running in no-gpu_shader4 code path, if we want to keep most of the triangle code unmodified, maybe using -1 as quad I'll try the -1 trick soon. 🙂 That Intel computer is used in some family vacation home and is used by teens to play games in the holidays, I would like to keep the game working on it. |
Yes those were driver bugs, after an update they disappeared. So, when I use both:
I get this ( The forcefields are a bit dim because that's an sRGB-compiled map running in the linear pipeline, so it's not because of an engine bug or a driver bug on this specific hardware. This produces what we currently expect. |
And when also using: I get this ( This is using the |
7f5ed27
to
579d0cd
Compare
PTAL at the branch |
I don't mind the implementation, if you prefer yours please force-push this PR. I've tested your implementation and it works as well. Maybe @VReaperV has an opinion on that too. |
I forgot to mention but outside of actually making the engine works on hardware without So, without this branch, when this extension is available, on some hardware we disable some |
579d0cd
to
a8d6b36
Compare
Done. The point of my edit is to avoid breaking the |
a8d6b36
to
f7b3f60
Compare
You have pushed the branch again and it no longer contains my changes from |
a4ac5cb
to
3ef8cd9
Compare
Oupsie, that should now be fixed. I also added comments linking to this PR so future selves may know why we picked those numbers. |
src/engine/renderer/tr_surface.cpp
Outdated
@@ -550,12 +558,15 @@ void Tess_InstantQuad( u_ModelViewProjectionMatrix &shader, const float x, const | |||
|
|||
Tess_Begin( Tess_StageIteratorDummy, nullptr, true, -1, 0 ); | |||
|
|||
/* These values make possible to use either the legacy quad rendering |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The point of this function is to render any screen-space axis-aligned rectangle specified by x, y, width, height
so the comment seems out of place.
src/engine/renderer/tr_vbo.cpp
Outdated
@@ -554,24 +554,19 @@ void R_BindNullIBO() | |||
} | |||
|
|||
static void R_InitGenericVBOs() { | |||
/* These values make possible to use either the legacy quad rendering |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To explain the values chosen here, you could say that they are chosen to specify a full-screen rectangle for screen-space shaders without a projection matrix. The values here don't influence the triangle but it's good to mention that this is a fallback when the gl_VertexID
-based triangle can't be used.
3ef8cd9
to
28eabd0
Compare
I updated the comments. |
LGTM |
WIP: screenSpace: make it work when
GL_EXT_gpu_shader4
is missingIt doesn't work yet, I'm not sure to understand how that works.
The purpose is to slightly modify #1593:
Commit 5666be1 from #1593 brings many improvements, but also makes use of
gl_VertexID
, which is introduced byEXT_gpu_shader4
if I'm right, making it mandatory.So I tried to add an alternate code path based on specific parts I read from 5666be1 that replaced the old code (among many other things), but it's not working yet.
It's now probably very close to have it working so if you have any idea, please share.☺️