arcgis显示地形阴影_地形照明和阴影以及通往之路

arcgis显示地形阴影

People have been asking: why built-in shadows don’t work on Unity’s terrain? (here, here, …) Yes, right now (Unity 2.0.2) they don’t. Why – because we didn’t have time to make them work yet. Both terrain and built-in shadows are new features in Unity 2.0, and those two don’t happen to just work together.

人们一直在问:为什么内置阴影在Unity的地形上不起作用? ( 在这里在这里 ,...)是的, 现在 (Unity 2.0.2)他们没有。 为什么-因为我们还没有时间让它们工作。 地形阴影和内置阴影都是Unity 2.0中的新功能,而这两个恰巧不能一起工作

Here’s a glimpse into what is needed to get it working.

这是使它工作所需的一瞥。

The Plan, straight from our internal planning wiki, with some explanations added:

该计划直接来自我们的内部计划Wiki,并添加了一些说明:

o) Convert all terrain code to use Intermediate Mode Render Calls. This makes all the points below possible, and makes things like Projectors or wireframe terrain rendering in scene view pretty much just work.

o)转换所有地形代码以使用“ 中间模式渲染调用” 。 这使得下面的所有要点成为可能 ,并使诸如“投影仪”或场景视图中的线框地形渲染之类的东西几乎可以正常工作

o) Update terrain shaders for proper rendering order and soft vegetation. Expand ShaderLab so that a shader pass can indicate it should only be executed when Soft Vegetation is on.

o)更新地形着色器以获得正确的渲染顺序和柔和的植被。 展开ShaderLab,以便着色器通道可以指示仅在启用“软植被”时才执行。

o) Proper vertex lights on terrain, implemented in a vertex shader. Currently terrain handles up to four directional lights; we need to expand it to handle point lights as well. I think we’ll treat spot lights (when in vertex lit mode) as point lights; as calculating multiple spot lights in a vertex shader is next to impossible because of instruction count limits. Spotlights are not very useful in vertex lighting mode, right?

o)在顶点着色器中实现的正确顶点光照在地形上。 目前,地形最多可处理四个方向灯; 我们还需要扩展它以处理点光源。 我认为我们将聚光灯(在顶点照明模式下)视为点光源; 因为由于指令计数限制,在顶点着色器中计算多个聚光几乎是不可能的。 聚光灯在顶点照明模式下不是很有用,对吧?

o) Implemented pixel lit shaders for terrain. This will get light cookies, per-pixel lit terrain, and ability for terrain to receive shadows.

o)为地形实现了像素照明着色器。 这将获得轻度Cookie,按像素点亮的地形以及使地形能够接收阴影的功能。

o) Add option somewhere for pixel or vertex lit terrain (defaults to vertex lit).

o)在像素或顶点光照地形的某处添加选项(默认为顶点光照)。

o) Proper vertex lights on trees. Very similar to “vertex lights on terrain” point above.

o)树木上正确的顶点灯。 非常类似于上面的“地形上的顶点灯”。

o) Make tree shaders able to cast shadows. Because trees are scaled & animated in a vertex shader, the shadow-casting shader needs to apply the same animation as well.

o)使树着色器能够投射阴影。 因为树是在顶点着色器中缩放和动画化的,所以阴影投射着色器也需要应用相同的动画。

o) Make Projectors not affect grass / trees. How? We’ll expand ShaderLab so a any shader can say “no Projectors on me, thanks”, and modify grass & tree shaders to do that.

o)使投影仪不影响草/树。 怎么样? 我们将扩展ShaderLab,以便任何着色器都可以说“谢谢,没有投影机在我身上”,并修改草和树的着色器以实现此目的。

o) Make projectors not affect terrain when game content is built with Unity 2.0. This is web player backwards compatibility – there are Unity games out there that use projectors and terrains, and they should continue functioning exactly like they did before. So Projectors should not affect terrain in this case.

o)使用Unity 2.0构建游戏内容时,使投影仪影响地形。 这是网络播放器的向后兼容性- 统一的游戏,在那里,使用投影仪和地形,他们应该继续工作完全一样,他们以前那样。 因此,在这种情况下,投影机不应影响地形。

o) Make tree shadows not s*cklook bad when they are squashed for billboarding. Trees are squashed into a planar shape when they approach billboards; this is to make the mesh-to-billboard transition less noticeable. However, this makes shadows from those trees look very wrong. Not sure how to handle this; I think we’ll just stop casting shadows when trees are starting to squash.

o)不要让树的阴影 s * ck 看起来很糟 当他们被压扁为广告牌时。 接近广告牌时,树木被压成平面形状。 这是为了使网格到广告牌的过渡不太明显。 但是,这使这些树的阴影看起来非常不正确 。 不确定如何处理; 我认为当树开始压扁时,我们将停止投射阴影。

o) Redo Lightmapped terrain shaders:

