Skip to content

Commit

Permalink
feat: Allow three.js renderer options to be configurable (videojs#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
WCPetersen committed Feb 10, 2024
2 parents 96f2413 + 2470e36 commit fb2320a
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit fb2320a

Please sign in to comment.