shader问题

d0ed58810a5c7f58d5a7fa37aea332e

这行代码哪里出问题了?只要加上这行代码就出错。引擎版本是3.5.1

截图看看你的 shader 代码段

https://gitee.com/yeshao2069/cocos-creator-shader/blob/v3.5.x/demo/2d/Creator3.5.2_2D_Sprite_Ablation/assets/res/SpriteAblation.effect#L106

改成这样子试试?

改成这样就可以了。但是我还是想知道原因。是3.5.1这个版本的shader的问题吗?

我看了 #include 的代码。
我直接用texture代替texture2D就行了。是因为在effect脚本中texture代替了texture2D这个方法吗?

和 GLSL 语言支持有关。

https://docs.cocos.com/creator/manual/zh/shader/effect-chunk-index.html

需要使用 texture 替代 texture2D

知道了。非常感谢。提个小小的建议:把需要使用 texture 替代 texture2D加到手册中。我记得我以前用2.x的时候好像可以直接用texture2D。