diff --git a/src/plugin.js b/src/plugin.js index 535d062..4fd85ff 100644 --- a/src/plugin.js +++ b/src/plugin.js @@ -23,7 +23,14 @@ const defaults = { omnitoneOptions: {}, projection: 'AUTO', sphereDetail: 32, - disableTogglePlay: false + disableTogglePlay: false, + threeRendererOptions:{ + devicePixelRatio: window.devicePixelRatio, + alpha: false, + clearColor: 0xffffff, + antialias: true, + powerPreference: 'high-performance' + }, }; const errors = { @@ -655,13 +662,10 @@ void main() { } this.camera.position.set(0, 0, 0); - this.renderer = new THREE.WebGLRenderer({ - devicePixelRatio: window.devicePixelRatio, - alpha: false, - clearColor: 0xffffff, - antialias: true, - powerPreference: 'high-performance' - }); + + const rendererOptions =this.options_.threeRendererOptions; + + this.renderer = new THREE.WebGLRenderer(rendererOptions); const webglContext = this.renderer.getContext('webgl'); const oldTexImage2D = webglContext.texImage2D;