WGSL mat33转mat44,
webgl中: mat4 rotView = mat4(mat3(view)); // remove translation from the view matrix
这段代码转怎么可以转成wgsl
Z
zhoubin10
@zhoubin10
-
WGSL mat3*3转mat4*4 -
使用 copyTextureToTexture可以将多个渲染结果copy到一个纹理上吗?@shuangliu 请问有没有相关的案例?
-
使用 copyTextureToTexture可以将多个渲染结果copy到一个纹理上吗?for (var i = 0; i < 6; ++i) { const renderPassDescriptor = { colorAttachments: [ { view: renderView, clearValue: { r: 0, g: 0, b: 0, a: 1.0 }, loadOp: "clear", storeOp: "store", }, ], depthStencilAttachment: { view: depthView, depthClearValue: 1.0, depthLoadOp: "clear", depthStoreOp: "store", }, }; const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor); passEncoder.setPipeline(pipeline); passEncoder.setVertexBuffer(0, positionBuffer); passEncoder.setIndexBuffer(indicesBuffer, "uint32"); passEncoder.setBindGroup(0, vertexBindGroup); passEncoder.setBindGroup(1, fragmentBindGroup); passEncoder.drawIndexed(indices.length, 1, 0, 0); passEncoder.end(); commandEncoder.copyTextureToTexture( { texture: renderTexture, }, { texture: cubeMap, origin: [0, 0, i], }, [1024, 1024] ); }
-
Texture作为attachment 附件的时候mipLevelCount只能为1,不能大于1吗?Texture作为attachment 附件的时候mipLevelCount只能为1,不能大于1吗?