    This subtitle is 20 points Bullets are blue They have 110% line spacing, 2 points before & after Longer bullets in the form.

Download Report

Transcript     This subtitle is 20 points Bullets are blue They have 110% line spacing, 2 points before & after Longer bullets in the form.





This subtitle is 20 points
Bullets are blue
They have 110% line spacing, 2 points before & after
Longer bullets in the form of a paragraph are harder to
read if there is insufficient line spacing. This is the
maximum recommended number of lines per slide
(seven).
 Sub bullets look like this




This subtitle is 20 points
Bullets
are blueImage-based
Local
Lighting
They have 110% line spacing, 2 points before & after
With bullets
Parallax-corrected
Cubemap
Longer
in the form of a paragraph
are harder to
read if there is insufficient line spacing. This is the
maximum
recommended
number
of lines
per slide
Sébastien
Lagarde,
Antoine
Zanuttini
(seven).
DONTNOD Entertainment
 Sub bullets look like this




This subtitle is 20 points
Bullets are blue
They have 110% line spacing, 2 points before & after
Image-based Lighting
Longer bullets in the form of a paragraph are harder to
read if there is insufficient line spacing. This is the
maximum recommended number of lines per slide
(seven).
 Sub bullets look like this
Image-based lighting (IBL)







Thisgood
IBL
subtitle
for is
simulating
20 pointsambient lighting
Bullets
Talk
focuses
are blue
on
 Static
IBL 110% line spacing, 2 points before & after
They
have
 Glossy/specular indirect lighting
Longer
bullets in the form of a paragraph are harder to
IBL
implemented
withline
cubemaps
game
readoften
if there
is insufficient
spacing. in
This
is the
Good
results
but with some
artifacts
maximum
recommended
number
of lines per slide
(seven).
Can
we improve the results ?
 Sub bullets look like this
Distant IBL





This subtitle
is 20 points
Infinite
cubemap
Offline
Bullets
are
blue
 Distant
lighting
 No position
They
have 110% line spacing, 2 points before & after
 Hand bullets
authoredin the form of a paragraph are harder to
Longer
Zone-based
read if there is insufficient line spacing. This is the
maximum
recommended
 Contributes
to all objects number of lines per slide
(seven).
 Smooth lighting transition
 Sub bullets look like this
Runtime
Local IBL





This subtitle
is 20 points
Local
cubemap
Offline
 Local are
lighting
Bullets
blue
 Position
They
have 110% line spacing, 2 points before & after
 In-engine generated
Longer bullets in the form of a paragraph are harder to
Object-based
read if there is insufficient line spacing. This is the
 Contribute to nearest
maximum
recommended number of lines per slide
objects
(seven).
 Lighting seams
Sub bullets
look like this
 Parallax
issue
Runtime
Local IBL
 This subtitle
is 20 points
 Lighting
seams
 Parallax issue
 Bullets are blue
 They have 110% line spacing, 2 points before & after
 Longer bullets in the form of a paragraph are harder to
read if there is insufficient line spacing. This is the
maximum recommended number of lines per slide
(seven).
 Sub bullets look like this




This subtitle is 20 points
Bullets are blue
They have 110% line spacing, 2 points before & after
Our Local Image-based Lighting
Longer bullets in the form of a paragraph are harder to
Approach
read if there is insufficient
line spacing. This is the
maximum recommended number of lines per slide
(seven).
 Sub bullets look like this
Our Local IBL Approach
 Mix
localiscubemaps
This of
subtitle
20 points



Offline
 Position
Bullets
are blue
 Local lighting
They
have generated
110% line spacing, 2 points before & after
 In-engine
Longerof
bullets
in the- form of a paragraph are harder to
Point
interest
read if there is insufficient line spacing. This is the
based
maximum
 Contributerecommended
to all objects number of lines per slide
 No lighting seams
(seven).
 Still parallax issue
 Sub bullets look like this
Runtime
Our Local IBL Approach




This
is 20 points
Pointsubtitle
of interest
(POI)?
Bullets
aredependent
blue
Context
They
have 110% line spacing, 2 points before & after
 Camera
Longer
 Playerbullets in the form of a paragraph are harder to
read
if there
is insufficient line spacing. This is the
 Any
