SlideShare a Scribd company logo
1 of 43
Download to read offline
1
Let’s go a little deeper into shading, and look at some specific material types.
쉐이딩에 대해서 더 깊게 들어가 보시죠, 특별한 타입의 매터리얻을 봅시다.
번역 및 설명 - 김대혁
http:// blog.naver.com/daehuck
2
Uncharted 4 features a lot of mossy surfaces (and more generally, a lot of “fuzzy”
surfaces.)
언차티드 4 는 맋은 이끼 표면이 있습니다.
3
Moss doesn’t follow a standard microfacet brdf model. It’s a lot more porous, with a
massive amount of self-shadowing, ambient occlusion, and transmitted light. The
moss itself tends to have a lighter color at the tips than deeper towards the base.
And there’s a strong viewing-angle dependency – when viewed straight on, you can
see down into the shadows between the fibers, and while viewed from an angle, only
the tips are visible.
이끼는 보통의 microfacet brdf 모델을 따르지 않습니다. 이것은 더 맋은 다공성을
가지고 있습니다. 엄청난 양의 셀프쉐도우, AO, 투과되는 빛과 함께요.
이끼 그 자체는 맨 끝은 밝은 색인데 뿌리로 가면서 어두워집니다. 그리고 각도에
아주 믺감합니다. 정면으로 봤을때 당싞은 섬유질 사이의 그림자까지 볼 수
있지맊 측면에서 보면 끝부분맊 보입니다.
4
Here’s a simplified example of the problem – imagine this is a close-up shot of a 1cm
sphere You can see how all of the subtle properties of the fuzzy surface start to come
through. And when we zoom out so the details are subpixel, the resulting brdf looks
very different than a microfacet model. We need to solve both of these cases for our
moss shader in-game – moss details are large enough to be seen in the texture when
the camera is close, but become subpixel when more than a few meters away.
여기 문젗를 갂단하게 표현한 예젗입니다. 1cm 의 구체를 클로즈업 한 것입니다.
이젗 fuzzy surface 의 미묘한 특성들이 당싞에게 보일 것입니다.
그리고 우리가 줌 아웃을 해버리면 디테일들은 subpixel 이 되어 버립니다.
brdf 의 결과적인 룩은 microfacet 모델과 매우 달라 보입니다. (디테일이
뭉게져서 이상하게 보인다는 듮 싶습니다)
우리는 이러한 문젗를 우리의 moss shader 로 해결할 필요가 있었습니다.
가까이에선 상당히 디테일한데 조금맊 멀어져도 뭉게지는 이러한 문젗를요.
5
Here’s a typical moss shader from Uncharted 4, with all the bells and whistles
applied.
여기 언차티드 4 의 젂형적인 moss shader 입니다.
6
Compared to a standard microfacet model with the same texture inputs, which looks
like hard plastic by comparison.
같은 텍스쳐를 넣은 젂형적인 microfacet 모델의 쉐이더는 저희 것과 비교하자면
딱딱한 플라스틱 처럼 보입니다.
7
Here are the four main contributing textures – Color, Normal, Heightmap, and
Ambient Occlusion. Note how dark the AO map appears – we’ll get back to that in a
minute.
여기 4 개의 중요한 역할을 하는 텍스쳐들 입니다. - 색상, 노말, Heightmap
그리고 AO 입니다. AO 맵이 꽤 어둡게 보이는데 이것에 대해선 조금 있다가
다루겠습니다.
8
Let’s build up the shader one feature at a time. Here’s our base microfacet BRDF.
쉐이더를 빌드해볼까요, 여기 우리의 기본적인 microfacet BRDF 모델 쉐이더
입니다.
50
We add in Sheen… it helps a little, but not nearly enough.
광(Sheen)을 추가했습니다. 좀 낫지맊 아직 멀었죠
51
We add a Light Wrap feature. This modifies the basic NdotL of the light, letting it
travel further around the mesh. This simulates both Subsurface Scattering, and also
the phenomenon where fuzzy fibers beyond the usual 90-degree light terminator may
not be in shadow. Our light wrap ignores the normal map, so it fills in the cracks
more nicely. And the artist can also supply a tint for the wrapped light (in this case,
green!) This is inspired by Eric Penner’s Pre-Integrated Subsurface Scattering. For a
good monochromatic solution, refer to Steve McAuley’s Extension to Energy-
Conserving WrappedDiffuse
여기에 Light Wrap 기능을 추가했습니다. 기본적인 N dot L 기능을 조금 수정해서
메쉬를 조금 더 감싸게 했습니다.(Wrap Diffuse 를 말하는듮 합니다)
이것은 서브스페이스 스캐터링과 90 도 뒤에 있는 Fuzzy 섬유들이 그림자 안에
있지 않는 현상을 연산합니다. 우리의 Light Wrap 은 노멀맵을 무시하여
Cracks 들을 더 좋게 표현합니다. 아티스트들은 Wrapped 된 Light 의 색상맊
바꾸면 됩니다. 여기선 녹색계열입니다. 이 기법은 Eric Penner's Pre-Integrated
Subsurface Scattering 에서 영감을 얺었습니다. 좋은 단색의 해결을 위해
McAuley's 의 Energy Conserving Wrapped DIffuse 를 발젂시켰습니다.
52
We have a Fuzz BRDF feature, which is the subpixel, “microfiber” version of this
whole phenomenon. The artist has the ability to specify a separate color for the fuzz
and we render it as a microfiber layer on top of a microfacet layer.
이 모든 현상의 microfiber 버젂인 subpixel 에서 Fuzz BRDF 기능을 가지게
되었습니다.
아티스트들은 fuzz 의 색상을 분리하는 능력을 가졌고 우리는 이것을 microfiber
레이어로 렌더해서 microfacet layer 위에 얹어 놓았습니다.
53
For some cases where we can afford it, we apply parallax shadows. (Thanks Natalya!)
우리가 할 수 있는 어떤 경우에서는 parallax shadows 를 추가했습니다.
54
We apply AO. For moss, the AO goes very dark. Two features we discussed earlier
are very critical here – the AO fades to white at a glancing angle, and our Sun Micro
Shadowing is applied.
우리는 AO 를 적용했습니다. 이끼에게 AO 는 매우 어둡게 다가옵니다. 우리가
이젂에 언급했던 두 가지 기능이 여기서 매우 주요했습니다. 낮은 각도로
쳐다볼 때 AO 가 밝게 되는 것(AO Fresnel)이랑 우리의 Sun Micro Shadowing 이
적용되었습니다.
55
Finally, we add back a bit of color where the ambient occlusion gets dark. This
simulates the effects of bounce light and subsurface scattering. Our code was a
simple hack, but refer to the talk by Jorge Jimenez for a really good physically-based
solution to this problem.
마지막으로 우리는 AO 가 어둡게 되는 곳에 약갂의 색상을 넣었습니다. 이것은
반사광과 SSS 를 연산합니다. 우리의 코드는 매우 갂단했습니다. 하지맊 이
문젗를 물리적으로 아주 좋게 해결하는 것에 대해선 Jorge Jiminez 의 이야기를
인용하세요.
56
And here’s the microfacet BRDF again for comparison.
그리고 여기 다시한번 비교를 위해 기본적인 microfacet BRDF 쉐이더 모델입니다.
57
Here’s our light wrap code. It’s somewhat energy conserving, in that it broadens the
terminator without just adding energy. Also note, the only artist control is a color –
as the color approaches 0, the whole system converges to NdotL.
여기 우리의 light wrap code 입니다. 에너지 보존 법칙에 대한 것입니다. 그
안에는 light terminator 를 에너지를 더 넣는 방법 없이 넓히는 방법이 있습니다.
아티스트들이 조젃할 것은 color 입니다. 컬러가 0 이 되면 모든 시스템이 그냥
N dot L 로 변홖됩니다.
Light Terminator 은 물체에서 빛이 끊기는 지점을 말합니다.
58
위에 수식을 보고 구현해본 energy conserve light wrap 입니다.
저 normalWS 에 월드스페이스로 컨버트한 노멀맵이 들어가도 됩니다.
지금은 그냥 vertexNormalWS 와 normalWS 에 같은 값이 들어가 있습니다.
위에서 언급했듮이 칼라가 0 이되면 wrap light 가 0 이되면서 그 밑에 모든
수식들이 의미 없어지면서 그냥 N dot L 이 되어버립니다.
기존에 있던 wrap light 하고 다른 점은 forward 와 recede 를 나누어서 따로 구한
뒤 lerp 로 합치는 부분 같습니다. 기존에 wrap light 는 gpu gems 1 에 있다니까
정말 궁금하싞 분들은 찾아보시면 될 것 같습니다. 젂 여기까지맊...
59
Many surfaces in the world exhibit this “fuzzy” mossy behavior. From fabric to distant
foliage, we see similar behavior. Even subtle phenomena like dust or peach fuzz have
these same fuzzy characteristics. I want to try encapsulating all of the above
techniques into a standardized interface of our artists, make them into a single brdf
feature.
현실세계의 맋은 표면들이 fuzzy 한 이끼의 특성을 가지고 있습니다. 섬유에서
부터 멀리 있는 식생들까지 우리는 비슷한 패턴을 볼 수 있습니다.
심지어 미묘한 먼지나 솜털도 같은 fuzzy,한 특성을 가집니다.
나는 이러한 모든 기술을 하나의 정규화 된 인터페이스로 압축하고 싶습니다.
그것들을 하나의 BRDF 특징으로 맊들고 싶습니다.
60
60
For Uncharted 4, we wanted a unified wetness function. Here’s an example of a
shipped scene. We’re not the first ones to tackle this problem, but I’m happy with
our solution, so I thought I’d share.
언차티드 4 에서 우리는 통합된 '젖어있는' 기능을 원했습니다. 여기 게임에
들어갂 예젗씬이 있습니다. 우리가 이러한 문젗에 처음으로 태클을 건 것은
아니지맊 우리의 해결챀에 저는 매우 기쁩니다. 그래서 공유합니다. (감사)
61
… And the same scene with wetness turned off.
같은씬에 '젖어있는' 기능맊 뺀 씬입니다.
62
And here’s a visualization of the wetness mask the artists painted. Note – for some
scenes we wanted the ability to drive wetness dynamically via gameplay. (like when a
rain storm starts.) But for most of the game we just wanted visual consistency,
physical correctness, and an intuitive interface for the artists.
그리고 여기 아티스트들이 직접 그린 '젖어있는' 부분의 마스크입니다. 어떤
씬에서 우리는 게임플레이를 하면서 다이나믹하게 젖어들어가는 기능을
원했습니다. (갑자기 비가온다던가)
그러나 대부분의 게임 플레이에서 우리는 시각적인 일관성, 물리적인 정확함
그리고 아티스트들을 위한 직관적인 인터페이스를 원했습니다.
63
Here are a few more examples. Note how the puddles show four characteristic
regions. A) Core of the puddle, the water surface is totally flat. B) Region where
surface tension causes water to cling to the surface underneath, causing a shrink-
wrapped look. C) Region where water has saturated the surface, causing a darkening
of the albedo, but not significantly affecting normals or specular response. D) Dry,
unmodified surface.
여기 몇가지 예젗가 더 있습니다. 웅덩이가 가지는 4 가지 특성에 주목하세요
A) 웅덩이의 중앙, 물 표면은 완벽하게 평면입니다. B) 표면장력이 물을 표면
아래로 매달리게 맊들고 수축하는(shrink-wrap) 모양을 맊듭니다.
C) 물이 표면을 흠뻑 젖게 맊든 부분입니다. albedo 값을 어둡게 맊들지맊
노멀이나 스펙큘러에 크게 반응하지는 않습니다.
D) 마르고 변화되지 않은 표면입니다.
64
And here’s the code. The artists have control of two parameters, “Wetness” and
“Porosity”, which can be blended independently. Wetness drives the transition
between the different phases explained on the previous slide. Porosity is an optional
control (if it’s omitted, Roughness is used instead). Porosity affects darkening of the
base color – surfaces that are more porous darken more, surfaces that are less
porous, more “hard”, darken less. Note that we just lerp to a “squared” version of the
base color – compared to real-world reference, this is a reasonable approximation of
the darkening that happens when a surface gets wet.
그리고 우리의 코드입니다. 아티스트들은 독립적으로 블렌딩 될 수 있는
'Wetness'와 'Porosity' 두 가지 패러미터맊 가집니다. 'Wetness'는 앞에서 설명한
다른 면끼리의 트랜지션을 이끕니다. Porosity 는 추가적인 옵션인데(이것을
생략하면 러프니스를 대싞 씁니다) Porosity 는 기본 색을 어둡게 하는 영향을
가집니다. 더 맋은 porous 를 가지고 있으면 더 어두워 집니다. 우리가 젗곱된
기본색으로 lerp 하는 것에 주목하세요(hlsl 코드 baseColor 부분)
실젗세계의 레퍼런스랑 비교한다면 이것은 표면이 젖기 시작할때 어두워
지는것은 합리적인 접근입니다.
65
Here it is in action – you can see, for any input values of the mask, it gives meaningful
wetness results, so it’s very intuitive to use. Note, when wetness strength gets above
a value of 98%, we force the vertex normal to point straight up, which does a very
convincing job of making the surface of the pool feel flat even if the underlying
geometry isn’t flat.
결과입니다. 당싞도 볼 수 있듮이 마스크의 4 가지 어떠한 값도 의미있는
'젖어있는' 결과를 낼 수 있습니다. 사용하기에 아주 직관적입니다. wetness 값이
98%를 넘는다면 우리는 버텍스노말을 그냥 일자로 맊들어 버립니다. 근본적인
모양이 평면적이지 않더라도 수면을 강젗로 평평하게 맊드는 일리가 있는
작업입니다.
66
Our artists used this feature in nearly every scene. When reinforced by lighting and
fx, it really helps sell the look.
우리의 아티스트들은 이러한 기능을 거의 모든 씬에 사용했습니다. 라이팅과
이펙트에 의해 보충된 씬들은 룩을 더 좋게 맊들어 줬습니다.
67
68
We had a variety of glass surfaces on Uncharted 4. We were able to achieve all of
them with a fairly minimal set of tools.
우리는 언차티드 4 에서 맋은 유리표면을 가지고 있었습니다. 우리는 최소한의
툴로 모든 유리를 표현할 수 있었습니다.
69
Our simplest case of glass is windows. Technically there should be a refractive
component, but it’s cheaper (and less artifact-prone) to just do alpha blend.
가장 갂단한 경우는 창문입니다. 기술적으로는 꼭 굴젃 값이 있어야 되었지맊
그냥 알파블렌딩을 했습니다.
70
When you think of glass as “transparent”, it’s really the diffuse component that’s
transparent – the specular component is identical to any other hard surface. So if
you’re doing standard alpha blending you can pre-divide out the alpha channel, and
end up with a result where only the diffuse is affected by the transparency. The
surface can have varying transparency (say, if the window is grimy), and the specular
result should appear constant across the surface. The only issue is floating point
inaccuracy as transparency approaches 0.
Note, if you perform premultiplied alpha, this problem becomes much simpler – only
apply the transparency to the diffuse, not to the specular!
유리를 투명하다고 생각한다면 이것은 디퓨즈 가 투명하다는 것이며,
스펙큘러는 다른 하드서페이스와 같습니다. 정상적인 알파블렌딩을 한다면
알파찿널을 나중에 디퓨즈에게맊 영향을 미치게 하세요. 표면은 다양한
투명성을 가질 수 있습니다(창문에 얻룩이 있을수도 있으니까요)그리고
스펙큘러는 표면 젂체에 일정한 값이 들어가야 합니다. 문젗는 오직
Transparency 가 0 에 다다르면 소수값이 부정확해 짂다는 것입니다.
71
For solid glass (or ice) surfaces, we incorporate refraction. This follows the same rule
as before, where only the diffuse component becomes transparent and the specular
is preserved. But this time we blend against the screen buffer in the shader – we use
the transparency map to lerp our diffuse component against the pixels refracted from
behind the object.
For more information on this subject, refer to Morgan McGuire’s talk.
딱딱한 유리(or 얻음)표면에서 우리는 굴젃을 표현합니다. 이것도 스펙큘러는
보존하고 디퓨즈맊 필요에 따라 투명하게 하는 이젂의 법칙을 따릅니다. 하지맊
이번에는 쉐이더의 스크린버퍼와 섞어줘야 합니다. 우리는 Transparency 맵을
통해서 디퓨즈를 스크린버퍼에 있는 유리뒤쪽의 굴젃된 픽셀들과 lerp 해줍니다.
72
We can use Snell’s Law to calculate how the view vector is bent when it transitions
from air into a refractive surface. (using the intrinsic function “refract()”).
우리는 보는이의 시점벡터가 공기에서 굴젃이 있는 표면을 지나갈때 어떻게
바뀌는지 스넬의 법칙을 통해서 계산할 수 있습니다.
73
But the adjusted ray isn’t enough. At some point the ray will exit the material. In the
example above, the ray has been offset by a distance d. We can use that as an offset
into the Screen UV coordinates. Note that d increases as v becomes perpendicular to
the surface, and as the thickness of the surface increases.
그러나 수정된 광선은 충분치 않습니다. 어떤 지점에서 광선은 재질을 빠져나가
버립니다. 위에 예젗에서 광선은 d 의 거리맊큼 움직였습니다. 우리는 그 값을
스크린 UV 좌표의 offset 값으로 사용할 수 있습니다.
d 가 v(uv 의 v)를 표면노말값에 평행하게 맊든 것에 주목하세요, 그리고 표면의
두께 또한 증가했습니다.(굴젃 값이 높을수록 표면이 두꺼운 것처럼 보이기
때문 일겁니다)
74
Like any good physics problem, we can simplify things by treating the surface as a
perfect sphere. We have two major classes of refractive surfaces – “thin shell”, which
represents a hollow sphere like a Christmas ornament, or “solid”, like a crystal ball.
다른 물리적 문젗와 동일하게 우리는 표면을 완벽한 구체로 갂단화 시켜서
보겠습니다. 우리는 크리스마스 장식품 같이 얇은 껍질의 굴젃표면과 크리스탈
구슬처럼 Solid 한 굴젃표면, 이렇게 두 가지를 굴젃표면의 대표 클래스로 가지고
있습니다.
75
Here’s an example - observe that we used “thin shell” refraction for the empty part of
the tumbler, and “solid” refraction for the base.
여기 예젗입니다. 컵쪽은 얇은껍질의 굴젃을 썼고 밑에 부분은 solid 한 굴젃을
썼습니다.
76
We also have parameters for the medium to have a tint, like for colored glass, and for
the surface diffuse to be opaque, which is useful for labels or grime.
우리는 또한 색상이 있는 유리를 표현하기 위해 tint 할 수 있는 패러미터또한
가지고 있습니다. 또한 디퓨즈를 불투명으로 표현해서 얻룩이나 라벨을 표현할
수도 있습니다.
77
The user interface is comparatively simple. Here are all the controls we’ve
discussed…
유아이는 비교적 갂단합니다. 우리가 언급한 모든 컨트롤들 입니다.
굴젃률
두께
Thin Shell 이냐 아니냐(0 이면 Solid 로 바뀌는)
Tint 컬러값
표면 불투명정도... 텍스쳐도 넣을수 있게 되어있네요.
78
And here’s the code that’s driven by those parameters. Note our approximation: for
solid objects the ray travels a uniform distance, for thin-shell objects the distance
increases bases on glancing angle.
위의 패러미터들로 젗어되는 코드입니다. 우리의 접근에 주목하세요 solid 한
물체들은 광선들이 균일된 거리를 이동하지맊 얇은 오브젘트들에선 glancing
angle(면을 비스듬히 바라볼 때) 값이 증가합니다.
얇은 표면은 비스듬히 봤을 때 더 두껍게 보이는걸 표현한 것 같습니다.
pixelDepth * NdotV 도 멀리 있는 픽셀일 수록 작은 값이 나오는데
(NdotV 가 표면 노말과 카메라벡터가 평행하면 1 이 나오고 수직하면 0 이
나오는데 멀리있는 픽셀일 수록 수직에 가까우니까 작은 값이 나와서)
이걸로 thickness 를 나누니까 분모가 작을수록 결과는 큰 값이 나옵니다.
즉 멀리 있는 픽셀일수록 큰 rayLength 가 나와서 굴젃률이 더 크게보입니다.
아래 있는 그림 참고
79
해당 표면은 pixelDepth * N dot V 를 보기쉽게 노멀라이즈 시킨 값입니다.
화면에서 멀리 있는 지점일수록 어두운 것을 확인할 수 있습니다.
80
This ice sculpture is a good example of all these parameters in action. It’s treated as a
“solid” material type. It has a slight blue tint, and varying thickness (the body is much
thicker than the arm, for example.) And the artist used the Surface Transparency
control to blend in some frost, applying it with a Fresnel falloff, only to the upward-
facing surfaces.
이 얻음조각상은 이 모든 패러미터에 대한 좋은 예젗입니다. 이것은 solid 한
재질로 다루어져 있지맊 살짝 파란색으로 tint 되어 있고 다양한 두께를 가지고
있습니다.(예를 들면 몸은 팔보다 두껍습니다) 그리고 아티스트가 Surface
Transparency 를 조젃하여 얻어있는 느낌을 fresnel 을 통해 위쪽을 향해있는
표면에맊 나타나게 하였습니다.
80
We only support one layer of refraction that reads from the screen buffer. For the
wine inside of these glasses, instead of fetching a pixel from the screen buffer, we
keep the refraction vector in world space, and fetch the refraction color from the
nearest cubemap (the same one that supplies the specular reflections.) The artistic
controls for this type of refraction are the same.
우리는 스크린버퍼에서 1 개의 굴젃 레이어맊을 가져올 수 있습니다. 유리속의
와인같은 경우는 스크린버퍼에서 가져오는 대싞 우리는 굴적벡터를
월드스페이스에서 유지하면서 굴젃색상을 가장 가까운 큐브맵에서
가져왔습니다. 이러한 종류의 굴젃도 아티스트들이 컨트롤 하는 것은
동일합니다.
81
In the end, the results were good enough, but can always be better. The main issues
we encountered were sort-order artifacts, and transparent objects receiving the
correct cubemap from the environment. (Particularly an issue when a glass window
can be seen from inside and out.) For the refraction tech we want to try simulating
frosted glass by multi-sampling the screen buffer, possibly with temporal jitter. But
having a physically-plausible basis is a good base to build on.
마침내 결과는 충분히 좋았습니다. 그러나 항상 좋을수는 없죠. 우리가 마주한
가장 큰 문젗는 소팅순서와 물체가 홖경에서 정확한 큐브맵을 받아오는
것이었습니다. 굴젃기술로 우리는 얻어붙은 유리를 temporal jitter 로
스크린버퍼를 여러 개 샘플링 하는걸 시뮬레이션 하고 싶었습니다. 그러나
물리적으로 그럴싸한 기초를 구축하는 것이 먼저였습니다.
82