o)重做Lightmapped地形着色器:

  • Use existing shaders for game content built with Unity 2.0. Again, existing web player games should work like they did before! For reference, in Unity 2.0.2 lightmapped terrain was not affected by any lights at all.

    将现有着色器用于使用Unity 2.0构建的游戏内容。 同样,现有的网络播放器游戏应能像以前一样工作! 作为参考,在Unity 2.0.2中, 灯光映射的地形完全不受灯光影响。

  • Make new set of terrain shaders that follows the convention of other Lightmapped shaders: lightmap, plus additional lights on top. Whoa, hey, we need two new sets of those shaders: for vertex-lit terrain and for pixel-lit terrain!

    遵循其他Lightmapped着色器的约定制作新的地形着色器集 :光照贴图,以及顶部的其他光照。 哇,嘿,我们需要两套新的着色器:用于顶点照明的地形和像素照明的地形!

o) Optimize the bejesus out of rendering internals. Why – because the old terrain rendering code was like this:

o)优化渲染内部的对象。 为什么-因为旧的地形渲染代码是这样的:

    This is all simple & nice. Of course this was exactly the problem why shadows, projectors and such didn’t work on terrain – everything was just rendered immediately. Now, the new terrain code just submits any visible parts of terrain as Intermediate Renderers, and the rendering code figures the rest out… But that means it’s going through generic rendering “pipeline”, that has to figure out lighting, sort out objects, set shaders and their parameters, etc. The major overhead in switching to this “proper rendering” is the lost ability to do this:

    这一切都简单而美好。 当然,这正是为什么阴影,投影仪等无法在地形上起作用的问题-一切都被立即渲染 。 现在,新的Terrain代码只需将所有可见的地形部分提交给Intermediate Renderers即可 ,而渲染代码则将其余部分都列出来 ……但这意味着它正在经历通用渲染“管道”,即必须确定照明,分类对象,设置着色器及其参数等。切换到此“适当的渲染”的主要开销是失去执行此操作的能力:

    1. Draw lots and lots of objects with it.

      用它绘制很多物体。

    The rendering code in Unity does sort objects by shader, and does ultimately figure out that they are using same shader, possibly same set of textures, even possibly same set of lights and same set of material parameters – but some time is spent just figuring out that nothing actually changed between the objects.

    Unity中的渲染代码确实按着色器对对象进行排序,并最终确定它们使用的是相同的着色器,可能是相同的纹理集,甚至可能是相同的光源集和相同的材质参数集-但是花了一些时间才弄清楚物体之间实际上没有任何改变

    Well, the upside is that optimizing rendering internals makes everything else run somewhat faster as well!

    好吧,好处是优化渲染内部会使其他所有东西也更快地运行!

    (I am here right now… the points above are done, the points below are on the list)

    (我现在在这里…上面的要点已经完成,下面的要点已在列表中)

    o) Make hills/trees outside of view be able to cast shadows (how?)

    o)使视野之外的山丘/树木能够投射阴影(如何?)

    o) Expand shaders of detail meshes so they can cast shadows.

    o)展开细节网格物体的着色器,以便它们可以投射阴影。

    o) Optimize terrain & tree vertex lit shaders. Right now they process four vertex lights, where each can be directional or point light. This is noticeably slower than old shaders, that only supported directional lights (point lights need more calculations). We need to write multiple combinations of those shaders, specialized for specific situations (“one directional light”, “two direcitonal lights”, “two arbitrary lights”, and so on).

    o)优化地形和树顶点照明着色器。 现在,它们处理四个顶点光,每个顶点光可以是定向光或点光源。 这明显比旧的着色器慢,后者仅支持定向光源(点光源需要更多计算)。 我们需要针对特定​​情况编写这些着色器的多种组合(“一个定向光”,“两个定向光”,“两个任意光”,等等)。

    o) Add option somewhere for terrain to not cast shadows.

    o)不增加阴影的地方添加选项。

    o) Add option somewhere for trees to not cast shadows.

    o)在树的某处添加选项以产生阴影。

    o) Add option somewhere for detail objects to not cast shadows.

    o)在细节对象的某处添加选项,以产生阴影。

    o) (maybe, don’t know how to do) Option for grass to receive shadows.

    o) (也许不知道该怎么做)让草接收阴影的选项。

    o) Reduce memory allocations in terrain code. Because of intermediate rendering, some of temporary arrays are not actually needed anymore.

    o)减少地形代码中的内存分配。 由于存在中间渲染,因此实际上不再需要某些临时数组。

    Whew, that was quite a list! I’m not sure I’m able to even read through all of that… well, back to work.

    哇,那真是个清单! 我不确定我是否能读完所有这些内容……好,回到工作状态。

    翻译自: https://blogs.unity3d.com/2008/04/14/terrain-lighting-shadows-and-the-road-towards-it/

    arcgis显示地形阴影

    • 0
      点赞
    • 0
      收藏
      觉得还不错? 一键收藏
    • 0
      评论

    “相关推荐”对你有帮助么?

    • 非常没帮助
    • 没帮助
    • 一般
    • 有帮助
    • 非常有帮助
    提交
    评论
    添加红包

    请填写红包祝福语或标题

    红包个数最小为10个

    红包金额最低5元

    当前余额3.43前往充值 >
    需支付:10.00
    成就一亿技术人!
    领取后你会自动成为博主和红包主的粉丝 规则
    hope_wisdom
    发出的红包
    实付
    使用余额支付
    点击重新获取
    扫码支付
    钱包余额 0

    抵扣说明:

    1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
    2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

    余额充值