Skip to content

Conversation

@Johni0702
Copy link
Collaborator

@Johni0702 Johni0702 commented Oct 15, 2025

The glShadeModel state is initially GL_SMOOTH, but other code may change it to GL_FLAT and if it doesn't change it back afterwards, users of URenderPipeline may not get the expected render result (e.g. trying to draw a gradient will result in a single flat color instead).

The chance of some user of URenderPipeline intentionally relying on this global state leaking in feels sufficiently low, that I don't think any backwards compatibility needs to be maintained for it. I don't think it is even necessary to make this behavior configurable, since we don't allow a single vertex to be shared by multiple primitives, so anything which could be achieved by using GL_FLAT can also by achieved by simply using the same data for all vertices of each primitive. And modern OpenGL doesn't support it anyway.

…state

The `glShadeModel` state is initially `GL_SMOOTH`, but other code may
change it to `GL_FLAT` and if it doesn't change it back afterwards,
users of `URenderPipeline` may not get the expected render result (e.g.
trying to draw a gradient will result in a single flat color instead).

The chance of some user of `URenderPipeline` intentionally relying on
this global state leaking in feel suffuciently low, that I don't think
any backwards compatibility needs to be maintained for it.
I don't think it is even necessary to make this behavior configurable,
since we don't allow a single vertex to be shared by multiple
primitives, so anything which could be achieved by using GL_FLAT can
also by achived by simply using the same data for all vertices of each
primitive. And modern OpenGL doesn't support it anyway.
@Johni0702 Johni0702 merged commit cfb963c into master Oct 15, 2025
1 check passed
@Johni0702 Johni0702 deleted the fix/urenderpipeline-affected-by-global-glshademodel-state branch October 15, 2025 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants