Разделы презентаций


Volumetric Global Illumination At Treyarch

Содержание

Volumetric Global IlluminationGI in volume textureLean texture dataIBL baked from probesConvex blend shapes

Слайды и текст этой презентации

Слайд 1Volumetric Global Illumination At Treyarch
JT Hooker
Treyarch Senior Graphics Engineer

Volumetric Global Illumination At TreyarchJT HookerTreyarch Senior Graphics Engineer

Слайд 2Volumetric Global Illumination
GI in volume texture
Lean texture data
IBL baked from

probes
Convex blend shapes

Volumetric Global IlluminationGI in volume textureLean texture dataIBL baked from probesConvex blend shapes

Слайд 3Presentation Order
Where we started


Evolution along the way


Where we ended up

Presentation OrderWhere we startedEvolution along the wayWhere we ended up

Слайд 4Traditional Approach: Lightmaps
Could be ok, but…

Traditional Approach: Lightmaps Could be ok, but…

Слайд 5Lightmap Downsides
Works poorly on detailed or intersecting geometry

Lightmap Downsides Works poorly on detailed or intersecting geometry

Слайд 6Lightmap Downsides
Doesn’t work at all on dynamic geometry

Lightmap Downsides Doesn’t work at all on dynamic geometry

Слайд 7Lightmap Downsides
Software ray-tracing and shading takes forever

Lightmap Downsides Software ray-tracing and shading takes forever

Слайд 8Lightmap Downsides
Results not visible in world editor

Lightmap Downsides Results not visible  in world editor

Слайд 9Process of Invention
Deferred Renderer
Reflections already present
So how do we apply

deferred GI?

Process of InventionDeferred RendererReflections already presentSo how do we apply deferred GI?

Слайд 10Reflection Probes as Diffuse Data
Higher Mips: convolved specular [DROBOT13]

Lowest Mip: diffuse irradiance
Real time IBL

Reflection Probes as Diffuse DataHigher Mips: convolved specular  [DROBOT13]Lowest Mip: diffuse irradiance Real time IBL

Слайд 11Occlusion Is A Problem

Occlusion Is A Problem

Слайд 12Visibility Is A Problem
Where the probe doesn’t see
Looks like shadows

Visibility Is A ProblemWhere the probe doesn’t seeLooks like shadows

Слайд 13Irradiance Volume
[TATARCHUK05]

Irradiance Volume[TATARCHUK05]

Слайд 14Render a Reflection Probe Per Voxel?
138 Volumes × 403 Voxels

× 6 Faces
÷ 60 FPS ÷ 60 Seconds
= 14,720 Minutes

(≈ 10 Days)
Render a Reflection Probe Per Voxel?138 Volumes × 403 Voxels × 6 Faces÷ 60 FPS ÷ 60

Слайд 15Collect Colors From Reflection Probes
Re-project cube maps
Combine to fill holes [BUEHLER01]

Collect Colors From Reflection ProbesRe-project cube mapsCombine to fill holes 	[BUEHLER01]

Слайд 16In Practice
4096 rays per voxel
15 neighbors considered
Missed rays are in-painted

In Practice4096 rays per voxel15 neighbors consideredMissed rays are in-painted

Слайд 17Re-Project From Existing Probes

Re-Project From Existing Probes

Слайд 18Reprojection
Neighbor candidates sorted based on distance

What about spec?

ReprojectionNeighbor candidates  sorted based on distanceWhat about spec?

Слайд 19Reprojection
Angle and distance to surface defines a solid angle in

the cube map

ReprojectionAngle and distance  to surface  defines a solid angle  in the cube map

Слайд 20Reprojection
Sample area validated against depth pyramid

If visible appropriate mip sampled

ReprojectionSample area validated against depth pyramidIf visible appropriate mip sampled

Слайд 21Reprojection Caluclation

Reprojection Caluclation

Слайд 22Reprojection Calculation
distFromUnitCube = √( 1 + u2 + v2 );

// Compensation for cube-map shape.
angleOfVoxel = 4 * PI /

