This content details the advanced rendering and physics techniques used in the game Teardown, focusing on its proprietary voxel-based ray tracing and simulation methods. It explains how the game achieves realistic visuals and complex destruction through unique voxel data structures and algorithms.
Mind Map
Clicca per espandere
Clicca per esplorare la mappa mentale interattiva completa
all
live
say yes yes and it's working perfect so
welcome everyone to
this uh very much delayed uh Tech
session on
Twitch uh today we're going to talk a
lot about the technology and go pretty
deep into visualizing a little bit the
different uh debug modes we have to um
to get a better understanding on the
rendering I'm going to talk a little bit
about physics and then maybe if we have
time we can uh do a little uh on the
audio as well depending on what you want
to see so if you just uh if you have
comments Emil is in the chat to we'll
keep an I on the
chat and I'll I'll uh show a little bit
from the game at the same time all right
so let's start off with the
do
good so as you you know uh ton uses rate
tracing for rendering that is um it's a
lot of games doing that nowadays but
pterodon does not rely on RTX for that I
have my own uh software
implementation uh or software it does
run on the gpus I guess it's a hardware
implementation but
um it's implemented entirely in a
regular glsl
Shader and uh let's talk first a little
bit about the scene and and how it works
and we can get more into details
later so um I'm going to show you the
different render passes that that's done
and we'll start with
the depth
pass uh a lot of games do a depth pass
before rendering anything else because it's
it's
uh uh has a lot of advantages because
you can use that to C stuff later uh
terdon uses a g buffer approach so I
actually render depth and other things
such as ALB and normal at the same time
uh all objects are only drawn once in Te
down so I just draw all the object
objects once uh to a g buffer uh because
drawing the scene is actually very very
time consuming if we bring up the
profiler here and look at this view I'm
going to make it the actual rendering we
can see my timers here that the total
drawing time for this particular frame
is 14
milliseconds and of
which the G buffer is 5.23
5.23
something uh so it's uh more than a
third of the frame is just spent putting
all the objects in the G buffer with
absolutely no lighting no postprocessing
no uh nothing nothing else so the output
from that g-buffer pass is the depth
color and normal and um and we really
just want to withdraw that once because
we had to do it all one more time that
that would be another 5 milliseconds
um so there was a depth and then another
component of the G buffer which is drawn
at the same time but the result goes
into um a separate buffer is the color
buffer or the ALB buffer so this is what
the pure colors of the scene look like
with no lighting it's just um and and as
you can see it's rendered with no
textures or anything
uh the individual voxal in tear down
are uh always single
colored uh if you look at the ground
here you can see that it's uh it looks
textured especially from a distance and
it is it is actually a texture but it Maps
Maps
one pixel in that texture uh Maps a one
to one with the voxels so a voxel always
has just one color
but it could actually technically have
slightly different colors on each side
because of this uh projection of the
texturing so anyway uh that was the
color and then we have the normal as the
last component of the G buffer there's
actually one more component of the G
buffer we can talk about
later um normals are drawn because they
are needed for
lighting and it's also pretty standard
so everything in green here is pointing
upwards everything in blue is pointing
that way uh and red is pointing this way
um and because objects can have
different uh rotations you can also see
it's it's not uh we still need full
normals because these are in World space
so uh we need to have a full normal
backing point in any
direction even though the voxes only
have six directions
uh and then I do when the debuffer is in
place actually let's talk about the last
thing in the g-buffer which is also
which is a velocity buffer which
basically records the motion of each
pixel on the
screen uh and that motion is very
important not just for motion blur which
is the uh maybe most obvious usage for
that uh but even more importantly uh
it's used for the temporal
anti-aliasing which someone wrote in the
chat right now that's nice uh so yes um
turnon uses temporal antialising as you
can see that's why the screen is
flickering because temporal anti- Laing
if you don't know what it is is a way to
do anti- Laing by accumulating frames
over time and it's uh pretty standard
nowadays I think in most engines it's
uh way cheaper than the
previous uh anti-al lasing techniques
that were use used and in many cases I
would say the result is actually also
better but it can be it can result in
flickering in sometimes and I'm doing a
couple of things in the engine to avoid
flickering but I don't think we should
go into those uh tiny details here maybe
I'll write that on the on the blog
later um
so there's also a separate buffer I do a
pass on the normals before lighting
which is smoothing them out a little bit
it's probably hard to see in this view
but if we take a look in
u the actual rendering see if we find an
angle here maybe when you played the
game you also seen it
here I think we can see it uh since the
normals in the game are very very sharp
edges I do a pass just a post-processing
pass on the normal buffer where I smooth
out the normals a little bit based on a
heuristic to get this you can see there
is a brighter line here at the edge
which wouldn't be there other otherwise
that's because I kind of take the um a
sharpness off the edge a little bit and
smooth out a couple of
pixels and that makes quite a big
difference for how the the voxal are
perceived like here you can see very
clearly that there is this very subtle
brightness on the on the edges in some
cases that makes them look a little
rounder and that's just uh this
processing of the normal buffer that
that does that so there's no geometry
and I think maybe be before we move on
to the lighting or or do we have
something from the chat maybe we should
stop here and and take questions there a
million questions
already let's see if I can find some
that are related to the tech uh could we
have weight based objects for example
stone is heavy so higher impact damage
on Landing would this be
possible let let's stick to questions
about what I talked about okay there any
any questions on on does it use sparse
voxel o tree rate tracing or does it use
plain BBH rate tracing
uh it's not it is an OCT tree so I I
guess yes a little bit but but let's
move on I I think that will be answered
in in what I would was talking about
next so
let's show some debug rendering
here so this is what the objects look
like that are drawn to the
screen uh each yellow box here is a voxal
voxal
shape and it's oriented exactly the way
it appears on the screen here so it's
it's aligned with the Box hols
themselves and as you can
see they
are when modeling something for this
game we try to make maybe it's a little
hard to see here with all the lines but
let's take this tree here for instance
it has
one uh object for the leaves up here and
there is one object for the trunk
and that is because we don't we don't want
want
more uh volume than what absolutely
necessary to enclose the object it does
have to be a box just because that's I
use 3D textures to store this um so in
many cases we have to split up objects
in multiple shapes uh to not waste too
much memory but it's not only memory
because I I will I will show you soon
how this is traced out during the G
buffer pass how we get the pixels on the
screen because there are no triangles in
this game everything is is rendered
directly from volume
data so if we switch over to let's see
um here where I can sketch a little bit
so assume we have the I
here uh and we have our
scene with different shapes I'm going to
do this in 2D but you can extrapolate
disappointment H wait for next
Generation mobile devices here for the 3D
3D
version so um this is our frrom
frrom
here so obviously the first thing that
happens if if an object is totally
outside the frrom it gets discarded
immediately and not drawn at all and
then for the rest of the objects these
objects all these are the yellow boxes I
just showed you they're all their own uh
voxal volumes consisting
of from I don't know what would be a
typical size
maybe 50 by 5050 by 5050 up
to 100 it could be anything up to a
million or two three million voxel maybe
in in the biggest ones
ones
um and the way they're rendered they are rendered
rendered
with uh the bounding box these Yellow
Boxes you saw that's what's actually get
drawn or fed to the Riser during the
debuffer pass so translating
this to 2D we would draw this box here
let's make it
another color so we can see it so this
is what gets drawn I actually draw the
back face of each box so in this case we
would draw these
two and as that gets rized to the
screen uh when drawing say this line
here um we can trace out
out
show um let's follow this Ray here
it's going out from the eye if we're
restoring rest resizing the pixel that's
ending up here on the ne
plane um and we have an object that
here
okay and the first thing we we find out
is the intersection point of this Ray
and the bounding box
itself and that point we can just
compute mathematically to be say it's
here uh so that's where we start the
trace or the ray marching through the
voxal volume so we start with this voxal
here and see that it is empty and that
means we're going to have to keep
going uh and the way we keep going is we
use a boxal marching algorithm called am
mantides and wo it's a paper by a mantiz
r uh maybe recognize the names
names
um and that works so you follow the the
edges of the voxal so in this case if we
zoom in a little bit more this was the
first one keep going in that direction
uh over
here and after hitting that edge we know
that we also going to have to check the
neighboring boxel on the to the right
here uh and since that's also empty we
keep going stepping through and then we
know the next intersection point is on
this edge here uh and then we we keep
going like this you can't just step
equally sized steps like this because
then you're going to end up missing
stuff uh so you're actually going to do
this amyes of wo it's also called super
cover algorithm for traversing
boxel um and we keep doing that until we
hit something and in this case that
means we're going to have to check this
Edge and look in this one there wasn't
anything there keep going until we cross
this Edge and then we switch over to
this one box in here we actually found
something and what we found the first
voxel we enter where there is data is
going to determine the pixel color for
uh for this thing here so this going to
be a green pixel in that case and what's
actually stored in in each voxal cell is
just one BTE of data so this might be an
eight this might be 100 10
10
um and uh and so on so there were no RGB
values there are no like reflectivity
and stuff like that all these are just uh
uh
index lookups into a
plette that stores uh up to
materials uh and since we have multiple
of these
volumes uh each one of those can have
their own pallette so that's why you see
more than 255 colors in the game because
every object can have 255 unique colors and
and
materials so back to the question on the
oct tree this is a very
simplified uh explanation on how it
works in reality I also do this
hierarchically you can see this as a 3D
texture each of these boxes uh and I
just using the standard myth mapping
feature of texture mapping to walk up
and down that like it it's it's
basically an OCT Tre uh but I only use
the two First Mid levels so I start
doing this traversal in the in the
second MIP and then if I find a hit I
switch over to the
the uh the first one and then if I find
something there I I finally go to the
base level and and check there and then
there is a pretty complex algorithm to
for knowing when to switch to a
particular myip level because it's not
always the most obvious one have to
profile which is which is the fastest to
avoid recomputing a lot of these
traversal constants and keeping the
memory small to fit the caches in the
um was that very clear
clear
extremely good uh are there any
questions on this part or actually I ask
no no not
anything particular I asked people to
hold on to the question M for um for
like assigned question time because it's
just streaming by
right so uh just to if someone missed
the context of this this is just for
getting uh the G buffer on the screen
the color of the objects uh the normals
and the depth so this is not uh exactly
what what's happening for for lighting
later uh how do you transform the ray
into the voxal space of an object that's
just a matrix multiplication so it's um
I mean you know the the
transform of each of these and you know
the transform of the cameras you just
conversion how do you handle
intersecting objects and the resulting
depth ordering problems that's actually
a really good
question uh that I spent a lot of time
on because since as I said before I'm only
only
rendering the back phase
here technically in the Shader I know
be it's it's it's going to be somewhere
in this box but there's no way to
express in the Shader uh two bounds in
between a depth value can be and that
can confuse
the uh the hardware the SE buffering
Hardware a little bit um so I I had have
to do certain very specific techniques
to draw them in multiple passes and uh
record uh like an offline depth buffer
that I can compare against um in
multiple passes for all this to work I
don't I don't know if that was the
answer to the question but it it gets
pretty complicated uh I know the depth
once I've done the trace the problem is
that I don't know say I draw this object
here first and another part of the GPU
because all all of these are kind of
drawn in parallel because the GPU it's
just doing a lot of parallel stuff so
this object right here can actually be
drawn uh
simultaneously as this object
uh and we don't know if parts of this
object is going to be visible until we've
we've
rized this one traditionally in in seab
buffer techniques the uh the rest races
can figure that out because it knows uh
what parts will be covered and not
unless you discard the pixels in the
Shader but in this case we don't know
that because not until we traversed the
whole box of volume we know if if there
going to be a hole where you can see all
the way through this object and actually
see something that is behind
here so depth is uh tricky to get right
and that is from a performance perspective
only I think we should move on to
lighting um or is did you see some other
away I think we can continue
and so now we have the one question that
pops up do you store each object in a
separate 3 texture or are they all
packed in a single Atlas they're all in
their own 3D texture so there are I
don't know how many shapes are there in
this level it's
2091 so there are more than 2,000 3D
Textures in this
scene uh but it works surprisingly well
I would say I didn't expect that to work
when we started but um there doesn't
it
um so now that we have the G buffer
lighting this is the raw outputs of the
first of the diffuse part of the
lighting and it includes both the
lighting from the sky doome and the light
light
sources uh I wish I had a way to
separate them here but I don't actually
have that in this buug
VI but if we go over here where there
aren't any light sources
this uh so here you can see more just
lighting
um and I think this is probably the
key to
why lighting looks pretty realistic in
tear down um
because I use this Skydome lighting for
it's also called am it's it's like a mix
between ambient
occlusion and Skydome
lighting uh what it does is to send a
Rays for every pixel for this pixel
right here it's going to send a number
of random Rays out in in in different
directions and see if they hit uh the sky
sky
basically uh that's so it is what we
call real ambient occlusion and not the
fake screen space ambient occlusion that
you can see in a lot of games which
doesn't look very good uh the Rays I use
for am ambut oclusion and this lighting pass
pass [Music]
[Music]
are let's see if I remember I think I
think there's 32 m so they're actually pretty
pretty
long so that's also why you see it gets
much darker under the trees here and
also indoors that relies entirely now we actually
actually
let's fix the lights here it actually
gets pretty dark
dark
magic yeah I don't know uh even in
pretty large rooms it gets pretty dark
when you get inside like this which is a
good sign because if the if these
amplitud cusion rates were only like a
couple of meters this would be full
daylight in here and you can see that in
a couple of places in the game if we go
to this L that's a bit larger maybe
we're going to start seeing some effects
hard to say but I think the most
noticeable place in the game is this very
very
large excuse me Warehouse on the hollow
Rock Island map there we can definitely
see some some that it's much brighter
than it actually should be in there
because the room is just bigger than the
maximum distance of these light rays
that I use for
checking one question how many rays do
you send out per per
pixel I think it's
lot I think let's see if I turn down if
I remember correctly L this might be
wrong but I
think if I set the render scale no sorry
not the render scale um the render
one and and you would see that by
looking for more noise the more race you
do per pixel the less noise and I think
it does look a little more noisy now
right it's probably hard to see on the stream
stream but
um so the way we send out these
Rays I mean
the the technique is super simple for
getting lighting that looks like this
that is super smooth
and uh and and generally looks pretty
good just setting out two rays in random
directions and record
uh add some light if you if you hit the
sky is um it's actually a really simple
way of of doing it but it it matters a
lot how you send out those Rays
especially if you only send out a very
small number of rays and the way I do
that is using blue
noise uh which you may see if you look
at the characteristics of the noise I
don't know if this comes through in the
Stream at
all uh but the noise has this very high
frequence look it doesn't really look
typical uh random noise it is random but
it's random in a very specific way where
it's it's only the high frequencies that comes
comes
through uh and that means it's going to
be much easier for us to smear out this
noisy image into
something um that blends better together
so that that's a really really important
part of this is to use the right kind of
noise and use it in the right way
because not only these two rays we send
out per pixel we don't want to send one
Ray this way and have the other way go
like almost the same way because that
would be huge way we want them to be
very uh separate but we don't want to sample
sample
the same direction every frame because
we want to cover the [Music]
[Music]
whole hemisphere for for that pixel so
we have to make
sure uh to cast them as far away from
the previous Rays as possible and and
cover and still cover the whole dome
which is super super complicated if you
do this uh in 3D and
consider all three dimensions and also
uh time in that because we don't want to be
be
for every frame they also have to be pretty
pretty different
different
um so that's the most important life
pass and when that is done and I'm I'm
going to talk a little bit later on how
that's done uh more specifically how how
this rate tracing is done uh on the
GPU uh
I do a little bit of Den noising on
that um it it looks looks very flickery
here but that's actually not just the
noise itself it's also because of this
temporal antialising
since since the geometry here is so
detailed uh it's also quite annoying
that you get so much noise from just the
temporal antialising
Jitter H but I have some techniques in
to uh fix that up later in the pipeline
but since this is a raw image from the
lighting itself uh it comes through uh
very visibly here but if we look at the
noise here you can see see it's
still it's
still very visibly
noisy even though it is uh been going
through a path of
denoising uh and the reason it looks
better in the final
game is because of the the temporal
antialising which tends to eat up a lot
of noise when you uh smooth this out over
time so when we have
that um we add the colors back in that
we have in the debuffer already I don't
know why why it's so dark I must have
um there must be a problem with the
scaling here because it shouldn't be this
dark um but that's pretty much it for
the excuse me for for the diffus
lighting um all the magic happens in
this pass and then there is some
denoising and just mixing it with the
diffuse colors and then the second part
important part of the lighting is the
reflections which is done very much the
same way just casting rays
Dennis I'll sneak in a couple of
questions uh which I think is relevant
to the r rate racing did you consider
updating the depth buffer from the
Shader to resolve occlusion using Shader
depth output it does prevent early set
time I'll send it to you in the disc so
you can and consider it um I can manage
there you
go does sound
interesting see did you consider
updating the dep Bu from the Shader to
resolve occlusion Shader depth outut
uh that is not possible that's what I
want to do but at least in open GL I
didn't find a way to do that I I think
um I actually had contact with someone
at Nvidia about this and they suggested a
a
method um that I haven't tried yet so
there might be it it's technically a
very good idea I just didn't find a way
to implement that yet but uh send me a
message on Twitter if you know exactly
how to do this and I would be very
in yeah I sent it to you in text all
right and just as a follow up on the
previous one the reason it's not so easy
as it sounds is because as I said before
a lot of these objects and draw calls
are going to happen simultaneously on the
the
GPU uh so so you can't really write to
the depth buffer while all the others
are reading from it because that would
cause but but maybe it can be updated in
a certain way to still make it possible
I'm not sure if using atomics or or
something like
that uh yes was let's see what was the other
other
one I can read it for you if you like to
what about doing direct rate tracing
like you currently do in voxo space and
indirect Lighting in screen space like
you used to
um yeah I the screen twen space lighting
I was experimenting with early uh
I don't think it's a good idea to use
that when when I have the option to do
it in voxal space because there's they
just advantages with the voxal space is
so much faster and the results are so much
much
better uh the screen space rate tracing
had a lot of
problems and it also required the scene
to be rendered multiple times and uh
work so was there anything else before
we move on no you're free to proceed all
right so
Reflections now since we have a method
to just throw shoot Rays that's what
we're also using for
Reflections um and this is just showing
the pure Reflections the reason it's
black here at the bottom is that I don't
render Reflections if if there is
no uh if they're not going to contribute
to the pixel value at all I don't draw
them so that's why they appear
black to save some
time and um the the Rays here are also
in in boxal
color are fetched from screen space so
let's see if we can find an example of where
can and it's actually a good demonstration
demonstration
on on how unimportant
the color of the reflection
is uh since I don't have access to the color
color information
information
um most of the reflections are just
going to be
black which is then not really
Reflections technically it's more like
an a specular
occlusion but when you um in this case
you would see the truck actually here
because it is visible in screen space
but it's still like
very the color contribution
compared to the reflection of the sky
which is not visible here but it it is
visible in the reflection is very very
small so no matter what the color of the
reflection is it's still just going to
look almost almost black in most cases
unless it's something like an emissive uh
uh
um material or a light
source so if we show the final image
here you're going to see that the the
contribution here is very very small but
I think it's also very important
important
like you can see here the dark areas
around uh the UND side of the truck here
they're not really a
shadow especially not this part here
they are um the effect of specular
occlusion so I think specular occlusion
is very very important for a realistic
um look of the image and it's also one of
of
the the things
I I miss in in a lot of renderers like
people don't considering uh as important
as say direct Shadows from light source
es or other types of of Shadows but I I
think specular occlusion is is is very
very important for to get these contact
UM darkening it's not it is not
technically or maybe it is technically a
shadow but it's it's it's more related
to the reflections than uh the light
coming from specific light
sources um and you can see another
example here and since we we use this do
this with r
tracing uh we also do this uh with
respect to the roughness of the material
so a lot of the reflections you're going
to see in the game
game
are uh fuzzy so the further you you you
go from
the the object the more fuzzy it's going
this um so that was the reflections
maybe we should pause here and show how
done uh if or did we have any questions on
questions did you do any experiments
with voxel cone tracing uh no I did
not um I don't think it's uh um maybe it
would work it probably would but I I
just don't see that I'm personally much
more interested in rate tracing and uh
using stochastic methods uh to do this
the soft Shadow thing instead of doing
tracing uh so let's see let switch over
and so for the lighting
let's redraw what we had before we
here um we had a couple of objects make
so here's our scene and just for the
sake of Simplicity say we have two
objects in
okay
yeah um okay so this is what the object
looks like we have some kind of bounding
box here this with yellow boxes you saw
in the scene
scene
and then we have the reason I I was
that
in Te down the whole scene also is a 3D
texture which is is really big I think
it's close to 2,000 by 2,000 on the largest
largest
levels uh by maybe 500 in height so it's
it can be up to almost a gigabyte in in size
uh because it's only one
bit per voxel so I can actually fit
eight voxal in a single bite because I
don't store anything in there I just
want to know is there something here
blocking light or not so I can do that
with a single
bit uh to save a lot of memory um so
this is also a voxal volume it has the same
same
resolution as the objects but it's not
necessarily oriented the same way
so this one is always oriented in World
space because it's only one and then we
have a lot of rotated objects uh in that
space but they have their own individual
rotations so what we have to do is to
translate this rotation
into this
one and the way that works is actually
done on the CPU it's a multi-threaded
very optimized um piece of code that
does that every frame it analyzes what
have changed in the scene uh and then I
just go and and splat all the voxal from
the individual objects into the world
space voxal
grid so this object would be splattered
into something like
like
this because it has to be aligned with
um so see if we can show that so we have
two versions of it one uh one is the the
object which is drawn to the G buffer
and then we have the what I call the
shadow volume representation which is a realigned
realigned
and uh converted version of that that is
always axis aligned uh and that is
what's used uh so all the lighting is
happening in this
space and not this one so once the G
buffer is drawn uh this representation
is never used everything else is done on
this um axis align representation
uh other than that it's it's pretty much
the exact same method as I'm using to
draw the G buffer so starting array here say
um uh I
just keep going through the voxal
grid I haven't drawn out all the grid
cells but they're here they're aligned
with the same here uh just keep doing
doing exactly
the the same thing uh checking for Edge
intersections and
moving this one that one this one and
that one and then we found a hit and
then we know this way actually hit
what's what's nice with that is that we
can also do this uh since it's a 3D
texture we can just draw these uh store
these myth Maps so we have a two levels
of M Maps uh as an OCT tree also for the
Shadows which is used a lot as I talked
about before these 32 M uh Rays for uh
the ambient occlusion that's quite a lot
of voxal steps uh stepping through 32 M
that would be something like 3 400 steps
probably but since it's done on these
MIP levels and a lot of it is just going
to going to be stepping through large um
amounts of
air um that's uh actually
relatively fast
still uh but I think this is this is
probably the most important part in tear
down rate tracing that this rate tracing
happens on this representation and not
on that one all the
RTX uh so what RTX is trying to do
except it's not for
voxal it
oops so a lot of triangles like
this and then all the the different
objects uh also get a bounding box these
bounding boxes are stored in a bounding
volume hierarchy and for each Ray you
first Traverse uh the hierarchy and then
the individual triangles to find a hit
which uh obviously for doing that for
millions and millions and Milli millions
of rays every frame is very very time
consuming whereas in teardown when you
have this big axis aligned foxel
foxel structure
structure
uh it it's or comparatively cheap to
step through this data in instead of
doing all that other stuff and another
really good thing with this way of doing
it is that for some rays
um the accuracy of the rate tracing is
not as
important so in many
cases um the amute occlusion is actually
a good example where I can cheat a
little bit in the rate racing so instead
of doing this
more time consuming uh am manati and woo
uh super cover algorithm to not have any
light leak through stuff
it's usually okay to just step a fixed
size through the voxel grid so instead
um I
can this was the R I
can just step like
this the fixed
steps so maybe instead of checking
20 different voxel because if I if I
do the superar
check maybe all
all these
these
boxal to make sure not to miss something
whereas uh doing it more sparsely I
could technically miss something if
there was something here I would miss it
but since it's just an ambient occlusion
Ray and there's lots of rays and they
randomized so if you if you run into a
small problem like that it's not going
to be too visible and ruin the
image uh but for the G buffer that
wouldn't be an option because you don't
objects uh so that's how the rate Trace
Works any
questions it's I think it's all obvious
yeah good I'm super clear please if you
ahead wouldn't you be able to keep a
smaller World texture centered around
the player It's actually an interesting idea
idea
but you any any pixel you see on the
screen needs to have this because if you
just remove Shadows it's going to be
very visible because it's going to
receive direct sunlight and stuff like
that even though it's hidden in a crease
somewhere so it it looks really really
bad when you don't have this
covered uh and maybe I didn't maybe I
didn't mention it and maybe it was
obvious but this
large texture is of course the reason uh
levels are relatively small and we have
a a size limitation on the levels if it
weren't for this uh levels could be much
much larger in t down this is where all the
the
do you always end up at Mid zero even
occlusion where the cone is
wider it's a good question actually I it
depends on which pass for ambut
occlusion I think that is the case but I
would need to check but
for for
Reflections I definitely do that
reflection race typically deviates a lot
if you have rough materials so if you have
have
um if you have a reflection like this
incoming light here and then it out goes
an array like that uh for rough material
it's typically you you throw random Rays
around the perfect reflection and the
further you go
um what I think uh you meant in the
comment in the chat here was to maybe
you shouldn't check uh the fine detail
in the voxel uh texture at all maybe you
should just stop at Mid level one or two
and that's exactly what I'm doing for
Reflections when when they travel a
certain distance so I
start at a fine detail
voxal grid like that and then when I've
been traversing this for
maybe 10 boxel or something like that I
go over to the first mid level and continue
continue
there uh and then when it's been doing
some of that I switch over to the even bigger
bigger
ones and then if I if I find something something
something
here if this was a
hit uh in some cases I just returned
like this probably hit something even
though I I should I should technically
go down the mid chain and check if it
was actually a hit or if it was
something else but for for these very
rough Reflections uh it typically
doesn't matter very much and I can show
that in the game actually because that's
a difference between low and high
settings uh which is fairly visible
let's see if we
can find a good spot I think this should
be a good spot for it
um maybe
not um let's
yeah on water you can since water don't
have very rough Reflections it gets much more
visible when when you're near water so
here we
do if you look at this
here and we switch back to high you can
see it gets much
thicker when we go to
low and that's because we're just
looking at the the first level of the
um uh of the M map and if I move back
even further now it's a little hard to
see because the surface is moving but
but
um but as I move even further away it's
uh going to be even bigger like now you
can see the reflection of the truck is
actually much bigger than the truck
itself but when I move closer it
smaller so let's see did we have any
other questions did you no I think
so what should we move on to now should
we talk about physics or do you want more
rendering first one to
to to say yeah rendering rer one vat
physics physics physics physics rendering
rendering
okay um math I think physics is yeah
let's let it's winning out
see I don't know physics is a little
harder to talk about because it's not so
visible and I don't have the same amount of
of
visualization for the
actually have a contact point
visibilization but I don't think it's
compiled in right maybe I even removed it
it
um so I do have one visualization for
the physics which is the bodies so this
is the rigid bodies of the
scene anything that is a yellow box now
is a a dynamic body that you can move
around and you can see when I break
something uh the
orientation of this box uh it's related
to the inertia tensor the inertia tensor is
is
how resistant the uh object is to rotate
in certain
directions um and I visualize that with
this box and that is of course
recomputed every time you um smash
something and just in general I think
physics has been much easier with voxal
than with polygons because physics
really can take advantage of things being
being
volumetric uh in a way that's that's
pretty hard with uh with polygons when
it comes to that so taking this as an
example when destroying something there
is always material on the inside and the
the algorithm for
computing the inertia tensor for a voxal
object is is almost trivial you just sum
up all the voxal and you know if the mo
boxels have different
materials all that gets summed in in the same Loop and and you get a very
same Loop and and you get a very accurate uh behavior of and center of
accurate uh behavior of and center of mass and all that is just recomputed
mass and all that is just recomputed from the boxal and their
from the boxal and their materials uh so all all of that it there
materials uh so all all of that it there is no hand tweaking so to speak for for
is no hand tweaking so to speak for for any of those things which is what you
any of those things which is what you typically have a lot of in when you make
typically have a lot of in when you make polygon based physics uh because since
polygon based physics uh because since you only have the the surface
you only have the the surface representation you don't know uh how how
representation you don't know uh how how it behaves if it's Hollow or if it's
it behaves if it's Hollow or if it's solid and stuff like that whereas in
solid and stuff like that whereas in boxal that just
boxal that just works uh physics in tear down is a
works uh physics in tear down is a fairly regular rigid body simulation
fairly regular rigid body simulation there is really not that much to say
there is really not that much to say about the solver it does have a
about the solver it does have a few things that it does very differently
few things that it does very differently from from other stuff and one I'm not
from from other stuff and one I'm not sure how technical I should get here if
sure how technical I should get here if we have any physics coders watching but
we have any physics coders watching but one uh very common performance
one uh very common performance bottleneck in physics is when you have
bottleneck in physics is when you have all these contact points this as what
all these contact points this as what when you do Collision detection detect
when you do Collision detection detect something is close enough to generate a
something is close enough to generate a contact Point all all those contact
contact Point all all those contact points get sent to solver that make sure
points get sent to solver that make sure they just don't uh to stop the motion so
they just don't uh to stop the motion so they can't move towards each other and
they can't move towards each other and if they already started moving inside
if they already started moving inside each other you push them out and stuff
each other you push them out and stuff like that so one common thing H that's
like that so one common thing H that's takes a lot of uh uh it put a lot of
takes a lot of uh uh it put a lot of effort in that in physics engine is to
effort in that in physics engine is to manage these contact points and pairs
manage these contact points and pairs because you you typically need to track
because you you typically need to track these contact points
these contact points over
over time to make the simulation stable uh
time to make the simulation stable uh and that has to do with something called
and that has to do with something called warm starting or friction
warm starting or friction correlation uh and if you haven't done
correlation uh and if you haven't done your own physics and you probably
your own physics and you probably wouldn't know what that is or why it's
wouldn't know what that is or why it's important but in order to make something
important but in order to make something actually not
actually not uh if you have a pile of rubble and you
uh if you have a pile of rubble and you want that to actually fall asleep uh and
want that to actually fall asleep uh and not just lay on the ground jittering
not just lay on the ground jittering forever uh that's actually quite
forever uh that's actually quite important and for Te down and for the
important and for Te down and for the solver I'm using here uh I actually
solver I'm using here uh I actually don't have any uh such uh pair
don't have any uh such uh pair management there's no uh
management there's no uh State
State um
um in collisions for what's between two
in collisions for what's between two objects the only state
objects the only state that carries over to the next frame is
that carries over to the next frame is in the bodies themselves which I think
in the bodies themselves which I think is a novel way to do a physics solver
is a novel way to do a physics solver but I'm not sure that maybe someone did
but I'm not sure that maybe someone did that before and that has
that before and that has some uh consequences that you can see in
some uh consequences that you can see in the
the game typically things are really stable
game typically things are really stable if you stack them like this it can
if you stack them like this it can handle huge
handle huge uh uh number of objects because you
uh uh number of objects because you don't have to do this correlation it
don't have to do this correlation it gets really fast and also the voxal
gets really fast and also the voxal Collision detection generates an absurd
Collision detection generates an absurd number of contact points so uh it it
number of contact points so uh it it would be very very tricky to track all
would be very very tricky to track all those and since everything supports full
those and since everything supports full concave Collision detection typically
concave Collision detection typically Collision detection only works for
Collision detection only works for convex objects whereas when you do it
convex objects whereas when you do it like this with u foxal Collision
like this with u foxal Collision detection
detection they can have absolutely any shape they
they can have absolutely any shape they want that also has would have
want that also has would have consequences if I were to do traditional
consequences if I were to do traditional pair management because that
pair management because that usually uh relies on uh a
usually uh relies on uh a convex intersection area between the
convex intersection area between the objects so anyway uh the where this goes
objects so anyway uh the where this goes wrong in the game I'm going to see if if
wrong in the game I'm going to see if if I
I can visualize that some of you might
can visualize that some of you might already have seen that uh if I
can um see if I can do
um see if I can do this um
this um when objects typically have pretty a
when objects typically have pretty a hard time coming to rest
hard time coming to rest when they are moving slowly or when they
when they are moving slowly or when they are on
are on another uh larger rigid body that is not
another uh larger rigid body that is not completely
completely still that was probably something else
uh maybe if I'm standing here yeah you can see it kind of crawls
here yeah you can see it kind of crawls a little bit and that is an effect from
a little bit and that is an effect from this la of pair management it's usually
this la of pair management it's usually fine for stacking things on something
fine for stacking things on something that doesn't move but that can be a
that doesn't move but that can be a problem on ships for instance you can
problem on ships for instance you can see it it's also a problem on on these
see it it's also a problem on on these little beach Huts or these time share
little beach Huts or these time share cabins let's switch
cabins let's switch the I think the sandbox version still
the I think the sandbox version still has the outermost cabin
has the outermost cabin intact some someone destroyed it someone
intact some someone destroyed it someone destroyed it I wonder who that was I
destroyed it I wonder who that was I criminals for that destruction to work
criminals for that destruction to work the way we wanted we actually made the
the way we wanted we actually made the entire outermost cabin a dynamic rigid
entire outermost cabin a dynamic rigid body so if I
body so if I uh enable the bounce and hit this
or or maybe I'm not remembering that correctly
yes it is so if I hit it you're going to see it turns green and then it falls
see it turns green and then it falls asleep again and goes to Blue so now if
asleep again and goes to Blue so now if I go
I go inside and just stand here standing on
inside and just stand here standing on something means that you wake up the
something means that you wake up the body and try to stack things in this
body and try to stack things in this particular
particular building it's not going to be as stable
building it's not going to be as stable as it typically is when stacking
as it typically is when stacking it on static ground and now it seems to
it on static ground and now it seems to work for some reason you can you can see
work for some reason you can you can see a lot of artifacts in this cabin for
a lot of artifacts in this cabin for that
that reason but I can't really trigger it
reason but I can't really trigger it now for some reason
anyway I think the most unique as as I said the there's not not so many things
said the there's not not so many things that are special about the physics other
that are special about the physics other than that there is a lot of it and you
than that there is a lot of it and you can actually destroy stuff but the only
can actually destroy stuff but the only part of the the physics
part of the the physics pipeline that is special is the
pipeline that is special is the Collision
Collision detection and we can
detection and we can maybe do a similar thing where I try to
maybe do a similar thing where I try to explain it
explain it by drawing it
okay yeah it's not only doing the rendering and physic engine he is also
rendering and physic engine he is also our concept
our concept [Laughter]
[Laughter] autist connectivity
autist connectivity calculation looks like a flood fi type
calculation looks like a flood fi type approach that is entirely correct it's
approach that is entirely correct it's just a
just a flood okay so for Collision
flood okay so for Collision detection
detection um we have
um we have foxs like
here I'm going to try and make them approximately the same size
but that didn't really maybe I can rescale it a little
really maybe I can rescale it a little bit yeah okay so we have two
why didn't that work technology
yeah no
why you have to draw it I have to draw it ah so rotation
it I have to draw it ah so rotation doesn't work when it's scaled could that
doesn't work when it's scaled could that be the case
then I don't know okay so let's uh I wanted to show
know okay so let's uh I wanted to show the rotation here
the rotation here but oh it's the other
but oh it's the other handle got
handle got it of
let's fill this in with something so make and the voxal here
something so make and the voxal here even though they visualized
even though they visualized as
as cubes in physics everything is spheres I
cubes in physics everything is spheres I don't know if you noticed how many
don't know if you noticed how many noticed that physics that voxos are just
noticed that physics that voxos are just spheres in the
physics I I did you the easiest way to see that is for very small objects they
see that is for very small objects they tend to
tend to roll the way they they shouldn't not
roll the way they they shouldn't not even after 20 hours that's that's that's
even after 20 hours that's that's that's good okay so in the physics
good okay so in the physics the
the um the voxal objects looks like this so
um the voxal objects looks like this so let's make a voxal object here
and as you might understand the real problem with having spheres if when an
problem with having spheres if when an object looks like this and ends up on on
object looks like this and ends up on on the
the ground uh or like this and starts
ground uh or like this and starts rolling so I I have a a something that
rolling so I I have a a something that detects one boxal objects that's very uh
detects one boxal objects that's very uh thin uh and just dampen the rotation so
thin uh and just dampen the rotation so you're not going to see too much of this
you're not going to see too much of this rolling I try to hide it as much as I
rolling I try to hide it as much as I can but as long as it's more than one
can but as long as it's more than one voxel thickness in any direction it's
voxel thickness in any direction it's not a problem anymore because then it's
not a problem anymore because then it's going to Tumble over and and stay the
going to Tumble over and and stay the way it
way it is
is um so let's make the other one
red and can maybe a shape like this and then we want to see if these uh collide
then we want to see if these uh collide and this is where I want to rotate stuff
and this is where I want to rotate stuff because uh then you can
this and normally in Collision detection you
and normally in Collision detection you have convex objects and you do a search
have convex objects and you do a search algorithm to find the to the two closest
algorithm to find the to the two closest features and when you have the features
features and when you have the features uh you have an algorithm to clip them uh
uh you have an algorithm to clip them uh to generate contact points uh
to generate contact points uh according to and then you reduce the
according to and then you reduce the number of contact it's a pretty complex
number of contact it's a pretty complex uh thing Collision detection is really
uh thing Collision detection is really hard and on top of that you also have
hard and on top of that you also have all the floating Point Precision errors
all the floating Point Precision errors and it's it's a total mess to work with
and it's it's a total mess to work with and especially with destruction if
and especially with destruction if you're going to do procedural
you're going to do procedural destruction with polygon uh
destruction with polygon uh physics uh
physics uh that's insanely hard and and not very
that's insanely hard and and not very fun because it it just breaks down in so
fun because it it just breaks down in so many Corner cases that it's that's makes
many Corner cases that it's that's makes it super hard to work with with voxus on
it super hard to work with with voxus on the other hand almost none of that
the other hand almost none of that exists because a voxal objects can have
exists because a voxal objects can have since there can be voxal anywhere they
since there can be voxal anywhere they can have any shape there are no
can have any shape there are no restrictions on uh
restrictions on uh convexity there's no search there's
convexity there's no search there's basically no search because when I want
basically no search because when I want to check something if I want to check if
to check something if I want to check if this green
this green boxal
boxal here collides with
here collides with something uh I can just transform
something uh I can just transform this position
this position into
into the
the uh see which which voxel does that
uh see which which voxel does that correspond to in the other object in
correspond to in the other object in this
this one and in this case it would be this
one and in this case it would be this one right it's in that grid
one right it's in that grid cell uh and the only way that can
cell uh and the only way that can collide with something is if there is
collide with something is if there is boxal data here
boxal data here or since we're not doing a since it can
or since we're not doing a since it can technically mismatch by half a Vox hole
technically mismatch by half a Vox hole we also have to check these uh
we also have to check these uh neighboring voxes but as long as not
neighboring voxes but as long as not something is not moving too much those
something is not moving too much those are the only uh places I have to check
are the only uh places I have to check for collisions there's no searching if
for collisions there's no searching if you want to see if one box will collides
you want to see if one box will collides with something in the other object it's
with something in the other object it's it's pretty
it's pretty immediate uh you just go in in there and
immediate uh you just go in in there and look if there's data and if there isn't
look if there's data and if there isn't there's no
there's no Collision but on top of this uh doing
Collision but on top of this uh doing this for all the voxel would be uh
this for all the voxel would be uh pretty time consuming because as I said
pretty time consuming because as I said there could be like a million U voxel
there could be like a million U voxel per object and doing like a million by a
per object and doing like a million by a million that would be that to wait for
million that would be that to wait for hours for that to complete
hours for that to complete so so we have to prune this somehow and
so so we have to prune this somehow and you could do it in a more hierarchic
you could do it in a more hierarchic fashion I'm I'm not doing that actually
fashion I'm I'm not doing that actually you could use like a this MIP mapping
you could use like a this MIP mapping technique that we did for graphics but
technique that we did for graphics but instead it actually ends up not usually
instead it actually ends up not usually being that many voxal you have to check
being that many voxal you have to check because
because um if objects could be like this it
um if objects could be like this it would be a problem but since they are
would be a problem but since they are physical objects and the bounds are
physical objects and the bounds are pretty tight it more often looks like
pretty tight it more often looks like this maybe it's supposed to stop before
this maybe it's supposed to stop before they start intersecting right so uh that
they start intersecting right so uh that usually means we don't have a lot of
usually means we don't have a lot of overlap so the first thing we do is to
overlap so the first thing we do is to check a voxal or the first thing I do is
check a voxal or the first thing I do is is actually to to look for the a
is actually to to look for the a bounding box
bounding box intersection so I transform
intersection so I transform I
I see I try to find the bounding box of
see I try to find the bounding box of the intersection so when checking boxes
the intersection so when checking boxes in this object
in this object here I would probably end up with a
here I would probably end up with a bounding box check that is something
bounding box check that is something like this I don't have to check the
like this I don't have to check the other voxos because I know they will
other voxos because I know they will not collide with the other one and when
not collide with the other one and when checking for boxes in this one
checking for boxes in this one uh I'm going to do a similar thing and
uh I'm going to do a similar thing and in this case since this one is
in this case since this one is disoriented uh I would probably end up
with something like this right so I had to check but it's still a very typically
to check but it's still a very typically a very small number of voxel out of the
a very small number of voxel out of the whole object you have to check and on
whole object you have to check and on top of
top of that there are actually
that there are actually more uh optimizations to be done so
more uh optimizations to be done so before even coming here as a
before even coming here as a pre-processing step when when something
pre-processing step when when something changes shape or when there is
changes shape or when there is destruction or when loading a level or
destruction or when loading a level or when something changes I I do a
when something changes I I do a pre-processing step which is pretty
pre-processing step which is pretty quick on each voxal object where I
quick on each voxal object where I classify
classify voxels and in this case it would mean
to see if something is either an edge a corner or an inside of
either an edge a corner or an inside of an
an object and then I I remember that in a
object and then I I remember that in a separate boxal representation so for
separate boxal representation so for there's actually one physical
there's actually one physical representation and one graphical that
representation and one graphical that are both same size and both are boxal
are both same size and both are boxal data both have one BTE per boxal
data both have one BTE per boxal but they contain different types of data
but they contain different types of data so for physics I store let's say we give
so for physics I store let's say we give this is a corner we can call it C this
this is a corner we can call it C this is a corner corner
is a corner corner corner there is one too and this one is
corner there is one too and this one is also considered a corner since it has
also considered a corner since it has this
this convex uh
convex uh shape
shape uh this is considered an edge because
uh this is considered an edge because the only way that could Collide is with
the only way that could Collide is with this one it always has to the normal
this one it always has to the normal would always point in that direction so
would always point in that direction so it can be treated a little differently
it can be treated a little differently so is this
so is this one this is also an
one this is also an edge
edge Edge and this one is actually an inside
Edge and this one is actually an inside that doesn't have to that don't have to
that doesn't have to that don't have to be checked at all and for this is a
be checked at all and for this is a pretty small uh example but in most
pretty small uh example but in most large objects most of the voxal are
large objects most of the voxal are going to be
going to be like this if you have thousand like not
like this if you have thousand like not thousands but maybe uh 100 by 100 by 50
thousands but maybe uh 100 by 100 by 50 voxels um and it's more or less solid
voxels um and it's more or less solid it's it's going to be a lot of those
it's it's going to be a lot of those inside boxos and they're very cheap
inside boxos and they're very cheap because they're not processed at
because they're not processed at all um so classifying the boxel like
all um so classifying the boxel like this and then do the same thing on this
this and then do the same thing on this other one there a corner corner corner
other one there a corner corner corner all these are Corners this an
all these are Corners this an edge Edge
edge Edge Edge and an
inside uh an edge can never collide with another Edge
edge can never collide with another Edge so they don't have to be checked so when
so they don't have to be checked so when I when I check uh
when checking these Edge voxes in the green one I
these Edge voxes in the green one I only have to check oh maybe I'm saying
only have to check oh maybe I'm saying this
this wrong um let's
wrong um let's see for the corner
ones I have to check for all corner and Edge in the other ones and then I have
Edge in the other ones and then I have to do the the opposite thing so I take
to do the the opposite thing so I take the corners in the other check for
the corners in the other check for Corner edges in the first
Corner edges in the first one for
I actually don't H maybe maybe I'm I'm
actually don't H maybe maybe I'm I'm remember this incorrectly and it's also
remember this incorrectly and it's also different in 3D than in 2D so I actually
different in 3D than in 2D so I actually have one more classification in 3D which
have one more classification in 3D which is face and face cannot collide with
is face and face cannot collide with face but I have to check Edge against
face but I have to check Edge against the other
the other edges um sorry this this got a little
edges um sorry this this got a little confusing but you get the idea I I'll
confusing but you get the idea I I'll probably write up the details on the
probably write up the details on the blog but the main idea is that I
blog but the main idea is that I classify the voxel as a pre-processing
classify the voxel as a pre-processing step and there are very much fewer
step and there are very much fewer checks than you would uh
checks than you would uh think uh so typically if you have face
think uh so typically if you have face voxel like
maybe it's easier to see as an example here uh we go into this
one and I put this box on the ground here uh this box was maybe a bad let's
here uh this box was maybe a bad let's take this little bigger
example I'm going to find an object where
this it's easier to see actually let's take the container the
actually let's take the container the container is a good
container is a good example it has uh assuming the underside
example it has uh assuming the underside here is
here is flat it has
flat it has maybe 20 by 60 voxal touching the
maybe 20 by 60 voxal touching the ground uh so that would be over a th000
ground uh so that would be over a th000 contact points if you generated one for
contact points if you generated one for every
every voxal but since these voxal here are
voxal but since these voxal here are Edge
Edge voxel not
anymore there are only four corner voxos in this entire
in this entire container and that's the Four Corners
container and that's the Four Corners that that that is close to the ground
that that that is close to the ground then we have four over here that's just
then we have four over here that's just discarded because of the bounding box
discarded because of the bounding box test um for doing the Collision
test um for doing the Collision detection against the ground here only
detection against the ground here only those
those four voxels are actually checked for
four voxels are actually checked for Collision against the ground so there
Collision against the ground so there will there will only be contact points
will there will only be contact points at those four
at those four corners and since these are all face
corners and since these are all face voxal there are no edges no no corners
voxal there are no edges no no corners they won't be checked against the
they won't be checked against the container at all so this classification
container at all so this classification helps a lot with checking collisions and
helps a lot with checking collisions and that's kind of the key to making it run
that's kind of the key to making it run at this speed and then I think it would
at this speed and then I think it would probably be possible to to add some
probably be possible to to add some hierarchical uh thing on top of
hierarchical uh thing on top of that but uh we'll
that but uh we'll see if maybe I'll experiment with that a
see if maybe I'll experiment with that a little bit where it's it gets harder if
little bit where it's it gets harder if if you have something like
if you have something like this let me shoot off a little bit here
this let me shoot off a little bit here um so I'm trying trying to
keep the same volume be a little careful and just
volume be a little careful and just shoot off yeah something like
shoot off yeah something like that and we look at the shapes here we
that and we look at the shapes here we can see that this is still almost as
can see that this is still almost as many voxal as it was when I started and
many voxal as it was when I started and so is this one and now I put them in
so is this one and now I put them in like an evil configuration like this
like an evil configuration like this physics do not like this because here we
physics do not like this because here we have a lot of overlap a lot of empty
have a lot of overlap a lot of empty space and a lot of voxel that are both
space and a lot of voxel that are both corner and edges and they need to be
corner and edges and they need to be checked against a lot of other voxal in
checked against a lot of other voxal in the other object so when things look
the other object so when things look like this uh some of those beautiful
like this uh some of those beautiful optimizations don't really do that much
optimizations don't really do that much uh they really aren't aren't that useful
uh they really aren't aren't that useful anymore
anymore but and that's also why you can see a
but and that's also why you can see a big pile of R Rubble uh usually slows
big pile of R Rubble uh usually slows things down quite a bit and that's
things down quite a bit and that's precisely for uh for that
questions yes I wrote down a couple that might be
might be related I notic is that performance
related I notic is that performance degrades when large objects are moving
degrades when large objects are moving or small objects are moving rather
or small objects are moving rather quickly do you do anything like shape
quickly do you do anything like shape cast along the trajectory or is this a
cast along the trajectory or is this a side effect of something else I do a
side effect of something else I do a shape cast along trajectory and that
shape cast along trajectory and that could be a whole other hour worth of
could be a whole other hour worth of talking and trying to sketch things on
talking and trying to sketch things on my iPad which I'm obviously not very
my iPad which I'm obviously not very good at but it's a
good at but it's a uh continuous Collision detection is is
uh continuous Collision detection is is super super if regular Collision
super super if regular Collision detection on polygons is hard doing that
detection on polygons is hard doing that continuously is a
continuously is a nightmare uh but in voxal space there
nightmare uh but in voxal space there are actually a lot of things you can do
are actually a lot of things you can do that makes that very easy by doing it at
that makes that very easy by doing it at more discrete steps since everything is
more discrete steps since everything is voxal we have actually a safe uh
voxal we have actually a safe uh distance uh we can do this in smaller
distance uh we can do this in smaller iterations and everything is done with
iterations and everything is done with continuous Collision detection in Te
continuous Collision detection in Te down you
down you are sometimes going to miss collisions
are sometimes going to miss collisions anyway because that's just the way it is
anyway because that's just the way it is but in most cases it's actually never
but in most cases it's actually never going to just because it has a high
going to just because it has a high speed doesn't mean it will miss
speed doesn't mean it will miss something if it misses something it's
something if it misses something it's going to be because of something else
going to be because of something else typically because the
typically because the solver uh didn't manage to fully resolve
solver uh didn't manage to fully resolve a collision because there was a lot of
a collision because there was a lot of weight differences or other
weight differences or other things but yes there there is CCD on
things but yes there there is CCD on everything a clarification here on that
everything a clarification here on that question my question is about physics is
question my question is about physics is that someone in Discord has been looking
that someone in Discord has been looking into performance League where a lot of
into performance League where a lot of stuff being sledg hammered down into
stuff being sledg hammered down into nothing causes really severe slowdown
nothing causes really severe slowdown even if there is no Rubble left but
even if there is no Rubble left but burning it all down doesn't cause the
burning it all down doesn't cause the same slow
same slow down uh that's interesting I I I'm very
down uh that's interesting I I I'm very aware of this thing uh I just haven't
aware of this thing uh I just haven't had the time to uh demolish an entire
had the time to uh demolish an entire level into some tiny pieces to to
level into some tiny pieces to to profile this I'm pretty sure I can do
profile this I'm pretty sure I can do something about it I would assume
something about it I would assume it's just a lot of debris that somehow
it's just a lot of debris that somehow don't get removed or don't get recycled
don't get removed or don't get recycled or maybe the shapes get removed the
or maybe the shapes get removed the bodies still live on
bodies still live on or I'm not sure but it I'm pretty sure
or I'm not sure but it I'm pretty sure it's fixable at least it used to be like
it's fixable at least it used to be like this
this for fires and I fixed it for fires so it
for fires and I fixed it for fires so it should be it should be possible to do
should be it should be possible to do something
similar there another one that popped up a few time I noticed while map making
a few time I noticed while map making that there's a hard threshold of voxes
that there's a hard threshold of voxes you can have in a map before performance
you can have in a map before performance suddenly drops dramatically almost Haled
suddenly drops dramatically almost Haled you'd assume more voxel equals more lag
you'd assume more voxel equals more lag but no the performance drops only happen
but no the performance drops only happen when I add more voxel to my map past
when I add more voxel to my map past this threshold any idea why this
happens I'm not sure what this person means by more voxel is
what this person means by more voxel is that more objects or larger
objects awaiting clarification because if running on a
clarification because if running on a laptop for instance it can sometimes if
laptop for instance it can sometimes if you run out of vram it
you run out of vram it can do that if it goes over to Shared
can do that if it goes over to Shared memory maybe I'm I'm not
sure more objects yeah that that's the clarification
clarification so uh in that case I don't know I I
so uh in that case I don't know I I still think it can be a memory issue but
still think it can be a memory issue but it's it's really hard to say I haven't
it's it's really hard to say I haven't personally seen that
one I'm curious how large is large or what is this
questions so I see see people talking about the bending of pipes and that is
about the bending of pipes and that is uh that is just joints and rigid bodies
uh that is just joints and rigid bodies there is definitely
there is definitely nothing uh no soft body physics or
nothing uh no soft body physics or something magic to it it's
something magic to it it's just seven eight rigid bodies and joints
and there's the flood fil question again it's it's just a regular flood
again it's it's just a regular flood field there's absolutely nothing special
field there's absolutely nothing special to it uh within an object but then the
to it uh within an object but then the the hard part about
the hard part about detecting uh if something breaks and
detecting uh if something breaks and should fall off it's is not within the
should fall off it's is not within the voxal object itself it is how it's
voxal object itself it is how it's attached to other box of objects as I
attached to other box of objects as I showed you before the trunk here and the
showed you before the trunk here and the top part of the tree are two separate
top part of the tree are two separate shapes so if I break this in
shapes so if I break this in half uh this part this little stump uh
half uh this part this little stump uh should stick to the other shape and
should stick to the other shape and that's a whole different level of
that's a whole different level of traversal uh and that's also the reason
traversal uh and that's also the reason you can see large buildings hanging in
you can see large buildings hanging in the air because technically
I would have to search through the entire
entire map to make sure uh that something isn't
map to make sure uh that something isn't connected uh so I I just have a hard
connected uh so I I just have a hard limit of I
limit of I think 15 M maybe in each Direction uh or
think 15 M maybe in each Direction uh or is it 10 m in each Direction and 20
is it 10 m in each Direction and 20 upwards and downwards I can't really
upwards and downwards I can't really remember um and if it's still
remember um and if it's still uh didn't
uh didn't contain the chunk that you shot off uh
contain the chunk that you shot off uh within that bounding box uh then I'm
within that bounding box uh then I'm just going to assume that it is
just going to assume that it is connected somewhere else on the map
connected somewhere else on the map which is not always the case if you
which is not always the case if you break something really really large
we've also passed 90 minutes yeah yeah I think we should maybe round
yeah yeah I think we should maybe round off
off here uh unless we have a couple of last
uh why don't trees burn it's it's a pretty good question I
burn it's it's a pretty good question I I don't I think
I don't I think I there was a time when fire spread
I there was a time when fire spread uncontrollably uh now it's a little bit
uncontrollably uh now it's a little bit more controlled for performance reasons
more controlled for performance reasons and if I set fire to Grass it was hard
and if I set fire to Grass it was hard to put it out and and it started fires
to put it out and and it started fires so
so often that uh it was kind of tedious to
often that uh it was kind of tedious to go and put out all those fires and the
go and put out all those fires and the the leaves on the trees and the grass is
the leaves on the trees and the grass is the same
the same material
material um but maybe I should give it another
um but maybe I should give it another goal maybe it's it's a good good
simulation uh Dennis did some fluid simulation stuff so ah the old tuxed
simulation stuff so ah the old tuxed Labs YouTube channel
Labs YouTube channel yes that was 10 years ago and it was
yes that was 10 years ago and it was actually not voxal based it was a
actually not voxal based it was a particle
particle simulation
simulation um I I don't think fluid simulation in
um I I don't think fluid simulation in this world is really
this world is really realistic considering we're already
realistic considering we're already consuming a bit more com computational
consuming a bit more com computational power than we should so adding fluid it
power than we should so adding fluid it on top of that probably not a good idea
on top of that probably not a good idea but uh some of
but uh some of the the smoke uh especially the
the the smoke uh especially the extinguisher actually uses fluid
extinguisher actually uses fluid simulation or fluid dynamics uh to
simulation or fluid dynamics uh to compute the motion so and that is
compute the motion so and that is actually based on the same uh techniques
actually based on the same uh techniques that were in those 10year old videos so
that were in those 10year old videos so some of it is actually in there
all right should we wrap this up so thank you very much for watching I
up so thank you very much for watching I didn't have a lot of time uh reading the
didn't have a lot of time uh reading the chat so if you felt like you had a
chat so if you felt like you had a question that didn't get answered you
question that didn't get answered you can can always reach out to me on
can can always reach out to me on Twitter or or so and see if I can answer
Twitter or or so and see if I can answer it I will also put a lot of these I'm
it I will also put a lot of these I'm I'm now writing a series of blog posts
I'm now writing a series of blog posts on my blog blog. toxedo labs.com
on my blog blog. toxedo labs.com um so a lot of the stuff I talked about
um so a lot of the stuff I talked about tonight is going to show up on the blog
tonight is going to show up on the blog in one form or
in one form or another so um keep an eye out for that
another so um keep an eye out for that all right thank you thank you very much
all right thank you thank you very much bye byebye
Clicca su qualsiasi testo o timestamp per andare direttamente a quel momento del video
Condividi:
La maggior parte delle trascrizioni è pronta in meno di 5 secondi
Copia in un clicOltre 125 lingueCerca nel contenutoVai ai timestamp
Incolla l'URL di YouTube
Inserisci il link di qualsiasi video YouTube per ottenere la trascrizione completa
Modulo di estrazione trascrizione
La maggior parte delle trascrizioni è pronta in meno di 5 secondi
Installa la nostra estensione per Chrome
Ottieni le trascrizioni all'istante senza uscire da YouTube. Installa la nostra estensione per Chrome e accedi con un clic alla trascrizione di qualsiasi video direttamente dalla pagina di riproduzione.