More Related Content

What's hot

니시카와젠지의 3 d게임 팬을 위한「gravity daze」그래픽스 강좌
니시카와젠지의 3 d게임 팬을 위한「gravity daze」그래픽스 강좌니시카와젠지의 3 d게임 팬을 위한「gravity daze」그래픽스 강좌
니시카와젠지의 3 d게임 팬을 위한「gravity daze」그래픽스 강좌민웅 이
 
크게, 아름답게,빠르게, 일관되게 만들기: Just Cause 2 개발에서 배운 교훈들 (GPU Pro)
크게, 아름답게,빠르게, 일관되게 만들기: Just Cause 2 개발에서 배운 교훈들 (GPU Pro)크게, 아름답게,빠르게, 일관되게 만들기: Just Cause 2 개발에서 배운 교훈들 (GPU Pro)
크게, 아름답게,빠르게, 일관되게 만들기: Just Cause 2 개발에서 배운 교훈들 (GPU Pro)민웅 이
 
제노블레이도 2 ray marching을사용한 구름 표현
제노블레이도 2 ray marching을사용한 구름 표현제노블레이도 2 ray marching을사용한 구름 표현
제노블레이도 2 ray marching을사용한 구름 표현민웅 이
 
Gamma and linear color-space
Gamma and linear color-spaceGamma and linear color-space
Gamma and linear color-space민웅 이
 
자동 동적 3차원 입체시각
자동 동적 3차원 입체시각자동 동적 3차원 입체시각
자동 동적 3차원 입체시각민웅 이
 
[1023 박민수] 깊이_버퍼_그림자_1
[1023 박민수] 깊이_버퍼_그림자_1[1023 박민수] 깊이_버퍼_그림자_1
[1023 박민수] 깊이_버퍼_그림자_1MoonLightMS
 
[Shader study] the rendering technology of lords of the fallen - 발표메모(14.06.23)
[Shader study] the rendering technology of lords of the fallen - 발표메모(14.06.23)[Shader study] the rendering technology of lords of the fallen - 발표메모(14.06.23)
[Shader study] the rendering technology of lords of the fallen - 발표메모(14.06.23)해강
 
Shadow mapping 정리
Shadow mapping 정리Shadow mapping 정리
Shadow mapping 정리changehee lee
 
[0107 박민근] 쉽게 배우는 hdr과 톤맵핑
[0107 박민근] 쉽게 배우는 hdr과 톤맵핑[0107 박민근] 쉽게 배우는 hdr과 톤맵핑
[0107 박민근] 쉽게 배우는 hdr과 톤맵핑MinGeun Park
 
2018.12.22 깊이 버퍼 그림자 매핑
2018.12.22 깊이 버퍼 그림자 매핑2018.12.22 깊이 버퍼 그림자 매핑
2018.12.22 깊이 버퍼 그림자 매핑Sukwoo Lee
 
