@ -1030,10 +1030,10 @@ public class LwjglRenderer implements Renderer {
if ( compiledOK ) {
if ( compiledOK ) {
if ( infoLog ! = null ) {
if ( infoLog ! = null ) {
logger . log ( Level . FINE , "{0} compile success\n{1}" ,
logger . log ( Level . WARNING , "{0} compiled successfully, compiler warnings: \n{1}" ,
new Object [ ] { source . getName ( ) , infoLog } ) ;
new Object [ ] { source . getName ( ) , infoLog } ) ;
} else {
} else {
logger . log ( Level . FINE , "{0} compile success" , source . getName ( ) ) ;
logger . log ( Level . FINE , "{0} compiled successfully. " , source . getName ( ) ) ;
}
}
source . clearUpdateNeeded ( ) ;
source . clearUpdateNeeded ( ) ;
} else {
} else {
@ -1102,9 +1102,9 @@ public class LwjglRenderer implements Renderer {
if ( linkOK ) {
if ( linkOK ) {
if ( infoLog ! = null ) {
if ( infoLog ! = null ) {
logger . log ( Level . FINE , "shader link success. \n{0}", infoLog ) ;
logger . log ( Level . WARNING , "Shader linked successfully. Linker warnings: \n{0}", infoLog ) ;
} else {
} else {
logger . fine ( "shader link success " ) ;
logger . fine ( "Shader linked successfully. " ) ;
}
}
shader . clearUpdateNeeded ( ) ;
shader . clearUpdateNeeded ( ) ;
if ( needRegister ) {
if ( needRegister ) {
@ -1117,9 +1117,9 @@ public class LwjglRenderer implements Renderer {
}
}
} else {
} else {
if ( infoLog ! = null ) {
if ( infoLog ! = null ) {
throw new RendererException ( "Shader link failure, shader:" + shader + " info:" + infoLog ) ;
throw new RendererException ( "Shader failure to link , shader:" + shader + " info:" + infoLog ) ;
} else {
} else {
throw new RendererException ( "Shader link failure, shader:" + shader + " info: <not provided>" ) ;
throw new RendererException ( "Shader failure to link , shader:" + shader + " info: <not provided>" ) ;
}
}
}
}
}
}
@ -2553,10 +2553,26 @@ public class LwjglRenderer implements Renderer {
// }
// }
}
}
public void setMainFrameBufferSrgb ( boolean s rgb) {
public void setMainFrameBufferSrgb ( boolean enableS rgb) {
// Gamma correction
// Gamma correction
if ( srgb & & caps . contains ( Caps . Srgb ) ) {
if ( ! caps . contains ( Caps . Srgb ) ) {
// Not supported, sorry.
logger . warning ( "sRGB framebuffer is not supported " +
"by video hardware, but was requested." ) ;
return ;
}
if ( enableSrgb ) {
if ( ! glGetBoolean ( GL30 . GL_FRAMEBUFFER_SRGB_CAPABLE ) ) {
logger . warning ( "Driver claims that default framebuffer " +
"is not sRGB capable. Enabling anyway." ) ;
}
glEnable ( GL30 . GL_FRAMEBUFFER_SRGB ) ;
glEnable ( GL30 . GL_FRAMEBUFFER_SRGB ) ;
logger . log ( Level . FINER , "SRGB FrameBuffer enabled (Gamma Correction)" ) ;
logger . log ( Level . FINER , "SRGB FrameBuffer enabled (Gamma Correction)" ) ;
} else {
} else {
glDisable ( GL30 . GL_FRAMEBUFFER_SRGB ) ;
glDisable ( GL30 . GL_FRAMEBUFFER_SRGB ) ;
@ -2564,6 +2580,8 @@ public class LwjglRenderer implements Renderer {
}
}
public void setLinearizeSrgbImages ( boolean linearize ) {
public void setLinearizeSrgbImages ( boolean linearize ) {
if ( caps . contains ( Caps . Srgb ) ) {
linearizeSrgbImages = linearize ;
linearizeSrgbImages = linearize ;
}
}
}
}
}