getToneMappingFunction method
String
getToneMappingFunction(
- dynamic functionName,
- dynamic toneMapping
)
Implementation
String getToneMappingFunction(functionName, toneMapping) {
String toneMappingName;
switch (toneMapping) {
case LinearToneMapping:
toneMappingName = 'Linear';
break;
case ReinhardToneMapping:
toneMappingName = 'Reinhard';
break;
case CineonToneMapping:
toneMappingName = 'OptimizedCineon';
break;
case ACESFilmicToneMapping:
toneMappingName = 'ACESFilmic';
break;
case CustomToneMapping:
toneMappingName = 'Custom';
break;
default:
console.error('three.WebGLProgram: Unsupported toneMapping: $toneMapping');
toneMappingName = 'Linear';
}
return 'vec3 $functionName( vec3 color ) { return ${toneMappingName}ToneMapping( color ); }';
}