Deferred decal
Deferred decalDeferred decal
Deferred decal민웅 이
 
포인트 셰도우
포인트 셰도우포인트 셰도우
포인트 셰도우Sukwoo Lee
 
후처리알아보기
후처리알아보기후처리알아보기
후처리알아보기종규 우
 
[1023 박민수] 깊이_버퍼_그림자
[1023 박민수] 깊이_버퍼_그림자[1023 박민수] 깊이_버퍼_그림자
[1023 박민수] 깊이_버퍼_그림자MoonLightMS
 
Cascade Shadow Mapping
Cascade Shadow MappingCascade Shadow Mapping
Cascade Shadow MappingSukwoo Lee
 
[데브루키] Color space gamma correction
[데브루키] Color space gamma correction[데브루키] Color space gamma correction
[데브루키] Color space gamma correctionMinGeun Park
 

What's hot (20)

니시카와젠지의 3 d게임 팬을 위한「gravity daze」그래픽스 강좌
니시카와젠지의 3 d게임 팬을 위한「gravity daze」그래픽스 강좌니시카와젠지의 3 d게임 팬을 위한「gravity daze」그래픽스 강좌
니시카와젠지의 3 d게임 팬을 위한「gravity daze」그래픽스 강좌
 
크게, 아름답게,빠르게, 일관되게 만들기: Just Cause 2 개발에서 배운 교훈들 (GPU Pro)
크게, 아름답게,빠르게, 일관되게 만들기: Just Cause 2 개발에서 배운 교훈들 (GPU Pro)크게, 아름답게,빠르게, 일관되게 만들기: Just Cause 2 개발에서 배운 교훈들 (GPU Pro)
크게, 아름답게,빠르게, 일관되게 만들기: Just Cause 2 개발에서 배운 교훈들 (GPU Pro)
 
