• No results found

Virtual Textures Dealing with Enormous Texture-Based Resources

N/A
N/A
Protected

Academic year: 2021

Share "Virtual Textures Dealing with Enormous Texture-Based Resources"

Copied!
78
0
0

Loading.... (view fulltext now)

Full text

(1)

Anders Scheel Nielsen 1

Virtual Textures

Dealing with Enormous Texture-Based Resources

(2)
(3)

Anders Scheel Nielsen 3

(4)
(5)

Anders Scheel Nielsen 5

(6)

Real life problems

Problems:

• Limited amount of resources (avg. 256 MB) • Large variation in system resources

• Maximum texture sizes from: fra 2048 x 2048 til 8192 x 8192 • Atomic Resource

(7)

Anders Scheel Nielsen 6

Real life problems

Problems:

• Limited amount of resources (avg. 256 MB) • Large variation in system resources

• Maximum texture sizes from: fra 2048 x 2048 til 8192 x 8192 • Atomic Resource

(8)

Real life problems

Problems:

• Limited amount of resources (avg. 256 MB) • Large variation in system resources

• Maximum texture sizes from: fra 2048 x 2048 til 8192 x 8192 • Atomic Resource

(9)

Anders Scheel Nielsen 6

Real life problems

Problems:

• Limited amount of resources (avg. 256 MB) • Large variation in system resources

• Maximum texture sizes from: fra 2048 x 2048 til 8192 x 8192 • Atomic Resource

Solution for ’large’ models:

• Repeating textures • Blending

(10)
(11)

Anders Scheel Nielsen 8

(12)
(13)

Anders Scheel Nielsen 10

Static handling of Texture budget

Using too much memory?

• Permanently reduce the texture resolution

• Load lower mip map levels

(14)

Static handling of Texture budget

Using too much memory?

• Permanently reduce the texture resolution

• Load lower mip map levels

(15)

Anders Scheel Nielsen 10

Static handling of Texture budget

Using too much memory?

• Permanently reduce the texture resolution

• Load lower mip map levels

(16)

Static handling of Texture budget

Using too much memory?

• Permanently reduce the texture resolution

• Load lower mip map levels

(17)

Anders Scheel Nielsen 11

(18)

Observations

Large Textures

• All ’points’ in a surface can be truly unique

(19)

Anders Scheel Nielsen 11

Observations

Large Textures

• All ’points’ in a surface can be truly unique

• Artists can add all the details to the texture they want

Texture loading with higher granularity

(20)

Observations

Large Textures

• All ’points’ in a surface can be truly unique

• Artists can add all the details to the texture they want

Load Textures Runtime:

• Artists/developers: No headaches from keeping texture budgets! • Smoother scaling for different hardware configurations

• Artists can (in theory) work in arbitrary resolution

Texture loading with higher granularity

(21)

Anders Scheel Nielsen 12

(22)
(23)

Anders Scheel Nielsen 14

(24)

Calculation of visible tiles

(25)

Anders Scheel Nielsen 16

Barrett’s Fragment shader

1 float mipmapLevel = calcMipmapLevel(uv * textureSize);

2 float2 tilePos = floor(uv * indirectionSize);

3 tilePos /= 256.0;

4 float2 tilePos_low = frac(tilePos);

5 float2 tilePos_high = floor(tilePos);

6 color.bg = floor(tilePos_low * 256.0 + 0.5)/255.0;

7 color.r = (tilePos_high.x + tilePos_high.y * 16)/255.0;

8 color.a = (mipmapLevel + textureId * 16)/255.0;

9

