Tip:
Highlight text to annotate it
X
in his lesson will explore the process of utilizing the right to depth buffer
so this is an output node that can be used as a way of outputting your own custom depth
information prettier objects
so let's take a look at how we can actually set this up but we firstly to do is take a
look
inside dear ever saying to me for using my a two thousand nine or higher
he should have access to the new pass rendering system national utilized to create
uh... this particular buffer
sonar case
what we first need to do is create
one custom depth buffer at least one
and we can actually write the data that we want into this
so will create and close
the will just leave this as it is
and sign it
to the current path so that way this will actually be rented out
now one thing that is important to take into account is that this particular buffer is
not necessarily accurate
as far as writing out real accurate
depth information really just allows us to overwrite the depth information with something
apart though and choosing
try to keep this in mind as we start to work with this particular noted
so let's start
with this debt
and the first thing when you do is choose which
pass this is actually went to write its data out into
to our case we can write this out to the custom death past that we just created a moment ago
and now all we need to
actually put in some kind of an evaluation trigger
so in our case this can be triggered usually by a material
so in our case all we would have to do is take one of our materials
middle quick
dropping into the evaluation passed through
and now
any object id is using this particular material
can have and new
uh... custom death that we defined
so in our case we can set the depth to something like
ten word any arbitrary value
and let's go ahead and make this a little bit more apparent
by adding in another
passer another dept buffer
how we can actually have this second notice right its depth information into the same
custom death pass so we can actually have multiple buffers that right their information
and combine them
into this one output that's going to be rendered
so for this trigger
let's take another one of our materials
drop this into the passed through
so now it any material that her in the object that seizing this red material
can have the depth of
let's say twenty
and we can do this as many times as we want for as many objects as we want
so here's our third one
again it will write its depth information into the same that fast
take our orange material drop it into the trigger
and this can habitat the let's say thirty
again this could be any arbitrary value that we want
so once we have a few the setup let's go into our render settings and let's make sure that
we
set some kind of a output format
and will render this house we can take a look at what we have to
so let's give us a name something like
custom dept
and we can do a pass name
tickets added onto the into this
regelson i'll have a file that gets written out called custom depth indian whatever the
name of our
pass with us in our case
the underscore the last portion of that will be custom dept
so let's take a look what we have let's go to renter and batch render this out
so once this has been returned we cannot take a look inside the images directory that we
have set this too
uh... actually be output to
and you can see we have our custom dept past that has now been written out
now again as i mentioned we do have the ability now to control this and you can see that all
of the buffers have written there
individual depth informations into this one single image
the problem though is that this is not accurate because you can see that based on the sheeting
that the objects that
typically are supposed to be close to the camera will be the brightest objects
and you can see that that is not the case because this material we assigned have a depth
of ten
this material we assigned have a depth of
this material has a depth of twenty
so you can see that
again by having this level of control we sacrifice accuracy
and we can wind up sacrificing the actual usability of this
so one of the things that we can do
or another thing that we can do to even push this a little bit further
is that if you have multiple objects that are sharing the same material
it will go ahead and write
any material information into the trigger
so what's
grill kasi what this means lets take bball in material
and let's go ahead and dropped this onto
uh... something like the background
if we go
so again as i mentioned every material that is assigned to it particular object
will write its information helped
whichever one of these is
actually holding the red boolean as its trigger
will now be able to write data from this new object into that same buffer because again
it's using this material
so let's check out the difference for this let's go again too
who render batch render
and now to go back and take a look at the new version of this custom debt that's been
alpert
you can see that now would be information or the dept for this background
has been written out as well but again this really illustrates the problem that we can
run into whenever using this custom dep pass
if that is the fact that
dice that we have right here and the background
were both using the same material
and again if you recall from the custom buffer
uh... we had to set up to where it
uh... object the used this material would be written in the preamble for as having a
depth of ten
so again this is not an accurate depth result we get back
so for mostly jewish ins i would recommend sticking with the typical diffuse or rather
the normal dept
pass that we have people eat output
uh... but if you do for whatever reason need to
actually write out your bone
custom depth information we do have that ability available to us
so that's a look at how we can utilize this right that depth buffer as a way of writing
out our own custom depth information