numSamples; // Solid angle from voxel.
inSqrt = 1 + distFromVoxel2 * angleOfVoxel * ( angleOfVoxel – 4PI ) / ( 4 * PI2 * distFromProbe2 );
angleOfProbe = 2PI * ( 1 – √inSqrt ); // Solid angle from reflection probe.
cubeRes = 1.0f / √( angleOfProbe * distFromUnitCube3 ); // Resolution needed for sample.
mipLevel = clamp( mipCount – log2( cubeRes ), 0, mipCount ); // Mip level to use.

return mipLevel;
Reprojection CalculationdistFromUnitCube = √( 1 + u2 + v2 ); // Compensation for cube-map shape.angleOfVoxel = 4

Слайд 23Biggest Benefit
Hardware rendering

Re-render to get bounces

Only have to ray-trace and

re-project once

Biggest BenefitHardware renderingRe-render to get bouncesOnly have to ray-trace and re-project once

Слайд 24Texture Encoding
Flat Color?

Texture EncodingFlat Color?

Слайд 25Ambient / Highlight / Direction?
Texture Encoding

Ambient / Highlight / Direction?Texture Encoding

Слайд 26Second Order Spherical Harmonic?
Texture Encoding

Second Order Spherical Harmonic?Texture Encoding

Слайд 27Ambient Cube! [MCTAGGART04]
BC6H Compressed
Texture Encoding

Ambient Cube! [MCTAGGART04]BC6H CompressedTexture Encoding

Слайд 28Volume Texture Layout

Volume Texture Layout

Слайд 29Performance Benefits
Only 3 samples

Hardware trilinear filtering

Evaluation: color[n] = normal2 ∙ float3(

Xsample[n], Ysample[n], Zsample[n] )
color = xVolume.SampleLevel( coord ) * normal.x

