场景图层使用KTX2新特性前瞻使用方法

0
分享 2022-02-16
KTX2是新一代web3D流行使用的材质,它相比于DDS和jpg 具有一定优势。截图来自合作伙伴在用户大会上的讲座视频。
jpg.png

JPG
DDS.gz_.png

DDS (.gz)

KTX2.png

KTX2
 
最新的桌面端ArcGIS Pro 2.9已支持生产KTX2材质的SLPK。但由于目前的10.8.1ArcGIS Server以及GeoScene Server 2.1尚不能返回KTX2,所以在Web 3D上使用具有障碍。这里尝试用Nginx代理CouchDB里的KTX2材质,并取得成功。关键代理配置代码如下:
location / {

proxy_pass http://192.168.100.128:29080/;

#proxy_redirect off;
if ($uri ~* "geometries"){

add_header Content-Encoding gzip;
}
if ($uri ~* "attributes"){

add_header Content-Encoding gzip;
}
set $flag 0;
if ($uri ~* "textures"){
set $flag "${flag}1";
}
if ($uri ~* "_0_0_1"){
set $flag "${flag}1";
}
if ($flag = "011"){
#Only for DDS, KTX2 can be via type of jpg and only support no gzip
add_header Content-Type 'application/octet-stream;charset=binary';
#more_set_headers "Content-Type" "application/octet-stream;charset=binary";
#default_type application/octet-stream;
#set $content_type 'application/octet-stream;charset=binary';
add_header Content-Encoding gzip;
}

#add_header Content-Encoding gzip;

proxy_set_header X-Forwarded-Host $host:$server_port;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

}
注意问题:
1.Chrome的SameSite问题。参考:知乎专栏
2.CouchDB允许跨域连接问题。参考:入库前准备
结果观看:
successKTX2.png

 
 
 

2 个评论

KTX2实际上原生代理了CouchDB的返回,未做像DDS.gz那样的Content-Encoding gzip 和 Content-type改为application/octet-stream的 处理。
谢军主创,我负责踩坑测试TWT

要回复文章请先登录注册