This commit is contained in:
@@ -64,7 +64,7 @@ export default{
|
||||
},
|
||||
computed:{
|
||||
forRendering() {
|
||||
return this.$p.objectTypes.find(t=> t.value == this.obj?.type)?.render
|
||||
return this.$p.objectTypes.find(t=> t.value == this.obj?.type)?.render || this.obj?.asset?.name?.endsWith('ktx2')
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
@@ -74,6 +74,11 @@ export default{
|
||||
engine.ambientLight.intensity = 25;
|
||||
if (this.obj.type == 'panorama2d') {
|
||||
await engine.loadPanorama(this.obj.asset.name);
|
||||
} else if(this.obj.asset.name.endsWith('ktx2')){
|
||||
let tx = await engine.loadTexture(this.obj.asset.name);
|
||||
let k = Math.min(window.innerHeight / tx.image.height, 1);
|
||||
engine.resize(tx.image.width * k, tx.image.height * k);
|
||||
engine.scene.background = tx;
|
||||
}else{
|
||||
let gltf = await engine.load(this.obj.asset.name);
|
||||
this.loadedAsset = gltf;
|
||||
|
||||
@@ -84,7 +84,7 @@ export default {
|
||||
return this.$route.params?.id;
|
||||
},
|
||||
forRendering() {
|
||||
return this.$p.objectTypes.find(t=> t.value == this.object?.type)?.render
|
||||
return this.$p.objectTypes.find(t=> t.value == this.object?.type)?.render || this.object?.asset?.name?.endsWith('ktx2')
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
||||
Reference in New Issue
Block a user