-
Notifications
You must be signed in to change notification settings - Fork 60
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
Make some uniforms global #1317
Conversation
653601a
to
9b943f1
Compare
src/engine/renderer/gl_shader.h
Outdated
@@ -2497,7 +2497,7 @@ class u_EnvironmentMap0 : | |||
GLUniformSamplerCube { | |||
public: | |||
u_EnvironmentMap0( GLShader* shader ) : | |||
GLUniformSamplerCube( shader, "u_EnvironmentMap0" ) { | |||
GLUniformSamplerCube( shader, "u_EnvironmentMap0", true ) { |
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.
I imagine this should be dependent on the surface's position? Currently it is determined from the viewing position but I assume that's just because the old reflective specular code was half unfinished and written while drunk.
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.
It should be, yeah. I was just going off of whatever code we already had.
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 be more specific, binding cubemaps based on where the surface is will also give bad results, especially if the surface is large. Ideally we'd further divide the frustum (further from the current tiled implementation) into clusters and assign a cubemap to each cluster.
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.
Actually, this would pretty much require changing from tiled renderer to clustered, because I plan to merge stages with the same data in the buffer, which means that they will point to the wrong cubemaps for most surfaces (right now having separate data for each stage in the material buffer makes it take up about ~10x the space on average and decreases performance).
9b943f1
to
c28370b
Compare
32a79ec
to
3c3bed8
Compare
Rebased/ready for review again. |
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.
LGTM modulo comment
3c3bed8
to
dd0e92e
Compare
dd0e92e
to
66d26f7
Compare
Don't put data that doesn't change into the material buffer.