character
maximum
number of lines per slide
 Dummy recommended
location
(seven).
 Animated by a track
 Sub bullets look like this
Our Local IBL approach
This subtitlevolume
is 20 points
 Influence
link to




Bulletscubemap
are blue
local
Top view
 Boxhave
or sphere
They
110% line spacing, 2 points before & after
 Must overlap
Longer
bullets in the form of a paragraph are harder to
Gather
local
cubemaps
read if there
is insufficient
line spacing. This is the
 Based onrecommended
POI location
maximum
number of lines per slide
 Based on cubemap influence
(seven).
volume
Sub bullets
lookvolumes
like this
 Take
N nearest
Blending algorithm




Blending
weights
This subtitle
is 20rules
points
 100%are
influence
Bullets
blue at
boundary of inner range
They have 110% line spacing, 2 points before & after
 0% influence at boundary
Longer
bullets
of outer
range in the form of a paragraph are harder to
read
if there
is insufficient
line spacing. This is the
 Smaller
influence
more
maximum
importantrecommended number of lines per slide
(seven).
 No overlap of inner range
 Sub bullets look like this
Blending algorithm – Pseudo code
for (int i = 0; i < NumPrimitive; ++i) {
if (In inner range) EarlyOut;
if (In outer range)
 This subtitle is 20 points
 Bullets
are blue
SelectedPrimitive.Add(CurrentPrimitive.GetInfluenceWeights(LocationPOI));
}
 They have 110% line spacing, 2 points before & after
SelectedPrimitive.Sort();
for (int i = 0; i < NumSelectedPrimitive; ++i) {
SumIW +=
SelectedPrimitive[i];
 Longer
bullets
in the form of a paragraph are harder to
InvSumIW += (1.0f - SelectedPrimitive[i]);
}
for (int i = 0; i < NumSelectedPrimitive; ++i) {
BlendFactor[i] = (1.0f - (SelectedPrimitive[i] / SumIW)) /
(NumSelectedPrimitive - 1);
BlendFactor[i] *= ((1.0f - SelectedPrimitive[i]) / InvSumIW);
SumBlendFactor += BlendFactor[i];
}
// Normalize BlendFactor (...)
read if there is insufficient line spacing. This is the
maximum recommended number of lines per slide
(seven).
 Sub bullets look like this
Blending algorithm




This subtitle is 20 points
Bullets are blue
They have 110% line spacing, 2 points before & after
Longer bullets in the form of a paragraph are harder to
read if there is insufficient line spacing. This is the
maximum recommended number of lines per slide
(seven).
 Sub bullets look like this
Blending algorithm




 Video
This subtitle is 20 points
Bullets are blue
They have 110% line spacing, 2 points before & after
Longer bullets in the form of a paragraph are harder to
read if there is insufficient line spacing. This is the
maximum recommended number of lines per slide
(seven).
 Sub bullets look like this
Blending algorithm





Combined
onisGPU
This subtitle
20 points
Multiple
shaders
Bullets are
blue
float2 xy = VPosScaleBias.xy * ScreenPos.xy +
VPosScaleBias.zw;
half3 CubeDir = GetCubeDir(xy.x, xy.y);
half3 CubeColor;
 By face
They
have 110% line spacing,
2 points before & after
 By cubemap number
CubeColor = weight1 * texCUBElod(CubeTex1,
half4(CubeDir, MipmapIndex)).rgb;
Longer bullets in the form of a paragraph are harder to
Blend
mipmaps
CubeColor
+= weight2
* texCUBElod(CubeTex2,
read ifall
there
is insufficient line
spacing.
This
is the
half4(CubeDir, MipmapIndex)).rgb;
 For preconcolved
cubemap number of lines per slide
maximum
recommended
CubeColor += weight3 * texCUBElod(CubeTex3,
(seven).
half4(CubeDir, MipmapIndex)).rgb;
 Sub bullets look like this
CubeColor += weight2 * texCUBElod(CubeTex4,
half4(CubeDir, MipmapIndex)).rgb;
Blending algorithm
 Use
of points
Thisknowledge
subtitle is 20
 hardware
Bullets aretexture
blue layout
 On console only
 They
have 110% line spacing, 2 points before & after
PS3
 128^2