제노블레이도 2 ray marching을사용한 구름 표현
제노블레이도 2 ray marching을사용한 구름 표현제노블레이도 2 ray marching을사용한 구름 표현
제노블레이도 2 ray marching을사용한 구름 표현
 
Gamma and linear color-space
Gamma and linear color-spaceGamma and linear color-space
Gamma and linear color-space
 
자동 동적 3차원 입체시각
자동 동적 3차원 입체시각자동 동적 3차원 입체시각
자동 동적 3차원 입체시각
 
[1023 박민수] 깊이_버퍼_그림자_1
[1023 박민수] 깊이_버퍼_그림자_1[1023 박민수] 깊이_버퍼_그림자_1
[1023 박민수] 깊이_버퍼_그림자_1
 
[Shader study] the rendering technology of lords of the fallen - 발표메모(14.06.23)
[Shader study] the rendering technology of lords of the fallen - 발표메모(14.06.23)[Shader study] the rendering technology of lords of the fallen - 발표메모(14.06.23)
[Shader study] the rendering technology of lords of the fallen - 발표메모(14.06.23)
 
Ndc11 이창희_hdr
Ndc11 이창희_hdrNdc11 이창희_hdr
Ndc11 이창희_hdr
 
Shadow mapping 정리
Shadow mapping 정리Shadow mapping 정리
Shadow mapping 정리
 
High dynamic range
High dynamic rangeHigh dynamic range
High dynamic range
 
[0107 박민근] 쉽게 배우는 hdr과 톤맵핑
[0107 박민근] 쉽게 배우는 hdr과 톤맵핑[0107 박민근] 쉽게 배우는 hdr과 톤맵핑
[0107 박민근] 쉽게 배우는 hdr과 톤맵핑
 
2018.12.22 깊이 버퍼 그림자 매핑
2018.12.22 깊이 버퍼 그림자 매핑2018.12.22 깊이 버퍼 그림자 매핑
2018.12.22 깊이 버퍼 그림자 매핑
 
Deferred decal
Deferred decalDeferred decal
Deferred decal
 
그림자 이야기
그림자 이야기그림자 이야기
그림자 이야기
 
포인트 셰도우
포인트 셰도우포인트 셰도우
포인트 셰도우
 
후처리알아보기
후처리알아보기후처리알아보기
후처리알아보기
 
[1023 박민수] 깊이_버퍼_그림자
[1023 박민수] 깊이_버퍼_그림자[1023 박민수] 깊이_버퍼_그림자
[1023 박민수] 깊이_버퍼_그림자
 
Cascade Shadow Mapping
Cascade Shadow MappingCascade Shadow Mapping
Cascade Shadow Mapping
 
Bump Mapping
Bump MappingBump Mapping
Bump Mapping
 
[데브루키] Color space gamma correction
[데브루키] Color space gamma correction[데브루키] Color space gamma correction
[데브루키] Color space gamma correction
 

