2016年6月23日 星期四

Building PBR-environments for Games by Berer Siino __為遊戲建立PBR場景 Berer Siino

Reference : Berer Siino

BUILDING PBR-ENVIRONMENTS FOR GAMES
Interview

Freelance artist Berker Siino and former Crytek artist, who worked on Ryse, Crysis 2 and Crysis 3, gave a detailed breakdown of his new environment for Rick Future adventure games. This is an incredibly example of great PBR-environment created with very limited resources. Berker talked about the production of materials with Quixel SUITE, described the way he used Unity 5 and shared some of his signature tricks in this amazing breakdown.

自由工作者Berker Siino而且是前認Crytek美術,曾經在羅馬之子,末日之戰2 3,將講述他為Rick Future adventure games所作的新場景細節分析,這是一個不可思議運用非常有限的資源,所使用PBR-場景的範例,Berker和Quixel SUITE討論有關材質產品,敘述他在Unity的使用方法,和分享一些特別的技巧,都在這驚艷的解析。

Introduction

My name is Berker Siino and I am currently working as a freelancer. I have previously worked at Crytek for about 5 years. The beginning of my career started at the Games Academy in Berlin where I studied 3D art and also made the first connections to many of the local game developers, Crytek being among them. In the course of my professional career I collected credits on Ryse, Crysis 2, Crysis 3 and numerous other smaller projects. I also supported pretty much every licensee using CryENGINE during their game development efforts.

介紹

我的名字Berker Siino,我最近是一位自由工作者。我之前在 Crytek 工作5年,我一開始的生涯是在柏林的遊戲學院,我專攻3D 美術並且開始初次接觸當地的遊戲開發者,Crytek是其中之一。在我的職業生涯課題中,我被納入Ryse(羅馬之子), Crysis 2(末日之戰 2), Crysis 3(末日之戰 3)和其他許多小專案。我也被贊助想當多的認證使用CryENGINE,當他們的遊戲在開發時。
One of my personal highlights was to be one of the guys who exported the first Star Citizen ships and showcased a demo scene to Chris Roberts and Cloud Imperium Games while they were evaluating CryENGINE. Working at Crytek advanced my skills in all kinds of directions and I quickly became an ‘all­arounder’, getting proficient in many areas.. Being able to take on technical art roles and still having the passion of being a 3D modeler and texture artist made me a quite useful member of my team at Crytek.

我個人較突出的作品之一,星際公民開發第一艘Star Citizen 船,並展示一個範例場景給 Chris RobertsCloud Imperium,當時他們正在評估CryEngine。在Crytek工作,我的技術在各種方面都進步並且我很快變成一位"多工人員",精通在各個領域。為當一位技術美術職位,並且仍需要有熱情在3D模型和貼圖美術上,使我成為一位在Cryrek團隊中有用的成員。

The Rick Future Project  Rick未來專案

After leaving Crytek and working as a freelancer for a few years I started working with MetalPop Games. MetalPop, also made up out of ex­Crytek devs asked me to help them out with all their art and technical art tasks for the adventure game they were working on.

在離開Crytek並成為自由工作者幾年後,我開始和MetalPop Game合作。MetalPop,也是前Crytek開發者創辦的,找我幫忙他們正開發冒險遊戲的所有美術和技術美術的測試。
The project was first developed using CryEngine but was switched over to Unity with the release of Unity 5. When I joined, one of the first things I did was to develop a new art pipeline to utilize the full strength of Unity’s new rendering features.. Being a very small team with limited capacity Unity was simply the better choice to get results quickly.

專案一開始使用CryEngine,但Unity5釋出後,就轉成Unity。當我參與時,我第一件事要做的就是開發出新的美術生產線,採用Unity的新渲染特色的完整效能。對一個非常小的團隊搭配能力受限的Unity,是單純最好的選擇並快速得到結果。
I got the chance to do the art direction and develop a new style for the game, and I think getting the chance to this meant quite a lot to me as an artist. As usual with indie development and having no publisher picking up the tab, time and money are constant worries. As an artist I still want to go as near as possible to a AAA quality with our game though. Only having a strong pipeline could realize this, which is one of the reasons why I used Quixel Suite to automate and create textures fast in PBR fashion. I took the responsibility to design, model, texture and art direct all game scenes, all in quite a short time. Our first result was the benchmark level, we call the ‘Engine Room.’

我有一個機會為一個遊戲去做美術主導和發展新的風格,並且我想得到這機會,對我身為一位美術意義重大。通常與獨立開發商和沒有發行商買單,時間和金錢是一直都是急迫。身為一位美術,我依然希望我們的遊戲能盡可能接近AAA水準。只有擁有牢靠的工作流程才能實現。也是我為什麼使用Quixel Suite的原因之一,自動化和在PBR潮流中快速製作貼圖。我的職責是設計,建模,貼圖,並且美術指導所有遊戲的場景,所有事情都在短時間內要處理。我們第一個成果是基準關卡,我們稱"引擎室"

    quixel suite, cryengine, crytek, unity, unity 5, unity technologies, game development, materials, lighting, textures, modeling, gamedev, gamedev tutorial, game industryquixel suite, cryengine, crytek, unity, unity 5, unity technologies, game development, materials, lighting, textures, modeling, gamedev, gamedev tutorial, game industryquixel suite, cryengine, crytek, unity, unity 5, unity technologies, game development, materials, lighting, textures, modeling, gamedev, gamedev tutorial, game industry

Preparation and pipeline 準備和工作流程

The main goal of creating levels and scenarios as the only artist in the team was to keep things simple but at the same time don’t lose fidelity and the details of a AAA game. In a production with more artists you can keep one guy busy with an asset to make sure to keep the desired quality level.In indie development of course this is not always possible. The main approach to achieve the look I was going for is to make use of lights and reflections. Of course those are only given when working with normalmaps and roughness/gloss maps in PBR. The beauty of PBR of course, is that you can change lights without worrying about objects looking wrong in different light conditions. If you get the material values right from the beginning, that is. Quixel Suite is a great tool for that matter. You can start by adding a base material and tweak it to your needs and of course try to break the procedural look of the mask generation. Thankfully Quixel now has a painting tool which allows you to have more artistic freedom while creating your assets. I did not have much time to model out every detail on an asset therefore I made sure that the base chamfers of an asset had the highpoly information included. To add further details I used NDO which gave me also a fast way of masking out the elements for a color ID map.

當團隊只有一位美術製作關卡和場景,此時的主要目標讓事情簡單,但同時不要失去真實度和AAA遊戲的細節。與許多美術在量產期,你可以保持一位美術專注在道具上,確保想要的品質。在獨立開發的過程上,這並不會時常發生。最主要的方法,讓外型達到我要的,就是製作光和反射。當然這些只能在PBR有Normal map 和粗糙 / 平滑Map可以給與。漂亮的BPR課題,就是你可以改變光而不需要擔心不一樣光的狀況,讓物件看起來是錯的。如果你一開始的材質是對的,就沒問題。Quixel Suite就是一套為此而生的。你可以一開始新增一個基本材質,並且微調成你需要的,當然試著打散程式生成的MASK外型(過於規律)。謝謝 Quixel 有Paint Tool,允許你在製作物件時,有更多藝術自由度。我沒有太多時間,把物件細節都建出來,因此我確立一個物件的基礎倒角必須要包含高面數Poly資訊,我使用NDO增加更多細節,也給我一個快速方法去MASK物件,做出Color ID Map。
The normal maps got baked out in XNormal by using cages that you can generate in the 3d viewer.
Xnormal在3d viewer中,藉由 Cage 烘焙Normal Map。
Xnormal_cage
The more important maps to get out of the tool, were the normal map with the green channel up, the curvature map (could be also baked in DDO) and an ambient occlusion map. The color ID map can either be baked from a highpoly model with different colored materials assigned to it, or created during the detail pass in NDO. Also important is to get the Xnormal Tspace synced to the engine tangent basis. I was using a plugin for that during beta of Unity 5 and had to smooth the angles of objects in engine manually. I am not 100% sure but I think that got fixed by now and you can use the standard Mikk ­Tspace now.

使用這工具所得到的更重要的Map,就是帶有綠通道的Normal Map,Curvature map(可以在DDO烘焙)和AO Map。Color ID Map也可以用不一樣的材質球給予高面數模型,烘焙取得。或是在NDO建立細部的pass。Xnomal Tspace同步引擎的法線基礎也很重要。我是在Unity5beta版裡用外掛並且手動在引擎中把物件角度平滑化。我不是100%確定,但我想現在已經修補並你現在可以用基本的Mikk ­Tspace(Xnomal的功能)
normalmapTB
After getting proper working normalmaps you have a foundation to build up detail in NDO. It is all about planning the asset. For example if you would see an asset from the side and you add tons of detail on a flat surface, this would destroy the purpose. You need to add geometry to keep a working silhouette, that is without question but only in areas where it makes sense.

得到適當的能用的Normal map,你就有一個基礎可以到NDO去建立細節,看如何設計物件。例如你從邊緣看這物件,你會增加細節在平面上,這會破壞原來的目的。你需要增加幾何面試著保持物件輪廓,這不會有問題,而且有效。
normalmap_workflow
From this point on you generate all your masks and smart materials in DDO until you get your final texture. I highly recommend not using standard smart material and call it a day. You have to make sure to get rid of the generic look of procedural textures. Quixel is pattern based so you can scale them and that is pretty much it. But now we can use the paint tool to also add variation, which is great. The power of generating presets and smart materials was the reason why I chose Quixel suite to be part of my pipeline. After creating the input nodes like normal map and ambient occlusion I was able to automate textures based on my smart materials that worked already perfectly in my scene.
從DDO裡,你產出所有mask和聰明的材質這點,到得到你的最終貼圖,這一點。我不建議使用基礎聰明材質和就這樣結束。你需要讓他減少看起來是程序製作出來的貼圖。Quixel是模板為基礎,所以你可調整。但現在我們可以使用paint tool去增加變化,這很棒。製作一些預設和聰明材質是我選擇Quixel suite 成為我的工作流程的理由,製作Input節點類似Normal map和AO之後,我可以以我的聰明材質,自動化貼圖。
My library of presets and smart materials grew over the course of creating the scene and I was able to use it on other levels as well, to get the production speed up.

我預設的收藏和聰明材質在建立場景過程中,不斷成長。我也可以使用它在其他的關卡,讓製作速度提升。

Unity 5 Needs Plugins  Unity 5需要外掛

The problem that I had during creating the pipeline was that I didn’t have access to certain tools that I got used to while working with CryENGINE. Unity 5 doesn’t have a solution for decals for instance, which is really not understandable for me. I was hoping to use POM and certain other next gen dx11 features on decals which I couldn’t. We didn’t change the standard shaders however and stuck to them. I was mainly focusing on getting the big picture and not the craziest shader setups. Rick Future is a point n’ click adventure game, so you have certain camera shots that track and pan slightly along the movement of the protagonist. You can’t come up close to a wall like a FPS game. It will probably happen that the game gets changed to a more advanced shader system in the future but that is not the case for now. I used certain plugins like SE Natural Bloom & Dirt Lens from Sonic Ether, Light Shafts and Easy Decals though.

我在建立工作流程時的問題,就是當我在CryENGINE工作時,我習慣我沒有使用特殊工具。Unity 5 沒有為立即衰減做處理,這讓我不解。我希望可以使用POM (Parallax Occlusion Mapping )和DX 11的功能,但我不能。

Light and reflections 燈光 和 反射

We are using deferred rendering in our project with the specular PBR workflow. Therefore we can use many lights without killing the performance of the game. The way I start my light setup is usually out of a dark scene. I mean, what is better than adding controlled information to get a certain look instead of starting from a default lid scene? A scene usually uses 3 lights. Key light as a main source of light, rim light to highlight silhouettes and a fill light to boost some of the too dark shadow areas. At this point I set all my non­dynamic assets to be static to let the system know which assets getting bounce during light generation. That is also the way to get access to glow. And we did need glow for certain science ­fiction elements of the game. I used dynamic lights mainly for the key lights to get shadows and light variations in the game. At any time the lights can be baked though (make sure to generate a second uv with non overlapping uv shells for lightmapping).

我們使用deferred rendering(deferred rendering中文) (燈光與算圖介紹中文 英文)和specular PBR的工作流程在我們的專案 ,因此我們可以使用很多燈,而無需犧牲遊戲表現。因此我一開始光的設定通常是在黑暗場景中,我指的是,什麼會比增加控制資訊得到更精確的外觀,還是一開始就從有預設光的場景開始,來的更好? 一個場景通常使用3盞燈,Key light為主要來源光,Rim Light 打亮出剪影輪廓並且Fill Light提亮太過黑暗陰影的地方。在這點,我會設置非動態物件(non-dynamic assets)保持靜態(static),可以在燈光產生時,讓系統知道那一個asset得到反彈(bounce),這也可以得到發光(glow),我們需要為遊戲的科幻小說的物件發光,我主要使用動態光源(dynamic lights)當作Key light,去遊戲中,得到陰影和光的變化。在任何時間,光可以烘培,透過(確定有製作第2層UV,不需要重疊UV,是為Light mapping)

You can use objects that are almost invisible to cast glow as some sort of fake light source. The tunnel area behind the main engine for example got the bounce light from a transparent object.
你可以使用無形(invisible)物件主導發光,如一些造假的發光來源,以引擎後端的隧道區為例,反彈光來自透明物體。
This effect could also be achieved by baking the bounce and then hiding the object after bake.
這個效果也可以藉由烘焙反彈光並且烘焙結束隱藏物件取得。
Building PBR-environments for Games
Usually you start by adding key lights with a default value of 1 intensity on a logical way. I got 2 major light sources in my scene, the top light from ceiling neon lamps and the engine glow light with the light shaft, both of them casting shadows. At this point the GI is also being generated and you can tweak them as you like by adding more bounce for instance.
 通常你會從新增Key light開始,預設強度為1。我在場景使用2盞主要燈光,頂燈是用天花板日光燈,引擎發光帶有光束,兩者都投射影子。此時,GI也會被產生,你可以細調他們,藉由增加燈製作更多的反彈。
Building PBR-environments for Games
The next steps are to make sure to get a bit more light in general into the scene. You do that by either tweaking the main light sources or simply adding a few more in the room.

下一步,確定場景有得到足夠的燈。無論是調整主燈來源,或在空間中增加一些燈。
One more tip:  另一個技巧
Try to avoid as much overlapping of the light radius/range as you can. It causes overdraw and hurts the performance. If you have more lights you should try to avoid it.

盡你所能試著避開太多燈光區域重疊,它會導致透支(overdraw)並且傷到效能。如果你有很多燈,試著避開。
Building PBR-environments for Games
Once you got the base lights done, you set up your reflection probe and capture all the surrounding environment into one reflection map. You can set it to real time to see all changes updating live. Finish up the light setup by placing indirect lights from monitors and other smaller light sources that should cast light. You can change the appearance of a light by using what Unity calls ‘light cookies’. It is basically a black white mask and is used to project the light in different shapes. Light is one of the best tools to model out shapes and forms. You can define them and guide the viewer through your scene with it. For example: I added spot lights to some of the areas such as the big generator close to the camera on the bottom left of the screen mainly because of the gameplay mechanics. There is a puzzle element behind the hatch which needs to be solved. In a lot of games they use these lights to guide the player. A door for example has usually some sort of light source attached, maybe a torch or a lantern to show the way.

一但你確立基礎燈,你設完你的Reflection probe和取得整個場景的 reflection map 。你可以設定為即時(real time) 去觀察它的即時變化。從螢幕中和其他較小的燈光來源,放置間接光。你可以改變光的顯示,使用Light Cookies,它就是一張黑白Mask,被用來投射出不一樣形狀的光。光是建立形狀和型式的最棒工具之一。你可以定義它們和引導玩家通過你的場景。例如,我增加一盞spot light 到某個區域,像是巨大發電機靠近攝影機,主要位在畫面左下角,因為是可操控機械。有一個機關物件,在艙口後面,需要被解開。在許多遊戲他們使用光去引導玩家。例如一扇門,通常都有某種光在上面相連,也許是火把或提燈照出通道。

Post process, color grading and tone mapping


Building PBR-environments for Games

Also important is to add is a screen space ambient occlusion to merge the objects contact shadows into the environment. I added a few more glow related scripts to get the SE Natural Bloom effects like lens dirt and bloom. Most important is color grading and tone mapping, even if I did not use it in my final scene setup. I got the results simply by using color grading. There is a lot of documentation about what color grading is and how to do it, but in a nutshell it is basically the idea of taking a screenshot of your current level pasting it into photoshop, manipulate colors and then throw it back into the engine.

還有很重要的是增加一個screen space ambient occlusion(SSAO)去合併物件碰觸的陰影到場景上。我增加許多發光有關的腳本,去得到SE Natural Bloom效果,類似鏡頭髒汙和過曝。最最最重要的是Color Grading(分色)和Tone mapping,即使我不在我最後的場景使用。我使用分色得到一些結果。有很多有關什麼是color grading文件和如何使用,但簡而言之,它最基本概念就是到你的場景,用print screen截取一張screenshot,並貼在Photoshop,手動調色,並丟回引擎。(Color Correction Lookup Texture)
With tonemapping on the other hand you can use an S curved tone curve to enhance contrast in the middle range and compress highlights and shadows. I would recommend to keep it simple here, because with all of these tools it is easy to get confused. Get the basics right and then add stuff, and if it is too much take it away and re­add with a different approach if needed.

你也可以使用Tonemapping,使用S曲線,提高中間調對比,並壓縮高光與陰影的部位。我建議盡可能讓它簡易,因為那些校色工具很容易讓人混淆。先把基本弄對,再追加上去。如果太多就減少,並且再重新加入不一樣的方法,如果是需要的話。