如何增加光线投射渲染距离?

How do I increase the raycast render distance?

为了学习 Golang 并从中获得乐趣,我尝试将现有的 raycaster 项目从 C# 转换为 Go:https://github.com/harbdog/raycaster-go

原来的项目主要是基于lodev raycasting tutorial

这是我第一次创建 raycaster 引擎,除了一个主要问题外,我已经设法让它进入良好的工作状态:渲染距离太短,我想渲染得更远,但我不能'看不到允许这样做的明显参数。如有任何建议,我们将不胜感激!

这是一个 youtube 视频演示它和渲染距离问题,如果你看远处的大墙何时决定绘制: https://www.youtube.com/watch?v=HqNorhH37xY

原来是最近修复的bug in the Ebiten 2D rendering engine!更新到最新版本的 Ebiten 解决了这个问题。

go get -u github.com/hajimehoshi/ebiten/...

要点是旧版本的 Ebiten 不会渲染 Y 缩放比例小于 0.25 的 1 像素宽度的图像,根据 Ebiten 开发人员的说法,问题是:

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.