过滤是不是有点麻烦!因为需要绘制的物体我手中已有确定的集合。
最好是是类似 Unity CommandBuffer.DrawRenderer 这种快速方法。否则是不是又要跑一次sceneCulling:
for (const model of scene.models) {
// do something or filter
}
过滤是不是有点麻烦!因为需要绘制的物体我手中已有确定的集合。
最好是是类似 Unity CommandBuffer.DrawRenderer 这种快速方法。否则是不是又要跑一次sceneCulling:
for (const model of scene.models) {
// do something or filter
}
需要新加个接口,我可以做一版。
okok.点赞点赞

这样的接口行吗?(material) passId是必须的吗?
这些物件会受光照影响吗?
我的需求目前不需要!但不排除其他人需要哦!是不是可以允许额外指定passid呢?因为我这个需求是要不同的blendState的哦!
因为每个model的pass可能不一样,统一的pass id感觉不太有用。
pass可以通过pass name来进行过滤,只有符合pass name的才会绘制,所以还是有办法控制的。
好滴好滴。我先试试
draw3D没问题。如果有个 draw3DInstanced那就更好啦
之后版本会考虑下。
因为drawInstanced往往需要组织合适的InstanceBuffer,目前内置的InstanceBuffer没有自定义功能,所以可能无法满足全部需求。
会在充分设计后加入。
我使用 Creator 3.8.6,想要拓展一下渲染管线,新增一个 pass,代码如下:
Effect 中的 pass,其 pass 字段赋值为"extra-opaque",和 ts 代码中 addQueue(…, ‘extra-opaque’) 最后那个参数相对应,意图使用名为"extra-opaque"的pass绘制一遍模型。但是,运行时会出现如下问题:
[Scene] Invalid render pass, program: …/shader/custom-standard|extra-vs:vert|extra-fs:frag
at console.error (D:\Program Files\Cocos\Creator\3.8.6\resources\app.asar\node_modules@sentry\src\instrument\console.ts:40:20)
at error (eval at wrapExecute (D:\Program Files\Cocos\Creator\3.8.6\resources\resources\3d\engine\bin.cache\dev\editor\loader.js:9102:16), :146879:12)
at getEffectShader (eval at wrapExecute (D:\Program Files\Cocos\Creator\3.8.6\resources\resources\3d\engine\bin.cache\dev\editor\loader.js:9102:16), :226415:7)
at WebProgramLibrary.addEffect (eval at wrapExecute (D:\Program Files\Cocos\Creator\3.8.6\resources\resources\3d\engine\bin.cache\dev\editor\loader.js:9102:16), :226640:67)
at EffectAsset.onLoaded (eval at wrapExecute (D:\Program Files\Cocos\Creator\3.8.6\resources\resources\3d\engine\bin.cache\dev\editor\loader.js:9102:16), :118535:24)
at Task.onComplete (eval at wrapExecute (D:\Program Files\Cocos\Creator\3.8.6\resources\resources\3d\engine\bin.cache\dev\editor\loader.js:9102:16), :115048:21)
at Task.dispatch (eval at wrapExecute (D:\Program Files\Cocos\Creator\3.8.6\resources\resources\3d\engine\bin.cache\dev\editor\loader.js:9102:16), :116871:22)
at eval (eval at wrapExecute (D:\Program Files\Cocos\Creator\3.8.6\resources\resources\3d\engine\bin.cache\dev\editor\loader.js:9102:16), :115772:22)
at eval (eval at wrapExecute (D:\Program Files\Cocos\Creator\3.8.6\resources\resources\3d\engine\bin.cache\dev\editor\loader.js:9102:16), :114990:7)
at forEach (eval at wrapExecute (D:\Program Files\Cocos\Creator\3.8.6\resources\resources\3d\engine\bin.cache\dev\editor\loader.js:9102:16), :117364:7)
at load (eval at wrapExecute (D:\Program Files\Cocos\Creator\3.8.6\resources\resources\3d\engine\bin.cache\dev\editor\loader.js:9102:16), :114957:5)
at Pipeline._flow (eval at wrapExecute (D:\Program Files\Cocos\Creator\3.8.6\resources\resources\3d\engine\bin.cache\dev\editor\loader.js:9102:16), :115759:11)
at eval (eval at wrapExecute (D:\Program Files\Cocos\Creator\3.8.6\resources\resources\3d\engine\bin.cache\dev\editor\loader.js:9102:16), :115769:22)
at eval (eval at wrapExecute (D:\Program Files\Cocos\Creator\3.8.6\resources\resources\3d\engine\bin.cache\dev\editor\loader.js:9102:16), :113515:13)
看起来,自定义的 pass 不能随便命名,需要在某处“注册”才能用。但是我没有找到相关注册代码。请问这个错误应该如何解决?
@zlzhou.sh 期待您的回复。感激不尽
新增/修改effect后,建议重启一下编辑器,会自动生成effect.bin。
如果effect有错误,会影响导入,需要先解决编译错误。
重启编辑器后错误消失。感谢!