iDesktop 11i倾斜入库后加载正常,纹理压缩格式CRN_DXT5,iServer发布显示也正常,前端加载后PC正常,部分手机正常,但是部分手机平板,包括苹果无法显示纹理,如图:
之后尝试更换纹理压缩格式为WebP,桌面端颜色正常,iserver发布后颜色正常显示,但是前端加载后颜色不对,
搜索发现原因是:RGBTOBGR默认为false,
RGBTOBGR : Boolean
纹理压缩格式为webp的情况下,当纹理红绿反转时,使用颜色通道RGB转BGR。
Default Value: false
我代码能力弱,请问如下代码应该如何修改?
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>合集</title>
<script src="./js/jquery.min.js"></script>
<link rel="stylesheet" href="./css/widgets.css">
<link rel="stylesheet" href="./css/pretty.css">
<script src="./js/require.min.js" data-main="js/main"></script>
</head>
<style>
.btnClass {
position: absolute;
left: 0;
top: 0;
width: 120px;
height: 100px;
padding: 15px;
}
.param-item {
display: inline-block;
}
</style>
<body>
<div id="cesiumContainer"></div>
<div class="btnClass">
<div class="param-item">
<input type="button" value="合集" id="position1" class="button black" />
</div>
<div class="param-item">
<input type="button" value="最新" id="position2" class="button black" />
</div>
<div class="param-item">
<input type="button" value="初始" id="position3" class="button black" />
</div>
</div>
<script>
var viewer
function onload(Cesium) {
viewer = new Cesium.Viewer('cesiumContainer')
var scene = viewer.scene
scene.open('localhost:8090/iserver/services/3D-ChanBa/rest/realspace')
var camera = scene.camera
//最新
$('#position2').click(function () {
camera.setView({
destination: Cesium.Cartesian3.fromDegrees(109.0040, 34.4050, 800),
orientation: {
heading: Cesium.Math.toRadians(0),
pitch: Cesium.Math.toRadians(-60),
roll: Cesium.Math.toRadians(0)
}
});
})
//初始
$('#position3').click(function () {
camera.setView({
destination: Cesium.Cartesian3.fromDegrees(109.0035, 34.3330, 800),
orientation: {
heading: Cesium.Math.toRadians(0),
pitch: Cesium.Math.toRadians(-60),
roll: Cesium.Math.toRadians(0)
}
});
})
}
</script>
</body>
</html>
或者有其他什么解决办法,谢谢!