Longer bullets
inX360
the form 256^2
of a paragraph
are
PS3
X360harder to
DXT1
(ms)
(ms)
DXT1
(ms)
(ms)
read if there
is insufficient
line spacing.
This
is the
1
0.08
0.20
1
0.29
0.48
maximum recommended number of lines per slide
2
0.09
0.26
2
0.40
0.61
(seven).0.10
3
0.34
3
0.54
0.78
4
 Sub bullets
like this
0.11 look
0.41
4
0.68
0.99
Our Local IBL Approach




 No lighting seams anymore
This subtitle
is have
20 points
 But still
parallax issue
Andblue
introduce error with distant objects
Bullets are
They have 110% line spacing, 2 points before & after
Longer bullets in the form of a paragraph are harder to
read if there is insufficient line spacing. This is the
maximum recommended number of lines per slide
(seven).
 Sub bullets look like this




This subtitle is 20 points
Bullets are blue
They have 110% line spacing, 2 points before & after
Parallax-corrected Cubemap
Longer bullets in the form of a paragraph are harder to
read if there is insufficient line spacing. This is the
in Object’s shader
maximum recommended number of lines per slide
(seven).
 Sub bullets look like this
Parallax-corrected Cubemap




This subtitle is 20 points
Bullets are blue
They have 110% line spacing, 2 points before & after
Longer bullets in the form of a paragraph are harder to
read if there is insufficient line spacing. This is the
maximum recommended number of lines per slide
(seven).
 Sub bullets look like this
Parallax-corrected Cubemap





Simple
algorithm
minimize
This subtitle
is 20topoints
parallax
issue
on GPU
Bullets are
blue
Artists define box volume
They have 110% line spacing, 2 points before & after
Intersect a volume and correct
Longer bullets in the form of a paragraph are harder to
the reflection vector
read if there is insufficient line spacing. This is the
 We just reinvented the wheel!
maximum recommended number of lines per slide
 Kevin Bjorke, GPU Gems
(seven).
 Bartosz Czuba, Gamedev.net
 forums
Sub bullets look like this
Parallax-corrected cubemap




float3 DirectionWS = PositionWS - CameraWS;
float3 ReflDirectionWS = reflect(DirectionWS, NormalWS);
This subtitle is 20 points
// Find the ray intersection with box plane
float3 FirstPlaneIntersect = (BoxMax - PositionWS) / ReflDirectionWS;
float3 SecondPlaneIntersect = (BoxMin - PositionWS) / ReflDirectionWS;
// Get the furthest of these intersections along the ray (Ok because x/0
give +inf and -x/0 give –inf )
float3 FurthestPlane = max(FirstPlaneIntersect, SecondPlaneIntersect);
// Find the closest far intersection
float Distance = min(min(FurthestPlane.x, FurthestPlane.y),
FurthestPlane.z);
// Get the intersection position
float3 IntersectPositionWS = PositionWS + ReflDirectionWS * Distance;
// Get corrected reflection
ReflDirectionWS
IntersectPositionWS
- CubemapPositionWS;
Sub bullets= look
like this
Bullets are blue
They have 110% line spacing, 2 points before & after
Longer bullets in the form of a paragraph are harder to
read if there is insufficient line spacing. This is the
maximum recommended number of lines per slide
(seven).

return texCUBE(envMap, ReflDirectionWS);
Parallax-corrected Cubemap
 Works
This subtitle
well onisall
20kind
points
of surfaces but…costly
 OBB geometry
 Bullets
are blueproxy : ~21 instructions
 For one parallax-corrected cubemap
 They
have 110% line spacing, 2 points before & after
 Longerapproximation
bullets in the form of a paragraph are harder to
 Cheaper
exists
read if there is insufficient line spacing. This is the
 NVIDIA / ATI demo
maximum recommended number of lines per slide
 Pseudo code
(seven).
D = normalize(K
* (Pp - C) + R)
 Sub bullets look like this
Parallax-corrected Cubemap




This subtitle is 20 points
Bullets are blue
They have 110% line spacing, 2 points before & after
Longer bullets in the form of a paragraph are harder to
read if there is insufficient line spacing. This is the
maximum recommended number of lines per slide
(seven).
 Sub bullets look like this
Parallax-corrected Cubemap
 This subtitle is 20 points
