【Questions】I have a question about GammaCorrectionShader

In previous versions, I could handle the color display in the scene by adjusting the value of gammaFactor.

But now it has been removed, but it can be implemented through the Gamma Correction Shader. I have reviewed the source code of the Gamma Correction Shader, but it cannot adjust the value

I checked src/renderers/shaders/ShaderChunk/encodings_pars_fragment.glsl.js for previous versions

vec4 GammaToLinear( in vec4 value, in float gammaFactor ) {
	return vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );

vec4 LinearToGamma( in vec4 value, in float gammaFactor ) {
	return vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );

vec4 sRGBToLinear( in vec4 value ) {
	return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );

vec4 LinearTosRGB( in vec4 value ) {
	return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );

I’m not sure if LinearToGamma can be used to achieve similar results as before.

GammaCorrectionShader is considered as deprecated. For one reason, post processing chains should now always use OutputPass whenever possible which performs tone mapping (if configured) and sRGB color space conversion. Besides, GammaCorrectionShader actually just performed sRGB output conversion in recent versions so there is no configurable gammaFactor anymore.

GammaToLinear() and LinearToGamma() have been removed from the library. If you need full control of the gamma correction in your app, you need a ShaderPass with custom shader code. You can then inline the code from LinearToGamma() in your fragment shader and implement gammaFactor as a uniform (or even define). So yes, using LinearToGamma() restores the old behavior.