Skip to content

Commit

Permalink
fix: resolve gammaOutput removed warning and update the README.md (hu…
Browse files Browse the repository at this point in the history
…jiulong#172)

Resolve the warning about .gammaOutput has been removed, use outputEncoding instead.
  • Loading branch information
wangerzi authored and hujiulong committed Jun 30, 2020
1 parent 1b829ae commit f4ab34b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Or
| backgroundAlpha | number | 1 | 0.5 |
| controlsOptions | object | - | see [OrbitControls Properties](https://threejs.org/docs/#examples/en/controls/OrbitControls) |
| crossOrigin | string | anonymous | anonymous/use-credentials |
| gammaOutput | boolean | false | true/false |
| outputEncoding | number | THREE.LinearEncoding | see [WebGLRenderer OutputEncoding](https://threejs.org/docs/index.html#api/en/renderers/WebGLRenderer.outputEncoding) |
| glOptions | object | { antialias: true, alpha: true } | see [WebGLRenderer Parameters](https://threejs.org/docs/index.html#api/en/renderers/WebGLRenderer) |

### events
Expand All @@ -102,6 +102,7 @@ Or
| stl | \<model-stl> |
| dae | \<model-collada> |
| ply | \<model-ply> |
| fbx | \<model-fbx> |
| gltf(2.0) | \<model-gltf> |

## Browser Support
Expand Down
9 changes: 5 additions & 4 deletions src/model-mixin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
PointLight,
HemisphereLight,
DirectionalLight,
LinearEncoding,
} from 'three';
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
import { getSize, getCenter } from './util';
Expand Down Expand Up @@ -108,9 +109,9 @@ export default {
crossOrigin: {
default: 'anonymous',
},
gammaOutput: {
type: Boolean,
default: false,
outputEncoding: {
type: Number,
default: LinearEncoding,
},
glOptions: {
type: Object,
Expand Down Expand Up @@ -164,7 +165,7 @@ export default {
this.renderer = new WebGLRenderer(options);
this.renderer.shadowMap.enabled = true;
this.renderer.gammaOutput = this.gammaOutput;
this.renderer.outputEncoding = this.outputEncoding;
this.controls = new OrbitControls(this.camera, this.$el);
this.controls.type = 'orbit';
Expand Down

0 comments on commit f4ab34b

Please sign in to comment.