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 对接wps接口实现获取元数据
  • ¥20 给自己本科IT专业毕业的妹m找个实习工作
  • ¥15 用友U8:向一个无法连接的网络尝试了一个套接字操作,如何解决?
  • ¥30 我的代码按理说完成了模型的搭建、训练、验证测试等工作(标签-网络|关键词-变化检测)
  • ¥50 mac mini外接显示器 画质字体模糊
  • ¥15 TLS1.2协议通信解密
  • ¥40 图书信息管理系统程序编写
  • ¥20 Qcustomplot缩小曲线形状问题
  • ¥15 企业资源规划ERP沙盘模拟
  • ¥15 树莓派控制机械臂传输命令报错,显示摄像头不存在