Skip to content

Commit

Permalink
Gamma color
Browse files Browse the repository at this point in the history
  • Loading branch information
sanyuered authored Jan 3, 2022
1 parent 7c4c044 commit dab883a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

| Date   | Update |
| -- | -- |
| 2022-01-02 | New: Gamma color space correction. |
| 2021-09-07 | New: Added a compass and map demo. Update: Fixed the value of the Device Orientation Control on Android is opposite to iOS. |
| 2021-02-25 | New: Scan a QR code to update the url of the gltf model. Update: 1. add a directional light for the model viewer to make the model have shadows. 2. add the device pixel ratio for the panorama viewer to make the picture clear. |
| 2019-10-31 | Updated: Use a new Gltf loader modified by "wechat-miniprogram". Support .glb format without textures and .gltf format. |
Expand Down
10 changes: 7 additions & 3 deletions package_3d_viewer/utils/cameraBusiness.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var mainModel, requestId;
var isDeviceMotion = false;
var isIOS = false;

function initThree(canvasId, modelUrl,_isIOS) {
function initThree(canvasId, modelUrl, _isIOS) {
isIOS = _isIOS;
wx.createSelectorQuery()
.select('#' + canvasId)
Expand Down Expand Up @@ -55,6 +55,10 @@ function initScene() {
renderer.setPixelRatio(devicePixelRatio);
renderer.setSize(canvas.width, canvas.height);

// gamma色彩空间校正,以适应人眼对亮度的感觉。
renderer.gammaOutput = true
renderer.gammaFactor = 2.2

animate();

}
Expand Down Expand Up @@ -121,10 +125,10 @@ function updateModel(modelUrl) {
function animate() {
requestId = canvas.requestAnimationFrame(animate);

if(isDeviceMotion){
if (isDeviceMotion) {
deviceOrientationControl.deviceControl(camera, device, THREE, isIOS);
}
else{
else {
deviceOrientationControl.modelRotationControl(mainModel, lon, lat, gradient, THREE);
}

Expand Down

0 comments on commit dab883a

Please sign in to comment.