如何增加光线投射渲染距离?
To learn Golang and have fun with it I've attempted to convert an existing raycaster project from C# into Go: https://github.com/harbdog/raycaster-go
That original project is mainly based on the lodev raycasting tutorial.
This is my first time creating a raycaster engine, and I've managed to get it into good working order except one main problem: the render distance is too short and I would like to render farther out but I can't see an obvious parameter that would allow that. Any suggestions would be appreciated!
Here's a youtube video demoing it and the render distance problem if you look at when the larger wall in the distance decides to draw in: https://www.youtube.com/watch?v=HqNorhH37xY
要学习Golang并乐在其中,我尝试将现有的raycaster项目从C#转换为Go: a href =“ https://github.com/harbdog/raycaster-go” rel =“ nofollow noreferrer”> https://github.com/harbdog/raycaster-go p>
该原始项目主要基于 lodev射线广播教程。 p> \ n
这是我第一次创建raycaster引擎,除了一个主要问题,我设法使其处于良好的工作状态:渲染距离太短,我想进行更远的渲染,但是我可以 没有看到一个明显的参数可以做到这一点。 任何建议将不胜感激! p>
如果您查看距离中较大的墙决定拉入时,这里有一个youtube视频演示它和渲染距离问题: https://www.youtube.com/watch?v=HqNorhH37xY p>
It turned out to be a bug in the Ebiten 2D rendering engine that had recently been fixed! Updating to most recent version of Ebiten resolved the issue.
go get -u github.com/hajimehoshi/ebiten/...
The gist of it was that the older version of Ebiten would not render 1 pixel width images with a Y scaling of less than 0.25, which according to the Ebiten developer the issue was:
OK so the cause was the mipmap selection with the linear filter: if the determinant of the geometry matrix is small, mipmap is used, but in your case, the mipmap level is so high that the image width becomes 0. This doesn't happen with the nearest filter since mipmap is not used in this case.