This is the current uniform layout in my deferred renderer:
[
uniform sampler2D texture_diffuse; /* Albedo map of the material */
uniform sampler2D texture_normal; /* Normal map of the material */
uniform sampler2D texture_metalness; /* Metalness map of the material */
uniform sampler2D texture_roughness; /* Roughness map of the material */
uniform samplerCube texture_cubemap; /* Environment reflection map */
uniform samplerCube texture_ibl; /* Environment light map (IBL) */
uniform float uMetalness; /* User specified metalness of the material */
uniform float uRoughness; /* User specified roughness of the material */
uniform float uReflective; /* User specified reflectiveness of the material */
uniform float normalMapEnabled; /* Set on CPU. Controls whether material normalmap is used */
uniform float enableSkybox; /* Set on CPU. Controls whether skybox is used */
uniform float enableIBL; /* Set on CPU. Controls whether skybox IBL is used */
uniform vec3 uAmbient; /* Ambient of the scene. Used for IBL */
uniform vec3 uMaterialColor; /* User specified color of the material */
I've been thinking, should I worry about this many uniforms? They are being set by each material in the engine. I wrote some cpu-sided checks to see if I am updating the same uniform handle to the same value (and ignoring it if so), to try to help a little bit.
I could easily combine the texture_normal, texture_metalness, and texture_roughness to a single sampler2D. Would that help much when drawing?