Object’s Shader with
Object’shader

Bullets are blue
cubemaps parallax correction
 They have 110% line spacing, 2 points before & after
 Longer bullets in the form of a paragraph are harder to
read if there is insufficient line
spacing.
This is the
Mixing
step with
Scene
Scene
maximum recommended cubemaps
number ofparallax
lines per slide
rendering
rendering
correction
(seven).
 Sub bullets look like this




This subtitle is 20 points
Bullets are blue
They have 110% line spacing, 2 points before & after
Parallax-corrected Cubemap
Longer bullets in the form of a paragraph are harder to
read if there is insufficient line spacing. This is the
Mixing Step
maximum recommended number of lines per slide
(seven).
 Sub bullets look like this
Parallax-corrected Cubemap




No
positions
Thispixel
subtitle
is 20 points
Add
a reflection
Bullets
are blue plane
Parallax
correction
is spacing, 2 points before & after
They have
110% line
based
camera,
Longeron
bullets
in the form of a paragraph are harder to
geometry
proxy
and
read if there
is insufficient
line spacing. This is the
reflection
maximumplane
recommended number of lines per slide
 For current point of view
(seven).
 Sub bullets look like this
Parallax-corrected Cubemap




// Intersection with OBB convert to unit box space
float3 RayWS = normalize(GetCubeDir(...)); // Current direction
float3 RayLS = mul((float3x3)WorldToLocal, RayWS);
float3 ReflCameraLS = mul(WorldToLocal, ReflCameraWS); // Can be precalc
// Same code as before but for ReflCameraLS and with unit box
float3 Unitary = float3(1.0f, 1.0f, 1.0f);
float3 FirstPlaneIntersect
= (Unitary - ReflCameraLS) / RayLS;
float3 SecondPlaneIntersect = (-Unitary - ReflCameraLS) / RayLS;
float3 FurthestPlane = max(FirstPlaneIntersect, SecondPlaneIntersect);
float Distance = min(FurthestPlane.x, min(FurthestPlane.y,
FurthestPlane.z));
// Use Distance in WS directly to recover intersection
float3 IntersectPositionWS = ReflCameraWS + RayWS * Distance;
float3 ReflDirectionWS = IntersectPositionWS - CubemapPositionWS;
This subtitle is 20 points
Bullets are blue
They have 110% line spacing, 2 points before & after
Longer bullets in the form of a paragraph are harder to
read if there is insufficient line spacing. This is the
maximum recommended number of lines per slide
(seven).

Sub
bullets look like
this
return
texCUBE(envMap,
ReflDirectionWS);
Parallax-corrected cubemap




This subtitle is 20 points
Bullets are blue
Object-based
POI-based
Parallax-corrected
They have 110% line spacing, 2 points before & after
Longer bullets in the form of a paragraph are harder to
read if there is insufficient line spacing. This is the
maximum recommended number of lines per slide
(seven).
 Sub bullets look like this
Wrong Way!
Parallax-corrected Cubemap
 Top-Dow
viewisof
corridor with 3 local cubemaps
This subtitle
20a points
 Bullets are blue
 They have 110% line spacing, 2 points before & after
 Longer bullets in the form of a paragraph are harder to
read if there is insufficient line spacing. This is the
maximum recommended number of lines per slide
(seven).
 Sub bullets look like this
Parallax-corrected Cubemap




 Video
This subtitle is 20 points
Bullets are blue
They have 110% line spacing, 2 points before & after
Longer bullets in the form of a paragraph are harder to
read if there is insufficient line spacing. This is the
maximum recommended number of lines per slide
(seven).
 Sub bullets look like this
Parallax-corrected Cubemap




With
: Enlarge geometry proxy
This glossy
subtitlematerial
is 20 points
Bullets are blue
They have 110% line spacing, 2 points before & after
Longer bullets in the form of a paragraph are harder to
read if there is insufficient line spacing. This is the
maximum recommended number of lines per slide
(seven).
 Sub bullets look like this
Parallax-corrected Cubemap
 Distortion
with glossy
material
 This subtitle
is 20 points
 Bullets are blue
 They have 110% line spacing, 2 points before & after
 Longer bullets in the form of a paragraph are harder to