10 float calcTextureMipmapLevel(float2 uv) {

11 float2 dtdx = dFdx(uv);

12 float2 dtdy = dFdy(uv);

13 float2 dtex = dtdx*dtdx + dtdy*dtdy;

14 float minDelta = max(dtex.x,dtex.y);

15 float miplevel = max(0.5 * log2(minDelta), 0.0);

16 return miplevel;

(26)

Barrett’s Fragment shader

1 float mipmapLevel = calcMipmapLevel(uv * textureSize);

2 float2 tilePos = floor(uv * indirectionSize); 3 tilePos /= 256.0;

4 float2 tilePos_low = frac(tilePos);

5 float2 tilePos_high = floor(tilePos);

6 color.bg = floor(tilePos_low * 256.0 + 0.5)/255.0;

7 color.r = (tilePos_high.x + tilePos_high.y * 16)/255.0;

8 color.a = (mipmapLevel + textureId * 16)/255.0;

9

10 float calcTextureMipmapLevel(float2 uv) {

11 float2 dtdx = dFdx(uv);

12 float2 dtdy = dFdy(uv);

13 float2 dtex = dtdx*dtdx + dtdy*dtdy;

14 float minDelta = max(dtex.x,dtex.y);

15 float miplevel = max(0.5 * log2(minDelta), 0.0);

16 return miplevel;

(27)

Anders Scheel Nielsen 18

(28)

TD-texture

Texture usage:

• 5 texture types

• 4096 x 4096

• Usage: 80 MB

(29)

Anders Scheel Nielsen 18

TD-texture

Texture usage:

• 5 texture types

• 4096 x 4096

• Usage: 80 MB

(30)

TD-texture

1 color = tex2D(tdTexture, vertexIn.uv * coordScale);

2 color.w = tex2Dbias(tdTexture, vertexIn.uv, mipBias +

Texture usage:

• 5 texture types

• 4096 x 4096

• Usage: 80 MB

(31)

Anders Scheel Nielsen 19

Tilbagelæsning

(32)

Which tiles to load first?

Screen area prioritized

• Based on error metric:

(33)

Anders Scheel Nielsen 21

Which tiles to discard?

• First In First Out

• Least Frequently Used • Least Recently Used

(34)
(35)

Anders Scheel Nielsen 23

(36)
(37)

Anders Scheel Nielsen 25

(38)

Visual Results

(39)

Anders Scheel Nielsen 27

Resultater

Resultater

Resultater

Anders Scheel Nielsen 27

Resultater

Resultater

(40)

Diskussion

(41)

Anders Scheel Nielsen 29

(42)
(43)

Anders Scheel Nielsen 31

(44)
(45)

Anders Scheel Nielsen 33

(46)
(47)

Anders Scheel Nielsen 35

(48)

The demo

(49)

Anders Scheel Nielsen 36

The demo

Virtual Textures:

• Efficient handling of giant textures:

(50)

The demo

Virtual Textures:

• Efficient handling of giant textures:

Demo: 128k x 128k, theoretical: 2M x 2M (16 TB) • Texture usage for a 20 GB texture: 17 MB

(51)

Anders Scheel Nielsen 36

The demo

Virtual Textures:

• Efficient handling of giant textures:

Demo: 128k x 128k, theoretical: 2M x 2M (16 TB)

• Frame rate: 150-200 FPS (8800GT)

(52)
(53)

Anders Scheel Nielsen 38

Future work

Prediction of visible tiles

• Camera vector • A priori map

Virtuel Terrain

• Height map as a Virtual Texture

Other uses than games

• Browsing pictures

• Google Earth’ish applications

(54)

Contributions

Contributions

• Calculating visible tiles at greater precision with 2 lines of code

• Simple, but effective tile prediction method

• New strategies for prioritizing tiles

(55)

Anders Scheel Nielsen 40

(56)

Thank you!

Andreas Bærentzen

,

DTU

Carsten Kjær

,

Dalux

Daniel Povlsen

,

Aptocore

Martin Mittring

,

CryTek

GmbH

Sean Barrett

Per Rasmussen

(57)

Anders Scheel Nielsen 41

(58)

Media

(59)

Anders Scheel Nielsen 42

(60)

Reading tiles from media

Maximizing throughput MPixels/s:

• Compression = more MPixels/s

(61)

Anders Scheel Nielsen 42

Reading tiles from media

Maximizing throughput MPixels/s:

• Compression = more MPixels/s

(62)

Reading tiles from media

Maximizing throughput MPixels/s:

• Compression = more MPixels/s

(63)

Anders Scheel Nielsen 42

Reading tiles from media

Maximizing throughput MPixels/s:

• Compression = more MPixels/s

• Texture Layout on media: minimizing seek time

(64)

Diskussion 1

Ulemper ved metoden:

Transparente objekter

• Et ekstra prepass

Antal unikke teksturer

• Pakke flere teksturer i ét VT

• 8 bit tile-position

Kvalitetstab pga. manglende tekstur

• Højere teksturkomprimering

• Fjern visuel pops

(65)

Anders Scheel Nielsen 44

Diskussion 2

Hastighedstab pga. indirection

• men mindre state change • Genbrug

Filtrering

• Manuel i shader • Border padding

• Hardwareunderstøttelse

(66)
(67)

Anders Scheel Nielsen 46

Backup: SVT

(68)

Tilbagelæsning

Tilbagelæsning fra grafikkort til systemhukommelse

• Grundlag for metoden er tilbagelæsning til

systemhukommelsen

(69)

Anders Scheel Nielsen 48

Backup: SVT

(70)

Backup: Teksturrepetition

Introduktion Litteratur Metode Resultater Diskussion Konklusion

(71)

Anders Scheel Nielsen 50

Tekstur

Teksturrepetition Introduktion Litteratur Metode Resultater Diskussion Konklusion

(72)

Teksturrepetition

Introduktion Litteratur Metode Resultater Konklusion

(73)

Anders Scheel Nielsen 51

Teksturrepetition

Introduktion Introduktion Litteratur Metode Resultater Konklusion

(74)

Teksturrepetition

Introduktion Litteratur Metode Resultater Konklusion

(75)

Anders Scheel Nielsen 51

Teksturrepetition

Introduktion Introduktion Litteratur Metode Resultater Konklusion

(76)

Teksturrepetition

Introduktion Litteratur Metode Resultater Konklusion

(77)

Anders Scheel Nielsen 52

Resultater: Tekstur download

Resultater Introduktion Litteratur Metode Resultater Diskussion Konklusion

(78)

Resultater: Tekstur download

Introduktion Litteratur Metode Resultater Diskussion Konklusion

References

Related documents

International Journal of Lean Six Sigma, vol 3, no. Gummesson, E 1987, 'The New Marketing - Developing Long-term Interactive Relationships', Long Range Planning, vol 20, no. Hammer,

“If we would have worked with it in school before, of course using the Catalogue would be easier for us now.”..  request: reduction of

A state which identifies with the culture of democratic government is one which welcomes a wide scope of political participation embracing a pluralistic system of political parties,

(2013) Factors affecting implementation of accreditation programmes and the impact of the accredit- ation process of quality im- provement in Hospital accreditation Prior to

Table 3 reports the estimated results for developing and emerging countries and it shows that all estimated coefficients for RER misalignment are positive, indicating that a

Financial sector developments challenged the Banco de Moçambique to create new organic structures, such as the Supervision Department in 1991, to address the need

Omnilabs, SDSG Radiology, Haskell Pathology, Schottdorf (29 June Omnilabs, SDSG Radiology, Haskell Pathology, Schottdorf (29 June 2004) 2004)!. Organic revenue growth

Using guidelines for metadata creation, NGIS data standards, skills developed from user training, and support from the SPS, the staff from key participating agencies will