Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW...

33
HARD SHADOW ANTI-ALIASING FOR SPOT LIGHTS IN A GAME ENGINE MÁRCIO C. F. MACEDO (MARCIOCFMACEDO@GMAIL.COM ) ALMIR V. S. TEIXEIRA (A.VINICIUS.12@GMAIL.COM ) ANTONIO L. APOLINÁRIO JR. (APOLINARIO@DCC.UFBA.BR ) KARL A. AGUERO (KARL@DCC.UFBA.BR ) PGCOMP (UFBA BRAZIL)

Transcript of Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW...

Page 2: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

AGENDA

Introduction;

Shadow Mapping;

Revectorization-based Shadow Mapping;

Results and Discussion;

Conclusion and Future Works.

2

Page 3: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

INTRODUCTION 3

Page 4: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

CONTEXT

4

Shadows are important

in games because:

they improve the visual

perception of the player;

Dynamic Shadows on Mass Effect 3. Available in https://www.geforce.com/whats-new/guides/mass-effect-3-tweak-guide#6

No Shadow Shadows

Page 5: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

CONTEXT

Shadow Mapping [Williams1978]:

Default shadow technique for game engines;

Real-time performance;

Aliasing artifacts;

5

Page 6: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

CONTEXT

Revectorization-based Shadow Mapping

[Macedo2016]:

Shadow anti-aliasing;

High visual quality;

Minimal overhead;

6

Page 7: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

SHADOW MAPPING 7

Page 8: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

SHADOW MAPPING

8

Step 1 – Load the scene;

Page 9: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

SHADOW MAPPING

9

Step 2 – Render the scene from light source’s

viewpoint;

Page 10: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

SHADOW MAPPING

10

Step 3 – Generate a shadow map;

Page 11: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

SHADOW MAPPING

11

Step 4 – Compute the real-time shadows;

Page 12: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

REVECTORIZATION-BASED

SHADOW MAPPING 12

Page 13: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

REVECTORIZATION-BASED SHADOW

MAPPING

This technique aims to solve the aliasing problem

generated by shadow mapping;

13

Page 14: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

REVECTORIZATION-BASED SHADOW

MAPPING

Step 1 – Render the aliased shadow;

14

Page 15: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

REVECTORIZATION-BASED SHADOW

MAPPING

Step 2 – Evaluate visibility of neighbourhood;

15

Page 16: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

REVECTORIZATION-BASED SHADOW

MAPPING

Step 3 – Detect aliasing directions;

16

Page 17: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

REVECTORIZATION-BASED SHADOW

MAPPING

Step 4 – Traverse the aliased shadow boundary;

17

Page 18: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

REVECTORIZATION-BASED SHADOW

MAPPING

Step 5 – Normalize distance to aliasing;

18

Page 19: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

REVECTORIZATION-BASED SHADOW

MAPPING

Step 6 – Revectorize the shadow boundary;

19

Page 20: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

REVECTORIZATION-BASED SHADOW

MAPPING

Step 7 – Render the anti-aliased shadow;

20

Page 21: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

REVECTORIZATION-BASED SHADOW

MAPPING

21

Shadow Mapping RBSM

Page 22: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

RESULTS AND DISCUSSION 22

Page 23: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

EXPERIMENTAL SETUP

Hardware:

NVIDIA GeForce GTX Titan X graphics card;

Intel CoreTM i7-3770K CPU (3.50 GHz);

8GB RAM;

Software:

Unity3D Pro version 5.6.0.f3;

23

Page 24: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

RESULTS

Visual Quality:

24

Shadow Mapping RBSM

Page 25: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

RESULTS

Visual Quality:

25

Shadow Mapping

Page 26: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

RESULTS

26

Visual Quality:

RBSM

Page 27: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

RESULTS

Visual Quality:

27

Shadow Mapping RBSM

Page 28: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

RESULTS

Rendering Time:

28

0

1

2

3

4

5

6

720p 1080p 2160p Pro

cessin

g T

ime (

ms)

Varying Output Resolution

Shadow Mapping RBSM

0

1

2

3

4

5

6

256² 512² 1024² 2048² Pro

cessin

g T

ime (

ms)

Varying Shadow Map Resolution

Shadow Mapping RBSM

Page 29: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

RESULTS

Rendering Time:

29 0

1

2

3

4

5

6

720p 1080p 2160p Pro

cessin

g T

ime (

ms)

Varying Output Resolution

Shadow Mapping RBSM

0

1

2

3

4

5

6

256² 512² 1024² 2048² Pro

cessin

g T

ime (

ms)

Varying Shadow Map Resolution

Shadow Mapping RBSM

Page 30: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

RESULTS

Rendering Time:

30

0

1

2

3

4

5

6

720p 1080p 2160p Pro

cessin

g T

ime (

ms)

Varying Output Resolution

Shadow Mapping RBSM

0

1

2

3

4

5

6

256² 512² 1024² 2048² Pro

cessin

g T

ime (

ms)

Varying Shadow Map Resolution

Shadow Mapping RBSM

Page 31: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

CONCLUSION AND FUTURE

WORK 31

Page 32: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

FINAL CONSIDERATIONS

Conclusion:

We have shown that, by the use of the proposed implementation of RBSM, we are able to minimize the aliasing artifacts, generating high-quality hard shadows at little additional cost;

Due to the limited source code access provided by Unity, we were not able to implement RBSM for other types of light sources;

We could not implement RBSM for soft shadows that simulate the penumbra effect;

Future Work:

The implementation of RBSM using the full Unity source code;

The implementation of RBSM in other game engines; 32

Page 33: Apresentação do PowerPoint · Step 2 – Render the scene from light source’s viewpoint; SHADOW MAPPING 10 Step ...

REFERENCES

[Williams1978] – L. Williams. “Casting Curved

Shadows on Curved Surfaces”. In Proceedings of

the ACM SIGGRAPH, pages 270-274, 1978;

[Macedo2016] – M. Macedo and A. Apolinário.

“Revectorization-based Shadow Mapping”. In

Proceedings of the Graphics Interface, pages 75-

83, 2016.

33