read if there is insufficient line spacing. This is the
maximum recommended number of lines per slide
(seven).
 Sub bullets look like this
Reference
Our approximation
Parallax-corrected cubemap
 Error
This subtitle
analysisis 20 points
 Parallax-corrected
 Bullets
are blue cubemap only works for one normal
 They have 110% line spacing, 2 points before & after
 Longer bullets in the form of a paragraph are harder to
read if there is insufficient line spacing. This is the
maximum recommended number of lines per slide
(seven).
 Sub bullets look like this
Parallax-corrected Cubemap




Improvement
This subtitle is 20 points
Rasterizing
parallax
Bullets are blue
corrected
They havecubemap
110% line spacing, 2 points before & after
 Draw the textured box volume
Longer
bullets in the form of a paragraph are harder to
from reflected camera position
read if there is insufficient line spacing. This is the
 No longer restricted to
maximum recommended number of lines per slide
box/sphere volume!
(seven).
 Tools for artists to define any
 convex
Sub bullets
look like this
volume
Parallax-corrected Cubemap




This subtitle is 20 points
Bullets are blue
They have 110% line spacing, 2 points before & after
Longer bullets in the form of a paragraph are harder to
read if there is insufficient line spacing. This is the
maximum recommended number of lines per slide
(seven).
 Sub bullets look like this
Parallax-corrected Cubemap




// C++
Matrix
Vector
Matrix
Matrix
Mirror = CreateMirrorMatrix(ReflectionPlaneWS);
This subtitle
is 20 points
ReflectedViewPositionWS = Mirror.TransformVector(ViewPositionWS);
View = CalcCubeFaceViewMatrix(FaceIndex, ReflectedViewPositionWS);
ViewProjection = View * Projection;
Bullets are blue
They
have 110% line spacing, 2 points before & after
// Shader
VertexMain() {
float4 PositionWS = mul(LocalToWorld, InPositionOS);
float4 PositionSS = mul(ViewProjectionMatrix, PositionWS);
OutPosition = PositionSS;
OutDirection = PositionWS.xyz - CubemapPositionWS.xyz; // Current direction
}
Longer bullets in the form of a paragraph are harder to
read if there is insufficient line spacing. This is the
maximum recommended number of lines per slide
(seven).
PixelMain() {
OutColor
texCUBE(CubeTexture,
Sub =bullets
look like this OutDirection);
}

Sum up : Parallax-corrected Cubemap





This subtitle
is 20 points
Planar
objects
only
Bullets
are blue
 Convex
volumes
Measures for 128x128x6 DXT1 cubemap
# Cube
PS3 (ms)
X360 (ms)
1
0.14
0.29
They
have 110%
spacing,
2 points
before
2
0.23 & after
0.41
 Scalable
with line
number
of
cubemap
3
0.31
0.52 to
Longer
bullets in the form of a paragraph
are harder
General
read if there is insufficient lineMeasures
spacing.
This
thecoverage
for 25%
/ 75%is
screen
maximum
linesPS3per
slideX360 (ms)
 Cheap recommended
approximationnumber of# Cube
(ms)
(seven).
1
0.24 / 0.75 0.19 / 0.45
 Per pixel correction
 Sub
bulletsvolume
look like(Box/Sphere)
this
 Simple
2
0.48 / 1.27
0.44 / 1.21
3
0.72/ 2.26
0.61 / 2.27




This subtitle is 20 points
Bullets are blue
They have 110% line spacing, 2 points before & after
Caveats
Longer bullets in the form of a paragraph are harder to
read if there is insufficient line spacing. This is the
maximum recommended number of lines per slide
(seven).
 Sub bullets look like this
Caveats - Distant lighting issues




This
subtitle
is 20 pointswith distance from POI
Accuracy
decreases
Bullets
blue solutions to artists
Provideare
different
They
110%lighting
line spacing,
2 points
before position
& after
 Usehave
ambient
information
at objects
Longer
bullets
in the form
of a
are harder to
 Mix
with cubemap
based
onparagraph
POI distance
read
if there
is insufficient
line spacing.
This is the
 Fade
cubemap
contribution
with distance
maximum
number
of lines per slide
 Helpsrecommended
with performance
too
(seven).
 Override cubemap by objects
 Sub bullets look like this




