lbry-desktop/ui/component/viewers/threeViewer/internal/renderer.js

15 lines
526 B
JavaScript
Raw Normal View History

2019-03-07 04:37:25 +01:00
import { WebGLRenderer } from 'three-full/sources/renderers/WebGLRenderer';
2018-06-06 08:06:03 +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);
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;