2019-03-07 04:37:25 +01:00
|
|
|
import { WebGLRenderer } from 'three-full/sources/renderers/WebGLRenderer';
|
2018-06-06 08:06:03 +02:00
|
|
|
|
2018-08-14 03:15:27 +02:00
|
|
|
const ThreeRenderer = ({ antialias, shadowMap, gammaCorrection }) => {
|
|
|
|
const renderer = new WebGLRenderer({ antialias });
|
2018-06-06 08:06:03 +02:00
|
|
|
// Renderer configuration
|
|
|
|
renderer.setPixelRatio(window.devicePixelRatio);
|
2018-08-14 03:15:27 +02:00
|
|
|
renderer.gammaInput = gammaCorrection || false;
|
|
|
|
renderer.gammaOutput = gammaCorrection || false;
|
|
|
|
renderer.shadowMap.enabled = shadowMap || false;
|
|
|
|
renderer.shadowMap.autoUpdate = false;
|
2018-06-06 08:06:03 +02:00
|
|
|
return renderer;
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ThreeRenderer;
|