This subtitle is 20 points
Bullets are blue
They have 110% line spacing, 2 points before & after
Conclusion
Longer bullets in the form of a paragraph are harder to
read if there is insufficient line spacing. This is the
maximum recommended number of lines per slide
(seven).
 Sub bullets look like this
Takeaways




This
is 20approach
points
Newsubtitle
local IBL
Bullets
are blue
 Cheap
They
have 110%
spacing,
 Replace
costlyline
real-time
IBL2 points before & after
Longer
bullets
form
of a paragraph
are harder to
Several
toolsininthethe
hands
of the artists
read if there is insufficient line spacing. This is the
 To ease smooth lighting transition
maximum recommended number of lines per slide
 To get accurate lighting
(seven).
 Sub bullets look like this
Future
This subtitle
20 points
 These
toolsis are
not enough



Bullets
are blue others
 We developed
They have 110% line spacing, 2 points before & after
Longer bullets
the form of a paragraph are harder to
Described
ininupcoming
read if there is insufficient line spacing. This is the
GPU pro 4 book
maximum recommended number of lines per slide
to
be released at GDC 2013
(seven).
 Sub bullets look like this
Acknowledgments




Frédéric
This
subtitle
Crosis(Lighting
20 pointsartist) for his invaluable help on
testing,
using
and mastering our tools
Bullets are
blue
DONTNOD
team line spacing, 2 points before & after
They have 110%
Thanks
to all my
Longer bullets
in reviewers
the form of a paragraph are harder to
 Naty
Hoffman,
Gabriel Ware, line
Stephen
Hill, Laury
Michel,
read
if there
is insufficient
spacing.
This
is theSam
Hocevar, Jérôme Banal, Nicolas Serouart, Michel Koch, Brian
maximum
recommended number of lines per slide
Karis, Colin Barré-Brisebois
(seven).
 Sub bullets look like this




This subtitle is 20 points
Questions?
Bullets are blue
They have 110% line spacing, 2 points before & after
Longer bullets in the form of a paragraph are harder to
read if there is insufficient line spacing. This is the
maximum
recommended
number of lines per slide
Slides
available
at http://seblagarde.wordpress.com/
(seven).
Twitter: @SebLagarde
 Sub bullets look like this
Email: [email protected]
References
 Lagarde,
“Tips, ticks
guidelines for specular cubemaps”,
This subtitle
is 20and
points
http://seblagarde.wordpress.com/2011/12/03/tips-tricks-and-
 Bullets
are blue
guidelines-for-specular-cubemap/
 McTaggart,
They have“Half-Life
110% line
spacing,
2 points before & after
2 Valve
Source Shading”
 http://www2.ati.com/developer/gdc/D3DTutorial10_HalfLonger bullets in the form of a paragraph are harder to
Life2_Shading.pdf
read if there is insufficient line spacing. This is the
maximum
recommended number of lines per slide
http://http.developer.nvidia.com/GPUGems/gpugems_ch19.html
 (seven).
Behc, “Box projected cubemap environment mapping”
 Bjorke, “Image based lighting”,
http://www.gamedev.net/topic/568829-box-projected-cubemap Sub bullets look like this
environment-mapping/
References
 Mad
Mike demo,
Naked Truth Behind NVIDIA’s Demos”,
ThisMod
subtitle
is 20 “The
points
ftp.up.ac.za/mirrors/www.nvidia.com/developer/presentations/2005/SI
 Bullets
are blue
GGRAPH/Truth_About_NVIDIA_Demos.pdf
 Brennan,
They have
110%Environment
line spacing,
2 points
before
after
“Accurate
Mapped
Reflections
and&
Refractions
Adjusting
for Object
Distance”,
 by
Longer
bullets
in the
form of a paragraph are harder to
http://developer.amd.com/media/gpu_assets/ShaderX_CubeEnvironm
read
if there is insufficient line spacing. This is the
entMapCorrection.pdf
maximum recommended number of lines per slide
(seven).
 Sub bullets look like this
This slide has a 16:9 media window




This subtitle is 20 points
Bullets are blue
They have 110% line spacing, 2 points before & after
Longer bullets in the form of a paragraph are harder to
read if there is insufficient line spacing. This is the
maximum recommended number of lines per slide
(seven).
 Sub bullets look like this