* normal.x +
yVolume.SampleLevel( coord ) * normal.y * normal.y +
zVolume.SampleLevel( coord ) * normal.z * normal.z;
Performance BenefitsOnly 3 samplesHardware trilinear filteringEvaluation: color[n] = normal2 ∙ float3( Xsample[n], Ysample[n], Zsample[n] )color = 	xVolume.SampleLevel(

Слайд 30Light Leaking Is A Problem

Light Leaking Is A Problem

Слайд 31Common Approach
Adjust trilinear Based on normal [SILVENNOINEN15]

Our approach needs to be more

reliable

Common ApproachAdjust trilinear  Based on normal [SILVENNOINEN15]Our approach needs to be more reliable

Слайд 32More Voxel Data
Planes

Signed distance field

Bad artifacts

More Voxel DataPlanesSigned distance fieldBad artifacts

Слайд 33Solve With Shaping

Solve With Shaping

Слайд 34Click To Size Boxes

Click To Size Boxes

Слайд 35Click To Add Boxes
Auto-parent on creation

Click To Add BoxesAuto-parent on creation

Слайд 36Voxels Near Walls

Voxels Near Walls

Слайд 37Consider Backfaces

Consider Backfaces

Слайд 38Complex Room Shapes

Complex Room Shapes

Слайд 39Solution: Convex Shapes

Solution: Convex Shapes

Слайд 40Multiface Volumes
Click to add and remove faces.

Multiface VolumesClick to add and remove faces.

Слайд 41Multiface Volume Editing
Drag / Cut / Slice / Rotate

Multiface Volume EditingDrag / Cut / Slice / Rotate

Слайд 42Subtract Shapes
CSG add
Then subtract

Subtract ShapesCSG addThen subtract

Слайд 43Override Volumes
Like priority
Only two levels.

Override VolumesLike priorityOnly two levels.

Слайд 44Runtime Implementation
Cull against volume AABB’s to build a list of

volumes
Per pixel calculate attenuation on visible volumes
Convex hull CSG
Groups of

six planes either extended, combined or subtracted

Runtime ImplementationCull against volume AABB’s to build a list of volumesPer pixel calculate attenuation on visible volumesConvex

Слайд 45Example GI Volume
struct PlaneGroup
{
float4 planes[6]; // Groups

of six planes.
bool subtractive; // Per group, specifies

whether it adds or subtracts.
bool finished; // Per group, whether it should be combined with the previous.
}
struct GIvolume
{
PlaneGroup *groups;
}

// Blends, or “feather”, are pre-multiplied into the plane definition.
planes[i].xyz = planeNormal;
planes[i].w = planeOffset;
planes[i] /= blendWidth; // Blend width is a scalar for how wide the blend is.
Example GI Volumestruct PlaneGroup {  float4 planes[6]; // Groups of six planes.  bool subtractive; //

Слайд 46Group Size?
[6]+[6+6+…?

[6]+[4+4+...?

[4]+[4+4+…?

[8]+[2+2+…?

Group Size?[6]+[6+6+…?[6]+[4+4+...?[4]+[4+4+…?[8]+[2+2+…?

Слайд 47Shader Example
attenuation = 0;
groupAtten = 1;
for ( int group =

0; group < numGroups; group++)
{
groupAtten *= saturate(

dot( planes[group][0].xyz, pos ) + planes[group][0].w );
groupAtten *= saturate( dot( planes[group][1].xyz, pos ) + planes[group][1].w );
groupAtten *= saturate( dot( planes[group][2].xyz, pos ) + planes[group][2].w );
groupAtten *= saturate( dot( planes[group][3].xyz, pos ) + planes[group][3].w );
groupAtten *= saturate( dot( planes[group][4].xyz, pos ) + planes[group][4].w );
groupAtten *= saturate( dot( planes[group][5].xyz, pos ) + planes[group][5].w );
if( finished[group] )
{
if( subtractive[group] )
attenuation = max( attenuation, groupAtten );
else
attenuation *= 1.0f - groupAtten;
groupAtten = 1;
}
}
return saturate( attenuation );
Shader Exampleattenuation = 0;groupAtten = 1;for ( int group = 0; group < numGroups; group++) {

Слайд 48Why Not K-DOPs?
KDOP – k-sided Discrete Oriented Polytope

Pairs of planes

or slabs
Instead of individual planes
X

Why Not K-DOPs?KDOP – k-sided Discrete Oriented PolytopePairs of planes or slabsInstead of individual planesX

Слайд 49Runtime Implementation
Sample three ambient cube values depending on normal
Blend results

between all volumes

Runtime ImplementationSample three ambient cube values depending on normalBlend results between all volumes

Слайд 50Challenges

Challenges

Слайд 51Problem: Geo Within Voxels

Problem: Geo Within Voxels

Слайд 52Solution: Smart Centers

Solution: Smart Centers

Слайд 53Invalidate Near Geometry

Invalidate Near Geometry

Слайд 54Empty Space Skip

Empty Space Skip

Слайд 55Problem: Seams

Problem: Seams

Слайд 56Solution: Volume Smoothing

Solution: Volume Smoothing

Слайд 57Careful Lighting Artistry

Careful Lighting Artistry

Слайд 58Auto Volumes?
“Do-Everything Button”

Auto Volumes?“Do-Everything Button”

Слайд 59Volume Blending And Density
Volume Overdraw Per Tile
Debug Tools

Volume Blending And DensityVolume Overdraw Per TileDebug Tools

Слайд 60Reflections

Reflections

Слайд 61Reflection Planes
[LAGARDE12]

Reflection Planes[LAGARDE12]

Слайд 62Clever Artistry

Clever Artistry

Слайд 63Reflection Plane Parallax
float reflectionMip = ( 1 – gloss )

* numMips;

// as things get rougher “fade off” parallax correction
//

by pushing out intersection planes
float minDist = saturate( ( reflectionMip – 2.5 ) / ( numMips – 2.5 ) ) * 100;
distanceToPlane = max( abs( distanceToPlane ), minDist );

float intersectionDist = abs( distanceToPlane / -dot( direction, plane.xyz ) );
Reflection Plane Parallaxfloat reflectionMip = ( 1 – gloss ) * numMips;// as things get rougher “fade

Слайд 64Parallax Fade Out

Parallax Fade Out

Слайд 65Reflection Brightness Correction
[LAZAROV13]

Reflection Brightness Correction[LAZAROV13]

Слайд 66Reflection Brightness Correction

Reflection Brightness Correction

Слайд 67Max specular brightness is just a guess based on angle

and gloss
The light mostly probably came from a certain direction

and area
This defines a cone of a certain size
Actual numbers determined experimentally

We know the diffuse light is a function of what’s in the specular map
Assume a maximum specular brightness that created this diffuse brightness
Adjust the sampled specular against the theoretical maximum

float maximumSpecValue = max3( 1.26816,
9.13681 * exp2( 6.85741 - 2 * mip ) * nDotV,
9.70809 * exp2( 7.085 - mip - 0.403181 * mip2) * nDotV );

float adjustedMaxSpec = diffuseGILum * maximumSpecValue;
float3 specLum = luminance( cubeMapSample );
float3 reflection = cubeMapSample *
adjustedMaxSpec / ( adjustedMaxSpec + speculum );

Brightness Correction

Max specular brightness is just a guess based on angle and glossThe light mostly probably came from

Слайд 68Pros:
As good or better quality than light maps

Pros:As good or better quality than light maps

Слайд 69Pros:
Less than 2ms for reflections and GI

Pros:Less than 2ms for reflections and GI

Слайд 70Pros:
Works on all geometry

Pros:Works on all geometry

Слайд 71Pros:
Less baking time with incremental baking

Pros:Less baking time with incremental baking

Слайд 72Pros:
Baking is done in editor

Pros:Baking is done in editor

Слайд 73Pros:
Moving and changing GI

Pros:Moving and changing GI

Слайд 74Pros:
Loose connection between light and geo

Pros:Loose connection between light and geo

Слайд 75Cons:
Takes set up time

Cons:Takes set up time

Слайд 76Cons:
Training is hard

Cons:Training is hard

Слайд 77Cons:
Either lower resolution or more memory use in game

Cons:Either lower resolution or more memory use in game

Слайд 78Cons:
Need beefy dev machines (48Gb RAM and 12Gb VRAM)

Cons:Need beefy dev machines (48Gb RAM and 12Gb VRAM)

Слайд 79Cons:
Development challenges

Cons:Development challenges

Слайд 80Special Thanks
Treyarch:
Dimitar Lazarov – Original Idea
Kevin Myers – Baking Code
Everyone

Else at Treyarch
Activision Central Tech:
Peter-Pike Sloan – Lots of Math
Josiah

Manson – Light Bake Features
Angelo Pesce – Reflection Solutions
Special ThanksTreyarch:Dimitar Lazarov – Original IdeaKevin Myers – Baking CodeEveryone Else at TreyarchActivision Central Tech:Peter-Pike Sloan –

Слайд 81References
[DROBOT13] DROBOT, M., 2013. Lighting Killzone: Shadow Fall, Digital Dragons

[TATARCHUCK05]

TATARCHUK, N., 2005. Irradiance Volumes for Games, GDC Europe
 
[BUEHLER01] BUEHLER,

C., BOSSE, M., MCMILLAN, L., GORTLER, S., COHEN, M., 2001. Unstructured Lumigraph Rendering, SIGGRAPH

[MCTAGGART04] MCTAGGART, G., 2004. Half-Life 2 / Valve Source Shading, Game Developers Conference

[SILVENNOINEN15] SILVENNOINEN, A., TIMONEN, V., 2015. Multi-Scale Global Illumination in Quantum Break, SIGGRAPH
  
[LAGARDE12] LAGARDE, S., ZANUTTINI, A., 2012. Local Image-based Lighting With Parallax-corrected Cubemaps, SIGGRAPH

[LAZAROV13] LAZAROV, D., 2013. Getting More Physical in Call of Duty: Black Ops II, SIGGRAPH
References[DROBOT13] DROBOT, M., 2013. Lighting Killzone: Shadow Fall, Digital Dragons[TATARCHUCK05] TATARCHUK, N., 2005. Irradiance Volumes for Games,

Обратная связь

Если не удалось найти и скачать доклад-презентацию, Вы можете заказать его на нашем сайте. Мы постараемся найти нужный Вам материал и отправим по электронной почте. Не стесняйтесь обращаться к нам, если у вас возникли вопросы или пожелания:

Email: Нажмите что бы посмотреть 

Что такое TheSlide.ru?

Это сайт презентации, докладов, проектов в PowerPoint. Здесь удобно  хранить и делиться своими презентациями с другими пользователями.


Для правообладателей

Яндекс.Метрика