骑马与砍杀中文站论坛

 找回密码
 注册(Register!)

QQ登录

只需一步,快速开始

搜索
购买CDKEY 衣谷三国
查看: 2980|回复: 3

[官方日志] 《骑马与砍杀2:霸主》开发日志(129)——全局光照

[复制链接]

235

主题

1万

回帖

5368

积分

男爵[离任版主]

世纪风云制作组[场景]

圣殿骑士团[KT]
战团ID:KT_贤狼赫萝

Rank: 5Rank: 5Rank: 5

UID
720072
第纳尔
15200
精华
1
互助
278
荣誉
80
贡献
2040
魅力
1042
注册时间
2012-3-25

有生之年勋章战团正版勋章拿破仑正版勋章维京征服正版勋章骑士美德之英勇勋章[杰出会员活跃勋章]骑士美德之大无畏勋章[杰出会员高级活跃勋章]骑士美德之仁慈勋章[杰出会员互助勋章]骑士美德之正义勋章[杰出会员荣誉勋章]杰出汉化小组成员勋章骑士荣誉之霸主汉化勋章骑士荣誉之维京征服汉化勋章第一届战团中国联赛季军勋章

鲜花(918) 鸡蛋(14)
发表于 2019-11-9 11:13:36 | 显示全部楼层 |阅读模式

Greetings warriors of Calradia!

Lighting is an extremely important aspect of any modern game. Bad lighting can make the most detailed models and textures seem drab and lifeless, while good lighting helps to bring together the different visual elements on-screen to provide a more realistic and aesthetically pleasing polish. This is something that we are acutely aware of, and is what led to the introduction of Global Illumination (GI) to our game engine some time back, (which we briefly mentioned at the time in our Engine 1.4 Update blog).
卡拉迪亚的战士们,大家好!
光照是现代游戏非常重要的方面。糟糕的光照会让最细致的模型和纹理看起来枯燥无味,而好的光照能结合不同的视觉元素,在屏幕上呈现出更真实更好看的美化。这也就是我们注意的地方,以及能让我们在以前的日志中介绍全局光照(简称GI)(第47期开发日志,全新的引擎有提到全局光照)



Recently, we have been working on enhancing and heavily optimising this engine feature, so we wanted to take the time to expand on this and discuss GI in a little more detail, covering our requirements, how the system works, and touching on some of the difficulties we faced while implementing it.

现在,我们在致力于增强和重度优化引擎功能,所以我们想花点时间来拓展和讨论关于GI的详细内容。包括我们的要求,系统如何运作以及涉及到一些我们在施行这个系统时遇到了什么困难。

So, what is GI? To put it simply, GI is a system that models how light is bounced off of surfaces onto other surfaces, or in other words, indirect lighting. This allows light that has been emitted from a source, for example, a torch, to interact with surrounding objects in a more natural manner with some of the light being absorbed by the object and the rest being reflected onto other objects. The end result is a much more realistic representation of how light acts in the real world.

所以,什么是GI?简单来说,GI是一个能模拟光纤如何从一个物体表面反射到其他的表面,也就是间接照明。这能让光线从光源发散开,比如说火把,去和周围的物品相互作用来呈现更自然的光照,其中一些光线物体吸收,而其余光线被反射到其它物品上。最终就会呈现初现实世界中地真实光照。

In Bannerlord, we decided to go for a GI solution that can handle different lighting environments, can run on a wide spectrum of hardware, has low memory and hard drive usage and requires less manual work to be done per scene. With these requirements, we decided to use a static solution that bakes the lighting transfer on pre-defined probe points.

在《霸主》中,我们决定采取一种GI解决方案来处理不同的照明环境,这样能让更广泛的硬件,包括低内存和和低硬件使用率,需要更少的人工来完成这些。有了这些要求,我们决定用静态解决方案来烘培光照传播在一个预定点上。



For our implementation, we drew inspiration from multiple techniques. The core lighting algorithm uses the technique from Precomputed Radiance Transfer for Real-Time Rendering in Dynamic, Low-Frequency Lighting Environments (Sloan, et al, 2002). In addition to this, we implemented an in-game offline ray tracer to ensure that the lighting is correct with the ground truth. After that, we modified some equations so that gameplay would not be negatively affected (e.g. increasing the ambient light of torches).

在我们的应用上,我们从多种技术上汲取灵感。光照的核心算法使用的是预先计算辐射偏转以为了实时动态渲染,还有低频光照环境(Sloan, et al, 2002)此外,我们还实现了游戏中离线线射追踪器来确保光照和地面能有更真实的效果。在这之后,我们修改了一些公式,这样就不i会对游戏玩法造成负面影响(比如增加火把的环境光)

With probe-based methods, such as the one that our engine uses, a major issue is light leaking, which can drastically reduce the visual quality. To solve these leaking issues, we use the shadow map algorithm described in the Irradiance & Light field Probes with Visibility slide (Morgan McGuire, 2017). However, the most challenging and time-consuming part was to implement a process that can automate the probe placement, light leak shadow map placement, and baking process.

