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