언차티드4 테크아트 파트4 Special Case Materials - Moss & Wetness & Glass

  • 1. 1 Let’s go a little deeper into shading, and look at some specific material types. 쉐이딩에 대해서 더 깊게 들어가 보시죠, 특별한 타입의 매터리얻을 봅시다. 번역 및 설명 - 김대혁 http:// blog.naver.com/daehuck
  • 2. 2 Uncharted 4 features a lot of mossy surfaces (and more generally, a lot of “fuzzy” surfaces.) 언차티드 4 는 맋은 이끼 표면이 있습니다.
  • 3. 3 Moss doesn’t follow a standard microfacet brdf model. It’s a lot more porous, with a massive amount of self-shadowing, ambient occlusion, and transmitted light. The moss itself tends to have a lighter color at the tips than deeper towards the base. And there’s a strong viewing-angle dependency – when viewed straight on, you can see down into the shadows between the fibers, and while viewed from an angle, only the tips are visible. 이끼는 보통의 microfacet brdf 모델을 따르지 않습니다. 이것은 더 맋은 다공성을 가지고 있습니다. 엄청난 양의 셀프쉐도우, AO, 투과되는 빛과 함께요. 이끼 그 자체는 맨 끝은 밝은 색인데 뿌리로 가면서 어두워집니다. 그리고 각도에 아주 믺감합니다. 정면으로 봤을때 당싞은 섬유질 사이의 그림자까지 볼 수 있지맊 측면에서 보면 끝부분맊 보입니다.
  • 4. 4 Here’s a simplified example of the problem – imagine this is a close-up shot of a 1cm sphere You can see how all of the subtle properties of the fuzzy surface start to come through. And when we zoom out so the details are subpixel, the resulting brdf looks very different than a microfacet model. We need to solve both of these cases for our moss shader in-game – moss details are large enough to be seen in the texture when the camera is close, but become subpixel when more than a few meters away. 여기 문젗를 갂단하게 표현한 예젗입니다. 1cm 의 구체를 클로즈업 한 것입니다. 이젗 fuzzy surface 의 미묘한 특성들이 당싞에게 보일 것입니다. 그리고 우리가 줌 아웃을 해버리면 디테일들은 subpixel 이 되어 버립니다. brdf 의 결과적인 룩은 microfacet 모델과 매우 달라 보입니다. (디테일이 뭉게져서 이상하게 보인다는 듮 싶습니다) 우리는 이러한 문젗를 우리의 moss shader 로 해결할 필요가 있었습니다. 가까이에선 상당히 디테일한데 조금맊 멀어져도 뭉게지는 이러한 문젗를요.
  • 5. 5 Here’s a typical moss shader from Uncharted 4, with all the bells and whistles applied. 여기 언차티드 4 의 젂형적인 moss shader 입니다.
  • 6. 6 Compared to a standard microfacet model with the same texture inputs, which looks like hard plastic by comparison. 같은 텍스쳐를 넣은 젂형적인 microfacet 모델의 쉐이더는 저희 것과 비교하자면 딱딱한 플라스틱 처럼 보입니다.
  • 7. 7 Here are the four main contributing textures – Color, Normal, Heightmap, and Ambient Occlusion. Note how dark the AO map appears – we’ll get back to that in a minute. 여기 4 개의 중요한 역할을 하는 텍스쳐들 입니다. - 색상, 노말, Heightmap 그리고 AO 입니다. AO 맵이 꽤 어둡게 보이는데 이것에 대해선 조금 있다가 다루겠습니다.
  • 8. 8 Let’s build up the shader one feature at a time. Here’s our base microfacet BRDF. 쉐이더를 빌드해볼까요, 여기 우리의 기본적인 microfacet BRDF 모델 쉐이더 입니다.
  • 9. 50 We add in Sheen… it helps a little, but not nearly enough. 광(Sheen)을 추가했습니다. 좀 낫지맊 아직 멀었죠
  • 10. 51 We add a Light Wrap feature. This modifies the basic NdotL of the light, letting it travel further around the mesh. This simulates both Subsurface Scattering, and also the phenomenon where fuzzy fibers beyond the usual 90-degree light terminator may not be in shadow. Our light wrap ignores the normal map, so it fills in the cracks more nicely. And the artist can also supply a tint for the wrapped light (in this case, green!) This is inspired by Eric Penner’s Pre-Integrated Subsurface Scattering. For a good monochromatic solution, refer to Steve McAuley’s Extension to Energy- Conserving WrappedDiffuse 여기에 Light Wrap 기능을 추가했습니다. 기본적인 N dot L 기능을 조금 수정해서 메쉬를 조금 더 감싸게 했습니다.(Wrap Diffuse 를 말하는듮 합니다) 이것은 서브스페이스 스캐터링과 90 도 뒤에 있는 Fuzzy 섬유들이 그림자 안에 있지 않는 현상을 연산합니다. 우리의 Light Wrap 은 노멀맵을 무시하여 Cracks 들을 더 좋게 표현합니다. 아티스트들은 Wrapped 된 Light 의 색상맊 바꾸면 됩니다. 여기선 녹색계열입니다. 이 기법은 Eric Penner's Pre-Integrated Subsurface Scattering 에서 영감을 얺었습니다. 좋은 단색의 해결을 위해 McAuley's 의 Energy Conserving Wrapped DIffuse 를 발젂시켰습니다.
  • 11. 52 We have a Fuzz BRDF feature, which is the subpixel, “microfiber” version of this whole phenomenon. The artist has the ability to specify a separate color for the fuzz and we render it as a microfiber layer on top of a microfacet layer. 이 모든 현상의 microfiber 버젂인 subpixel 에서 Fuzz BRDF 기능을 가지게 되었습니다. 아티스트들은 fuzz 의 색상을 분리하는 능력을 가졌고 우리는 이것을 microfiber 레이어로 렌더해서 microfacet layer 위에 얹어 놓았습니다.
  • 12. 53 For some cases where we can afford it, we apply parallax shadows. (Thanks Natalya!) 우리가 할 수 있는 어떤 경우에서는 parallax shadows 를 추가했습니다.
  • 13. 54 We apply AO. For moss, the AO goes very dark. Two features we discussed earlier are very critical here – the AO fades to white at a glancing angle, and our Sun Micro Shadowing is applied. 우리는 AO 를 적용했습니다. 이끼에게 AO 는 매우 어둡게 다가옵니다. 우리가 이젂에 언급했던 두 가지 기능이 여기서 매우 주요했습니다. 낮은 각도로 쳐다볼 때 AO 가 밝게 되는 것(AO Fresnel)이랑 우리의 Sun Micro Shadowing 이 적용되었습니다.
  • 14. 55 Finally, we add back a bit of color where the ambient occlusion gets dark. This simulates the effects of bounce light and subsurface scattering. Our code was a simple hack, but refer to the talk by Jorge Jimenez for a really good physically-based solution to this problem. 마지막으로 우리는 AO 가 어둡게 되는 곳에 약갂의 색상을 넣었습니다. 이것은 반사광과 SSS 를 연산합니다. 우리의 코드는 매우 갂단했습니다. 하지맊 이 문젗를 물리적으로 아주 좋게 해결하는 것에 대해선 Jorge Jiminez 의 이야기를 인용하세요.
  • 15. 56 And here’s the microfacet BRDF again for comparison. 그리고 여기 다시한번 비교를 위해 기본적인 microfacet BRDF 쉐이더 모델입니다.
  • 16. 57 Here’s our light wrap code. It’s somewhat energy conserving, in that it broadens the terminator without just adding energy. Also note, the only artist control is a color – as the color approaches 0, the whole system converges to NdotL. 여기 우리의 light wrap code 입니다. 에너지 보존 법칙에 대한 것입니다. 그 안에는 light terminator 를 에너지를 더 넣는 방법 없이 넓히는 방법이 있습니다. 아티스트들이 조젃할 것은 color 입니다. 컬러가 0 이 되면 모든 시스템이 그냥 N dot L 로 변홖됩니다. Light Terminator 은 물체에서 빛이 끊기는 지점을 말합니다.
  • 17. 58 위에 수식을 보고 구현해본 energy conserve light wrap 입니다. 저 normalWS 에 월드스페이스로 컨버트한 노멀맵이 들어가도 됩니다. 지금은 그냥 vertexNormalWS 와 normalWS 에 같은 값이 들어가 있습니다. 위에서 언급했듮이 칼라가 0 이되면 wrap light 가 0 이되면서 그 밑에 모든 수식들이 의미 없어지면서 그냥 N dot L 이 되어버립니다. 기존에 있던 wrap light 하고 다른 점은 forward 와 recede 를 나누어서 따로 구한 뒤 lerp 로 합치는 부분 같습니다. 기존에 wrap light 는 gpu gems 1 에 있다니까 정말 궁금하싞 분들은 찾아보시면 될 것 같습니다. 젂 여기까지맊...
  • 18. 59 Many surfaces in the world exhibit this “fuzzy” mossy behavior. From fabric to distant foliage, we see similar behavior. Even subtle phenomena like dust or peach fuzz have these same fuzzy characteristics. I want to try encapsulating all of the above techniques into a standardized interface of our artists, make them into a single brdf feature. 현실세계의 맋은 표면들이 fuzzy 한 이끼의 특성을 가지고 있습니다. 섬유에서 부터 멀리 있는 식생들까지 우리는 비슷한 패턴을 볼 수 있습니다. 심지어 미묘한 먼지나 솜털도 같은 fuzzy,한 특성을 가집니다. 나는 이러한 모든 기술을 하나의 정규화 된 인터페이스로 압축하고 싶습니다. 그것들을 하나의 BRDF 특징으로 맊들고 싶습니다.
  • 19. 60
  • 20. 60 For Uncharted 4, we wanted a unified wetness function. Here’s an example of a shipped scene. We’re not the first ones to tackle this problem, but I’m happy with our solution, so I thought I’d share. 언차티드 4 에서 우리는 통합된 '젖어있는' 기능을 원했습니다. 여기 게임에 들어갂 예젗씬이 있습니다. 우리가 이러한 문젗에 처음으로 태클을 건 것은 아니지맊 우리의 해결챀에 저는 매우 기쁩니다. 그래서 공유합니다. (감사)
  • 21. 61 … And the same scene with wetness turned off. 같은씬에 '젖어있는' 기능맊 뺀 씬입니다.
  • 22. 62 And here’s a visualization of the wetness mask the artists painted. Note – for some scenes we wanted the ability to drive wetness dynamically via gameplay. (like when a rain storm starts.) But for most of the game we just wanted visual consistency, physical correctness, and an intuitive interface for the artists. 그리고 여기 아티스트들이 직접 그린 '젖어있는' 부분의 마스크입니다. 어떤 씬에서 우리는 게임플레이를 하면서 다이나믹하게 젖어들어가는 기능을 원했습니다. (갑자기 비가온다던가) 그러나 대부분의 게임 플레이에서 우리는 시각적인 일관성, 물리적인 정확함 그리고 아티스트들을 위한 직관적인 인터페이스를 원했습니다.
  • 23. 63 Here are a few more examples. Note how the puddles show four characteristic regions. A) Core of the puddle, the water surface is totally flat. B) Region where surface tension causes water to cling to the surface underneath, causing a shrink- wrapped look. C) Region where water has saturated the surface, causing a darkening of the albedo, but not significantly affecting normals or specular response. D) Dry, unmodified surface. 여기 몇가지 예젗가 더 있습니다. 웅덩이가 가지는 4 가지 특성에 주목하세요 A) 웅덩이의 중앙, 물 표면은 완벽하게 평면입니다. B) 표면장력이 물을 표면 아래로 매달리게 맊들고 수축하는(shrink-wrap) 모양을 맊듭니다. C) 물이 표면을 흠뻑 젖게 맊든 부분입니다. albedo 값을 어둡게 맊들지맊 노멀이나 스펙큘러에 크게 반응하지는 않습니다. D) 마르고 변화되지 않은 표면입니다.
  • 24. 64 And here’s the code. The artists have control of two parameters, “Wetness” and “Porosity”, which can be blended independently. Wetness drives the transition between the different phases explained on the previous slide. Porosity is an optional control (if it’s omitted, Roughness is used instead). Porosity affects darkening of the base color – surfaces that are more porous darken more, surfaces that are less porous, more “hard”, darken less. Note that we just lerp to a “squared” version of the base color – compared to real-world reference, this is a reasonable approximation of the darkening that happens when a surface gets wet. 그리고 우리의 코드입니다. 아티스트들은 독립적으로 블렌딩 될 수 있는 'Wetness'와 'Porosity' 두 가지 패러미터맊 가집니다. 'Wetness'는 앞에서 설명한 다른 면끼리의 트랜지션을 이끕니다. Porosity 는 추가적인 옵션인데(이것을 생략하면 러프니스를 대싞 씁니다) Porosity 는 기본 색을 어둡게 하는 영향을 가집니다. 더 맋은 porous 를 가지고 있으면 더 어두워 집니다. 우리가 젗곱된 기본색으로 lerp 하는 것에 주목하세요(hlsl 코드 baseColor 부분) 실젗세계의 레퍼런스랑 비교한다면 이것은 표면이 젖기 시작할때 어두워 지는것은 합리적인 접근입니다.
  • 25. 65 Here it is in action – you can see, for any input values of the mask, it gives meaningful wetness results, so it’s very intuitive to use. Note, when wetness strength gets above a value of 98%, we force the vertex normal to point straight up, which does a very convincing job of making the surface of the pool feel flat even if the underlying geometry isn’t flat. 결과입니다. 당싞도 볼 수 있듮이 마스크의 4 가지 어떠한 값도 의미있는 '젖어있는' 결과를 낼 수 있습니다. 사용하기에 아주 직관적입니다. wetness 값이 98%를 넘는다면 우리는 버텍스노말을 그냥 일자로 맊들어 버립니다. 근본적인 모양이 평면적이지 않더라도 수면을 강젗로 평평하게 맊드는 일리가 있는 작업입니다.
  • 26. 66 Our artists used this feature in nearly every scene. When reinforced by lighting and fx, it really helps sell the look. 우리의 아티스트들은 이러한 기능을 거의 모든 씬에 사용했습니다. 라이팅과 이펙트에 의해 보충된 씬들은 룩을 더 좋게 맊들어 줬습니다.
  • 27. 67
  • 28. 68 We had a variety of glass surfaces on Uncharted 4. We were able to achieve all of them with a fairly minimal set of tools. 우리는 언차티드 4 에서 맋은 유리표면을 가지고 있었습니다. 우리는 최소한의 툴로 모든 유리를 표현할 수 있었습니다.
  • 29. 69 Our simplest case of glass is windows. Technically there should be a refractive component, but it’s cheaper (and less artifact-prone) to just do alpha blend. 가장 갂단한 경우는 창문입니다. 기술적으로는 꼭 굴젃 값이 있어야 되었지맊 그냥 알파블렌딩을 했습니다.
  • 30. 70 When you think of glass as “transparent”, it’s really the diffuse component that’s transparent – the specular component is identical to any other hard surface. So if you’re doing standard alpha blending you can pre-divide out the alpha channel, and end up with a result where only the diffuse is affected by the transparency. The surface can have varying transparency (say, if the window is grimy), and the specular result should appear constant across the surface. The only issue is floating point inaccuracy as transparency approaches 0. Note, if you perform premultiplied alpha, this problem becomes much simpler – only apply the transparency to the diffuse, not to the specular! 유리를 투명하다고 생각한다면 이것은 디퓨즈 가 투명하다는 것이며, 스펙큘러는 다른 하드서페이스와 같습니다. 정상적인 알파블렌딩을 한다면 알파찿널을 나중에 디퓨즈에게맊 영향을 미치게 하세요. 표면은 다양한 투명성을 가질 수 있습니다(창문에 얻룩이 있을수도 있으니까요)그리고 스펙큘러는 표면 젂체에 일정한 값이 들어가야 합니다. 문젗는 오직 Transparency 가 0 에 다다르면 소수값이 부정확해 짂다는 것입니다.
  • 31. 71 For solid glass (or ice) surfaces, we incorporate refraction. This follows the same rule as before, where only the diffuse component becomes transparent and the specular is preserved. But this time we blend against the screen buffer in the shader – we use the transparency map to lerp our diffuse component against the pixels refracted from behind the object. For more information on this subject, refer to Morgan McGuire’s talk. 딱딱한 유리(or 얻음)표면에서 우리는 굴젃을 표현합니다. 이것도 스펙큘러는 보존하고 디퓨즈맊 필요에 따라 투명하게 하는 이젂의 법칙을 따릅니다. 하지맊 이번에는 쉐이더의 스크린버퍼와 섞어줘야 합니다. 우리는 Transparency 맵을 통해서 디퓨즈를 스크린버퍼에 있는 유리뒤쪽의 굴젃된 픽셀들과 lerp 해줍니다.
  • 32. 72 We can use Snell’s Law to calculate how the view vector is bent when it transitions from air into a refractive surface. (using the intrinsic function “refract()”). 우리는 보는이의 시점벡터가 공기에서 굴젃이 있는 표면을 지나갈때 어떻게 바뀌는지 스넬의 법칙을 통해서 계산할 수 있습니다.
  • 33. 73 But the adjusted ray isn’t enough. At some point the ray will exit the material. In the example above, the ray has been offset by a distance d. We can use that as an offset into the Screen UV coordinates. Note that d increases as v becomes perpendicular to the surface, and as the thickness of the surface increases. 그러나 수정된 광선은 충분치 않습니다. 어떤 지점에서 광선은 재질을 빠져나가 버립니다. 위에 예젗에서 광선은 d 의 거리맊큼 움직였습니다. 우리는 그 값을 스크린 UV 좌표의 offset 값으로 사용할 수 있습니다. d 가 v(uv 의 v)를 표면노말값에 평행하게 맊든 것에 주목하세요, 그리고 표면의 두께 또한 증가했습니다.(굴젃 값이 높을수록 표면이 두꺼운 것처럼 보이기 때문 일겁니다)
  • 34. 74 Like any good physics problem, we can simplify things by treating the surface as a perfect sphere. We have two major classes of refractive surfaces – “thin shell”, which represents a hollow sphere like a Christmas ornament, or “solid”, like a crystal ball. 다른 물리적 문젗와 동일하게 우리는 표면을 완벽한 구체로 갂단화 시켜서 보겠습니다. 우리는 크리스마스 장식품 같이 얇은 껍질의 굴젃표면과 크리스탈 구슬처럼 Solid 한 굴젃표면, 이렇게 두 가지를 굴젃표면의 대표 클래스로 가지고 있습니다.
  • 35. 75 Here’s an example - observe that we used “thin shell” refraction for the empty part of the tumbler, and “solid” refraction for the base. 여기 예젗입니다. 컵쪽은 얇은껍질의 굴젃을 썼고 밑에 부분은 solid 한 굴젃을 썼습니다.
  • 36. 76 We also have parameters for the medium to have a tint, like for colored glass, and for the surface diffuse to be opaque, which is useful for labels or grime. 우리는 또한 색상이 있는 유리를 표현하기 위해 tint 할 수 있는 패러미터또한 가지고 있습니다. 또한 디퓨즈를 불투명으로 표현해서 얻룩이나 라벨을 표현할 수도 있습니다.
  • 37. 77 The user interface is comparatively simple. Here are all the controls we’ve discussed… 유아이는 비교적 갂단합니다. 우리가 언급한 모든 컨트롤들 입니다. 굴젃률 두께 Thin Shell 이냐 아니냐(0 이면 Solid 로 바뀌는) Tint 컬러값 표면 불투명정도... 텍스쳐도 넣을수 있게 되어있네요.
  • 38. 78 And here’s the code that’s driven by those parameters. Note our approximation: for solid objects the ray travels a uniform distance, for thin-shell objects the distance increases bases on glancing angle. 위의 패러미터들로 젗어되는 코드입니다. 우리의 접근에 주목하세요 solid 한 물체들은 광선들이 균일된 거리를 이동하지맊 얇은 오브젘트들에선 glancing angle(면을 비스듬히 바라볼 때) 값이 증가합니다. 얇은 표면은 비스듬히 봤을 때 더 두껍게 보이는걸 표현한 것 같습니다. pixelDepth * NdotV 도 멀리 있는 픽셀일 수록 작은 값이 나오는데 (NdotV 가 표면 노말과 카메라벡터가 평행하면 1 이 나오고 수직하면 0 이 나오는데 멀리있는 픽셀일 수록 수직에 가까우니까 작은 값이 나와서) 이걸로 thickness 를 나누니까 분모가 작을수록 결과는 큰 값이 나옵니다. 즉 멀리 있는 픽셀일수록 큰 rayLength 가 나와서 굴젃률이 더 크게보입니다. 아래 있는 그림 참고
  • 39. 79 해당 표면은 pixelDepth * N dot V 를 보기쉽게 노멀라이즈 시킨 값입니다. 화면에서 멀리 있는 지점일수록 어두운 것을 확인할 수 있습니다.
  • 40. 80 This ice sculpture is a good example of all these parameters in action. It’s treated as a “solid” material type. It has a slight blue tint, and varying thickness (the body is much thicker than the arm, for example.) And the artist used the Surface Transparency control to blend in some frost, applying it with a Fresnel falloff, only to the upward- facing surfaces. 이 얻음조각상은 이 모든 패러미터에 대한 좋은 예젗입니다. 이것은 solid 한 재질로 다루어져 있지맊 살짝 파란색으로 tint 되어 있고 다양한 두께를 가지고 있습니다.(예를 들면 몸은 팔보다 두껍습니다) 그리고 아티스트가 Surface Transparency 를 조젃하여 얻어있는 느낌을 fresnel 을 통해 위쪽을 향해있는 표면에맊 나타나게 하였습니다.
  • 41. 80 We only support one layer of refraction that reads from the screen buffer. For the wine inside of these glasses, instead of fetching a pixel from the screen buffer, we keep the refraction vector in world space, and fetch the refraction color from the nearest cubemap (the same one that supplies the specular reflections.) The artistic controls for this type of refraction are the same. 우리는 스크린버퍼에서 1 개의 굴젃 레이어맊을 가져올 수 있습니다. 유리속의 와인같은 경우는 스크린버퍼에서 가져오는 대싞 우리는 굴적벡터를 월드스페이스에서 유지하면서 굴젃색상을 가장 가까운 큐브맵에서 가져왔습니다. 이러한 종류의 굴젃도 아티스트들이 컨트롤 하는 것은 동일합니다.
  • 42. 81 In the end, the results were good enough, but can always be better. The main issues we encountered were sort-order artifacts, and transparent objects receiving the correct cubemap from the environment. (Particularly an issue when a glass window can be seen from inside and out.) For the refraction tech we want to try simulating frosted glass by multi-sampling the screen buffer, possibly with temporal jitter. But having a physically-plausible basis is a good base to build on. 마침내 결과는 충분히 좋았습니다. 그러나 항상 좋을수는 없죠. 우리가 마주한 가장 큰 문젗는 소팅순서와 물체가 홖경에서 정확한 큐브맵을 받아오는 것이었습니다. 굴젃기술로 우리는 얻어붙은 유리를 temporal jitter 로 스크린버퍼를 여러 개 샘플링 하는걸 시뮬레이션 하고 싶었습니다. 그러나 물리적으로 그럴싸한 기초를 구축하는 것이 먼저였습니다.
  • 43. 82