这种基于探测的方法,也是我们所用的这一套,一大问题在于漏光,这会大大降低画面质量。为了解决这个漏光问题,我们在可见光辐照度和光场探测以及视觉片上用了阴影地图算法 (Morgan McGuire, 2017)。然而,最有挑战性而且耗时间的部分在于应用一个能自动放置探测器的过程,漏光阴影地图放置和烘培过程

Firstly, we didn’t want to place probes everywhere as this would save huge amounts of memory and hard drive usage, which was one of our initial design requirements. So, to achieve the desired visual result while remaining conscious of hardware usage, our automated baking process uses the navigation mesh to find the positions that agents can go. Then, from these positions, rays are cast to find the visible points on the scene. For all of these points, the automatic process then places probes in a grid fashion. Following this, the automatic process assigns shadow-map functionality to the ones that might introduce leaks. For example, an outside probe which affects both the inside of a house and the outside will render a shadow-map to prevent leaking. Finally, the lighting transfer function is calculated for every probe placed. This process is done for every level combination for towns and once for multiplayer and interior maps.

首先,我们不想把探测器放地到处都是以节省内存和硬件使用,这也是我们最终的设计要求之一。因此,为了能达到这种视觉效果并维持硬件使用率,我们自动烘培过程用了导航网格来寻找媒介的位置。然后在这些位置上,投射光线可以找到场景的可见点。基于遇上这些点,自动过程是以网格的方式放置探测器。而这之后,自动过程将阴影贴图功能分配给可能导致漏光的点上。最终,每个放置的探测器都会计算光照传递函数。这个过程在每个不同等级的城镇,还有多人以及内景场景都有使用一次。

This automatic baking process can be run via the editor or our internal integration system, saving a huge amount of time for our scene designers! And the good news is that this will also be available to modders and is as simple as the click of a button in the scene editor. Also, additional editing time is optimised with many advanced editing operations like lasso and geometric selection operations and shortcuts in the editor.

这个自动烘培过程会通过编辑器在我们内部集成系统运行,为场景设计是节省大量时间!好消息是,这个也能让MOD制作者使用,而且简单到之按下一个按钮即可在场景编辑器使用。此外,还有很多高级的编辑操作,像是套索和集合选择操作以及编辑器的快捷方式,都能优化场景编辑所需要的时间。


We are quite pleased with the final results. Our implementation of GI certainly enhances the visuals of the game by adding some visual depth to scenes and making the environments more realistic, and all with a minimal impact on performance!
我们对于这个结果很满意。我们在GI上的应用能某些程度上增强游戏的视觉效果,给场景画面增加更多的深度,让环境变得更真实,这对性能的影响也维持到了最小!
http://bbs.mountblade.com.cn/thread-2017622-1-1.html

各位帮忙来投个票并发表一下自己的看法

0

主题

2

回帖

1

积分

平民

Rank: 1

UID
3112367
第纳尔
22
精华
0
互助
0
荣誉
0
贡献
0
魅力
0
注册时间
2019-10-16

霸主正版勋章

鲜花(0) 鸡蛋(0)
发表于 2019-11-9 12:48:16 | 显示全部楼层
我是第一个

35

主题

400

回帖

216

积分

见习骑士

Rank: 3

UID
2969903
第纳尔
86
精华
0
互助
13
荣誉
2
贡献
0
魅力
16
注册时间
2018-1-3
鲜花(93) 鸡蛋(1)
发表于 2019-11-9 13:09:11 | 显示全部楼层
还挺牛

348

主题

7612

回帖

3568

积分

骑士领主

自由骑士
战团ID:Rain_Drop

Rank: 6Rank: 6

UID
87963
第纳尔
9298
精华
1
互助
126
荣誉
45
贡献
548
魅力
1596
注册时间
2024-7-11

元老骑士勋章原版正版勋章战团正版勋章火与剑正版勋章维京征服正版勋章骑士美德之英勇勋章[杰出会员活跃勋章]骑士美德之大无畏勋章[杰出会员高级活跃勋章]骑士美德之仁慈勋章[杰出会员互助勋章]骑士美德之谦恭勋章[杰出会员财富勋章]骑士美德之忠诚勋章[杰出会员精华勋章]骑士美德之正义勋章[杰出会员荣誉勋章]骑士美德之诚信勋章骑士精神之浪漫勋章末日浩劫勋章骑士美德之奉献勋章骑士美德之慷慨勋章骑砍中文站微博会员勋章骑砍中文站微信会员勋章霸主正版勋章

QQ
鲜花(446) 鸡蛋(17)
发表于 2019-11-9 16:22:09 | 显示全部楼层
别跳票就行了,我的要求不高
您需要登录后才可以回帖 登录 | 注册(Register!)

本版积分规则

Archiver|手机版|小黑屋|骑马与砍杀中文站

GMT+8, 2025-9-3 12:15 , Processed in 0.090851 second(s), 26 queries , Gzip On, MemCached On.

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表