收藏
回答

xr-frame下的真机纹理平铺失效?

我在xr-frame下尝试了实现一个噪声uv扰动效果,然后在 xr-asset-load texture的handleAssetsLoaded中获取纹理

// 噪声纹理平铺
const xrFrameSystem = wx.getXrFrameSystem()
const texNoise = this.scene.assets.getAsset('texture', 'noise');
texNoise.wrapU = xrFrameSystem.EWrapMode.REPEAT
texNoise.wrapV = xrFrameSystem.EWrapMode.REPEAT
texNoise.wrapW = xrFrameSystem.EWrapMode.REPEAT
console.log(texNoise.showDebugInfo())

输出的DebugInfo

type(D2), format(RGBA8),
width(512), height(512), slice(0), mips(0),
wrapU(REPEAT), wrapV(REPEAT), wrapW(REPEAT),
magFilter(LINEAR), minFilter(LINEAR_MIPMAP_LINEAR),
anisoLevel(1), sampleCount(0), generateMipmaps(true)

开发者工具与真机输出一致。但是在开发者工具下预览纹理平铺正常,在真机预览纹理依旧呈现 CLAMP_TO_EDGE 的效果,请问如何解决这个问题?


最后一次编辑于  2022-11-10
回答关注问题邀请回答
收藏

2 个回答

  • 瞬光寂暗
    瞬光寂暗
    2022-11-17

    问题确实存在,目前由于底层实现问题导致`Texture`的属性无法动态修改,预计下周发布的基础库版本`2.28.1`将会添加在`xml`上初始化时可选的配置入口,类似:

    <xr-asset-load
          type="texture" asset-id="tex" src="/tex.jpg" options="wrapU:1,wrapV:1,wrapW:1,minFilter:5,magFilter:6,generateMipmaps:true"
    />
    

    可在版本发布后,关注更新后文档的纹理一节:https://developers.weixin.qq.com/miniprogram/dev/component/xr-frame/render/texture.html

    2022-11-17
    有用 1
    回复
  • 社区技术运营专员--许涛
    社区技术运营专员--许涛
    2022-11-10

    你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)

    2022-11-10
    有用
    回复
登录 后发表内容