douchun9719 2019-04-04 01:31
浏览 8
已采纳

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

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

  • 写回答

1条回答 默认 最新

  • doudeng3008 2019-04-06 21:53
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误