【问题标题】:Ursina - how to add fog correctlyUrsina - 如何正确添加雾
【发布时间】:2022-06-10 23:24:45
【问题描述】:

我(再次!)询问 Ursina 的问题...

我知道 Ursina 有一个 scene.fog,我有点假设它是用于 3D 游戏的。我想在我的游戏中添加雾,但是设置 scene.fog_density 和 scene.fog_color 没有任何作用。

我做错了吗?如何在我的游戏中添加雾?

我正在使用(大部分)默认的 FirstPersonController

我的代码:

app = Ursina(development_mode=False, show_ursina_splash_screen=True,fullscreen=True,title="Maze FPS")

random.seed(0)
### SHADERS ###
Entity.default_shader = lit_with_shadows_shader

scene.fog_density = .1
scene.fog_color = color.red

我尝试了各种雾密度(0.1、1 和 3)和颜色(color.black、color.red、color.green)。 afaik 它没有任何效果

【问题讨论】:

  • 请展示你做了什么。否则很难说你做错了什么。
  • @pokepetter,啊,你是对的。不知道为什么我没有想到。对不起!我已经添加了相关代码。

标签: python ursina


【解决方案1】:

lit_with_shadows_shader 目前不支持雾。然而,默认着色器会。你设置雾色和雾密度的方式是正确的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-01-09
    • 2013-06-08
    • 2021-05-04
    • 1970-01-01
    • 2023-03-21
    • 2021-11-23
    • 2021-06-19
    • 2019-07-13
    相关资源
    最近更新 更多