warning: stencil buffer
mithenji opened this issue · comments
pixi.miniprogram.js? [sm]:69 Provided WebGL context does not have a stencil buffer, masks may not render correctly
Demo 代码爬起来时报这个 warning ,求解
https://stackoverflow.com/questions/24357437/webgl-stencil-buffer-is-working-only-in-firefox
按这里回答修改了 index.js
重新 npm run build
,之后似乎不会报错了。
这个是warning来的,实际上没有影响的,可以忽略的
这个是warning来的,实际上没有影响的,可以忽略的
canvas.getContext2('webgl')
=>canvas.getContext2('webgl', {stencil:true});
index.js
的我都这么改了,没有问题吧,上面提示说没有stencil buffer,
,不能使用遮罩裁剪?
改没问题,只是由于不支持stencil buffer所以那个mask属性是不能正常的,就是那个遮罩无效。留着这个warning就是提醒一下mask无效。如果需要实现mask遮罩,需要用shader写遮罩
加了一个遮罩实现的示例,如果需要有遮罩的功能,可以参考例子里的shader进行修改
加了一个遮罩实现的示例,如果需要有遮罩的功能,可以参考例子里的shader进行修改
感谢大佬~