OpenGL2: Set cubemap mip selection to match output from ggxcc.
This commit is contained in:
parent
e0b2256043
commit
a40588c8b9
2 changed files with 17 additions and 3 deletions
|
@ -325,6 +325,20 @@ static void GLSL_GetShaderHeader( GLenum shaderType, const GLcharARB *extra, cha
|
|||
if (r_pbr->integer)
|
||||
Q_strcat(dest, size, "#define USE_PBR\n");
|
||||
|
||||
if (r_cubeMapping->integer)
|
||||
{
|
||||
int cubeMipSize = r_cubemapSize->integer;
|
||||
int numRoughnessMips = 0;
|
||||
|
||||
while (cubeMipSize)
|
||||
{
|
||||
cubeMipSize >>= 1;
|
||||
numRoughnessMips++;
|
||||
}
|
||||
numRoughnessMips = MAX(1, numRoughnessMips - 2);
|
||||
Q_strcat(dest, size, va("#define ROUGHNESS_MIPS float(%d)\n", numRoughnessMips));
|
||||
}
|
||||
|
||||
if (extra)
|
||||
{
|
||||
Q_strcat(dest, size, extra);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue