115
Andrei Tatarinov, Senior Developer Technology Engineer, NVIDIA Far Cry 4 and Assassin’s Creed Unity: Spicing Up PC Graphics with GameWorks

Far Cry 4 and Assassin's Creed Unity: Spicing Up PC Graphics with

Embed Size (px)

Citation preview

Andrei Tatarinov, Senior Developer Technology Engineer, NVIDIA

Far Cry 4 and Assassin’s Creed Unity: Spicing Up PC Graphics with GameWorks

2

Agenda

What games are we dealing with?

How to make these games look even better on PC?

The Mighty Three: HBAO+, PCSS, TXAA

Far Cry 4: Making the beasts look cute

Far Cry 4: Illuminating Kyrat with divine light

3

Far Cry 4

Open-world action-adventure first-person shooter

Set in Kyrat, a breathtaking, perilous and wild region of the Himalayas

Terrain spans from lush forests to the snowcapped mountains

Kyrat is home to abundant wildlife

Uses Dunia Engine 2

4

Far Cry 4

Set in astounding Himalayas

5

Far Cry 4

Player finds himself in the midst of a civil war

6

Far Cry 4

Absolute freedom of movement

7

Far Cry 4

Dangerous and deadly wildlife

8

Assassin’s Creed Unity

Historical fiction action-adventure open world stealth video game

Set in Paris during French Revolution

Stunning full-scale open world city, made possible by the all-new game engine

Unprecedented degree of freedom and control

Uses AnvilNext engine

9

Assassin’s Creed Unity

Set in Paris during French Revolution

10

Assassin’s Creed Unity

Set in Paris during French Revolution

11

Assassin’s Creed Unity

Open world

12

Assassin’s Creed Unity

Variety of moves

13

Assassin’s Creed Unity

Focus on stealth action

14

Assassin’s Creed Unity

Cooperative mode

15

Making PC versions look better

PC offers extra performance to add extra features

NVIDIA has technology that is ready to be integrated

Experience gained while working on Assassin’s Creed IV Black Flag

Both Ubisoft and NVIDIA dedicate engineers for collaboration

16

What GameWorks can offer?

We played both games and thought of what can NVIDIA GameWorks offer to make them look even better

NVIDIA ShadowWorks and NVIDIA PostWorks are a great fit for both Far Cry 4 and Assassin’s Creed Unity

NVIDIA HairWorks and NVIDIA Godrays are a great fit for Far Cry 4

The Mighty Three: HBAO+, PCSS, TXAA

18

NVIDIA ShadowWorks

Consists of different technologies to provide cinematic shadows

HBAO+

Advanced Soft Shadows

19

Horizon-Based Ambient Occlusion+

State of the art SSAO approach

Optimal performance

Scalable

20

No AO

21

Default

22

HBAO+

23

SSBC

24

HBAO+

25

Closer look

HBAO+ SSBC

26

Tuning HBAO+

Radius: Size of HBAO kernel

Bias: Hides low-tessellation artifacts

Exponent: Occlusion fall-off

Detail occlusion: Weight of high-frequency occlusion component

Coarse occlusion: Weight of low-frequency occlusion component

27

Advanced Soft Shadows

State of the art soft shadows

Based on Percentage Closer Soft Shadows (PCSS)

Support for cascaded shadow maps

Simple, but powerful interface

28

Advanced Soft Shadows

OFF

29

Advanced Soft Shadows

ON

30

Advanced Soft Shadows

OFF

31

Advanced Soft Shadows

ON

32

Advanced Soft Shadows

OFF

33

Advanced Soft Shadows

ON

34

Tuning Advanced Soft Shadows

Light size

Maximum threshold

Minimal percentage

Blend percent

Border percent

35

Tuning Advanced Soft Shadows

Light size

Maximum threshold

Minimal percentage

Blend percent

Border percent

Maximum threshold

Light size

Minimal percentage

36

Tuning Advanced Soft Shadows

Light size

Maximum threshold

Minimal percentage

Blend percent

Border percent

37

Tuning Advanced Soft Shadows

Light size

Maximum threshold

Minimal percentage

Blend percent

Border percent

38

Tuning Advanced Soft Shadows

Light size

Maximum threshold

Minimal percentage

Blend percent

Border percent

39

PCSS light leaks

40

Fixing light leaks

Light leaks occur when light size is too big

PCSS kernel gets too wide and samples outside cascades

Adjust border percent to limit the kernel

If light leaks are still there, decrease light size and maximum threshold

41

Advanced Soft Shadows in Far Cry 4

PCSS shadows are softer at mornings and evenings and sharper at noon

9:00AM

42

Advanced Soft Shadows in Far Cry 4

PCSS shadows are softer at mornings and evenings and sharper at noon

10:00AM

43

PCSS shadows are softer at mornings and evenings and sharper at noon

11:00AM

Advanced Soft Shadows in Far Cry 4

44

PCSS shadows are softer at mornings and evenings and sharper at noon

12:00AM

Advanced Soft Shadows in Far Cry 4

45

PCSS shadows are softer at mornings and evenings and sharper at noon

1:00PM

Advanced Soft Shadows in Far Cry 4

46

PCSS shadows are softer at mornings and evenings and sharper at noon

2:00PM

Advanced Soft Shadows in Far Cry 4

47

PCSS shadows are softer at mornings and evenings and sharper at noon

3:00PM

Advanced Soft Shadows in Far Cry 4

48

PCSS shadows are softer at mornings and evenings and sharper at noon

4:00PM

Advanced Soft Shadows in Far Cry 4

49

PCSS shadows are softer at mornings and evenings and sharper at noon

5:00PM

Advanced Soft Shadows in Far Cry 4

50

Advanced Soft Shadows in Far Cry 4

PCSS shadows were too sharp and aliased at noon

Shadows = SOFT SHADOWS

51

Advanced Soft Shadows in Far Cry 4

PCSS missed small-scale details

Shadows = SOFT SHADOWS

52

Advanced Soft Shadows in Far Cry 4

PCSS missed small-scale details

53

Advanced Soft Shadows in Far Cry 4

PCSS missed small-scale details

Small features

start disappearing

Small features are

completely gone

54

Advanced Soft Shadows in Far Cry 4

Original shadows handle this case properly

Shadows = ULTRA

55

Advanced Soft Shadows in Far Cry 4

Make light size depend on daytime

Re-configure cascades

Shadows = SOFT SHADOWS

56

Advanced Soft Shadows in Far Cry 4

Make light size depend on daytime

Re-configure cascades

Shadows = SOFT SHADOWS

57

Temporal Anti-Aliasing (TXAA)

Film-style anti-aliasing technique designed specifically to reduce temporal aliasing

Part of NVIDIA PostWorks family

58

No AA

59

FXAA

60

4xMSAA

61

TXAA

62

Temporal Anti-Aliasing (TXAA)

TXAA requires properly generated MSAA image as input

MSAA path in the engine should work correctly

Use g-buffer with MSAA

Make shading pass support MSAA

Add MSAA support for post-processing techniques

63

Summary

Five engineers were involved in integrating these features into both Assassin’s Creed Unity and Far Cry 4

One man-month per effect per title on average

Experience and knowledge from past collaborations saved us a lot of time

Far Cry 4: Making the beasts look cute

65

Wildlife in Far Cry 4

This is how animals of Kyrat look in real life:

66

Wildlife in Far Cry 4

This is how they look in real life:

67

Wildlife in Far Cry 4

The cutest creature in the whole game:

68

Wildlife in Far Cry 4

The cutest creature in the whole game:

69

Wildlife in Far Cry 4

The cutest creature in the whole game:

70

Wildlife in Far Cry 4

The cutest creature in the whole game:

71

NVIDIA HairWorks

Enables users to simulate and render fur to provide a truly interactive game experience

A combination of run-time library and a content creation tool

Actual game

HairWorks Viewer

72

HairWorks integration workflow

Get a proof-of-concept for HairWorks to be a good fit for Far Cry 4’s content

Integrate the run-time library into the engine and the level editor

Author the HairWorks assets

Add them to the game’s content

Perform the QA pass

73

Proof of concept

Perform initial experiments on assets from Far Cry 4 to see if HairWorks is a good fit for the game

Experiments were performed in the HairWorks Viewer

74

Proof of concept

Perform initial experiments on assets from Far Cry 4 to see if HairWorks is a good fit for the game

Experiments were performed in the HairWorks Viewer

Yak

Yak (NV Fur)

75

Integration into the engine

HairWorks run-time has a customizable rendering functionality

HairWorks fur properties are stored in additional textures

Far Cry 4 level editor has been modified to add new properties to support HairWorks

76

Authoring the assets

HairWorks Viewer was used to create the assets that were later exported to the

game

77

Authoring the assets

HairWorks Viewer was used to create the assets that were later exported to the

game

78

Authoring the assets

Two days required to do the initial authoring of each asset

30 assets total were created

79

Preserving the silhouettes

Fur is “baked” into the mesh

80

Preserving the silhouettes

Fur is “baked” into the mesh

81

Preserving the silhouettes

Artifacts appear if you try to both preserve the silhouette and leave the original mesh beneath the fur

82

Preserving the silhouettes

A modified mesh should be rendered when HairWorks is active

83

Preserving the silhouettes

A modified mesh should be rendered when HairWorks is active

84

Preserving the silhouettes

A modified mesh should be rendered when HairWorks is active

85

Shading

HairWorks allows you to implement your own shading model

Supports both forward and deferred shading

86

Shading in Far Cry 4

In Far Cry 4, we rely on Dunia rendering mechanics to perform shading

Custom material is used

HairWorks parameters are stored in g-buffer

Diffuse color, compressed

87

Shading in Far Cry 4

In Far Cry 4, we rely on Dunia rendering mechanics to perform shading

Custom material is used

HairWorks parameters are stored in g-buffer

Normals

88

Shading in Far Cry 4

In Far Cry 4, we rely on Dunia rendering mechanics to perform shading

Custom material is used

HairWorks parameters are stored in g-buffer

Specular power and scale

89

Shading in Far Cry 4

In Far Cry 4, we rely on Dunia rendering mechanics to perform shading

Custom material is used

HairWorks parameters are stored in g-buffer

HairWorks Fur tangents

90

Shading in Far Cry 4

In Far Cry 4, we rely on Dunia rendering mechanics to perform shading

Custom material is used

HairWorks parameters are stored in g-buffer

Result of deferred shading

91

Anti-aliasing

HairWorks generates a lot of tiny fur springs

Shimmering can be visible on fur

92

93

Anti-aliasing

Best solution is to render HairWorks fur in a separate, anti-aliasing enabled pass

In Far Cry 4 fur is rendered in the main pass and relies on global anti-aliasing

94

Anti-aliasing

Far Cry 4 relies on global anti-aliasing settings to fight shimmering

No AA applied

95

Anti-aliasing

Far Cry 4 relies on global anti-aliasing settings to fight shimmering

No AA applied

96

Anti-aliasing

Far Cry 4 relies on global anti-aliasing settings to fight shimmering

No AA applied

97

Anti-aliasing

Far Cry 4 relies on global anti-aliasing settings to fight shimmering

4xMSAA

98

Anti-aliasing

Far Cry 4 relies on global anti-aliasing settings to fight shimmering

4xTXAA

99

Summary

The animals of Kyrat now look even more realistic

One man-year and three engineers were needed to add this feature

One software engineer from Ubisoft

Two technical artists from NVIDIA

30 assets were created total

100

Summary

The animals of Kyrat now look even more realistic

One man-year and three engineers were needed to add this feature

One software engineer from Ubisoft

Two technical artists from NVIDIA

30 assets were created total

Most of these cuties are just too deadly!

101

Far Cry 4: Illuminating Kyrat with divine light

103

104 OFF

ON

105

NVIDIA Godrays

Realistically looking sun shafts

Vast opportunities for tuning

Scalable performance

106

Add some color!

First integration of Godrays used the in-game color of smoke

107

Add some color!

Using the sun color showed the best results

108

Find the balance

The scene looks completely fogged

In fact, it is just godrays adding too much density

109

Find the balance Make godrays intensity daytime-dependent

7:00AM

5:00PM

NOON

110

111

“ This is a very exciting feature.

Above all, this one makes a big

difference in image quality that is

noticeable throughout the game.

The drastic changes between

turning it on and off can totally

transform scenes in Far Cry 4.”

— HardOCP

112

Summary

One man-month and one engineer were needed to add this feature

One software engineer from NVIDIA

One week to perform a basic integration

Three weeks to tune the effect and fix artifacts

113

Overall summary

Five effects integrated into Far Cry 4

Three effects integrated into Assassin’s Creed Unity

Active phase of engagement took six months

Seven engineers from Ubisoft Kiev and six engineers from NVIDIA involved

114

Special thanks to:

Dane Johnston

Johnny Costello

Tim Tcheblokov

Oleg Arutyunyan

Alexey Barkovoy

Tae-Yong Kim

Chad Vivoli

NVIDIA:

Sam Kovalev

Roman Bobel

Mikhail Kravets

Artem Kandinsky

Aleksandr Polischuk

Dmitry Rozovik

Artem Kotsiuba

Anton Remezenko

Ubisoft:

Thanks!