-
Notifications
You must be signed in to change notification settings - Fork 61
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
base: master
Are you sure you want to change the base?
Conversation
653601a
to
9b943f1
Compare
@@ -1104,6 +1105,107 @@ void BindShaderLightMapping( Material* material ) { | |||
} | |||
// FIXME: else | |||
|
|||
// bind u_LightGrid1 |
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.
Why is there a lot of new code here?
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.
Hmm, that can be removed since light/deluxe grid textures don't change and they're set always set elsewhere.
@@ -3496,7 +3496,7 @@ class u_VertexInterpolation : | |||
{ | |||
public: | |||
u_VertexInterpolation( GLShader *shader ) : | |||
GLUniform1f( shader, "u_VertexInterpolation" ) | |||
GLUniform1f( shader, "u_VertexInterpolation", 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.
This seems wrong. This one is set for surfaces that are part of an MD3 model
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 suppose that uniform can just be removed from the shader since it will likely use other means to do vertex skinning/animation.
@@ -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
Don't put data that doesn't change into the material buffer.