英文:
Phaser webgl shadows
问题
如何在phaser.js的WebGL光照系统中实现阴影?
this.lights.enable();
this.lights.setAmbientColor(0x808080);
如何在Phaser中实现树木投射的阴影?
1: https://i.stack.imgur.com/X5t88.jpg
英文:
How can I implement Shadows With The phaser.js Webgl lighting system
this.lights.enable();
this.lights.setAmbientColor(0x808080);
How Do I implement the shadows coming off those trees in phaser
答案1
得分: 1
根据这个问题/答案中提到的,据我所知,在Phaser中,默认情况下无法创建阴影效果。除非您想要使用光线投射等方法进行编程实现(参考文章链接),但这可能需要大量工作,仅仅为了一个背景功能,可能并不容易被察觉。
一个简单的解决方案可能是使用多个具有不同阴影效果的背景图像,根据需要切换它们(在上述提到的答案中可能有一个示例)。
英文:
As mentioned in this question/answer, as far as I know you cannot create shadows/shadow effects out of the box with in phaser. Except you want to programm it with raycasting or so(link to an article), but that would be alot of work judt for background feature, that mihht not be seen.
A easy solution could be use several background images, wirh different shadows an switch them out when needed (a possible example is in the aforementioned answer).
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论