스킬연구 창에 들어가는 이미지이다.

맥스에서 모델링 기본텍스쳐 작업후 랜더링한후 너무 실사 스럽지않게 리터칭한 작업이다.

 

역시나 원본은 도데체 어디에........

 

 

((주)엔드림 에 저작권이 있습니다. / 도용, 수정및 재사용은 법적문제가 발생할수있습니다.)

 

Posted by 프리랜서 디자이너

1. 모델링에 단차가 어느정도 있어야 함.

2. 빼기의 경우 차집합 아이콘이 눌러져있어야 함.

3. 머지 한다.

4. 지모델러로 만든 경우 폴리구룹을 재 설정해야함.

5.다이나 메쉬를 누르면 하이폴 메쉬로 변경된다.

되돌리면 망가지므로 미리 저장해두자.

 

Posted by 프리랜서 디자이너
TA/Unity2020. 7. 7. 11:40

Unity Shader Stencil

 

구문(Syntax)

Ref

  Ref referenceValue

The value to be compared against (if Comp is anything else than always) and/or the value to be written to the buffer (if either Pass, Fail or ZFail is set to replace). 0–255 integer.

 

비교할 값 (Comp가 항상 아닌 것) 및 / 또는 버퍼에 쓸 값 (Pass, Fail 또는 ZFail이 Replace로 설정된 경우)입니다. 0-255 정수.

 

 

ReadMask

  ReadMask readMask

An 8 bit mask as an 0–255 integer, used when comparing the reference value with the contents of the buffer (referenceValue & readMask) comparisonFunction (stencilBufferValue & readMask). Default: 255.

 

참조 값을 버퍼의 내용 (referenceValue & readMask)과 비교할 때 사용되는 8 비트 마스크 (0-255 정수) comparisonFunction (stencilBufferValue & readMask). 기본값 : 255.

 

 

 

WriteMask

  WriteMask writeMask

An 8 bit mask as an 0–255 integer, used when writing to the buffer. Default: 255.

 

0-255 정수의 8 비트 마스크로, 버퍼에 쓸 때 사용됩니다. 기본값 : 255.

 

 

Comp

  Comp comparisonFunction

The function used to compare the reference value to the current contents of the buffer. Default: always.

 

이 함수는 참조 값을 버퍼의 현재 내용과 비교하는 데 사용됩니다. 기본값 : 항상.

 

 

Pass

  Pass stencilOperation

What to do with the contents of the buffer if the stencil test (and the depth test) passes. Default: keep.

 

스텐실 테스트 (및 깊이 테스트)가 통과하면 버퍼의 내용으로 수행 할 작업. 기본값 : 유지.

 

 

 

Fail

  Fail stencilOperation

What to do with the contents of the buffer if the stencil test fails. Default: keep.

 

스텐실 테스트가 실패 할 경우 버퍼의 내용으로 수행 할 작업. 기본값 : 유지.

 

 

 

ZFail

  ZFail stencilOperation

What to do with the contents of the buffer if the stencil test passes, but the depth test fails. Default: keep.

 

스텐실 테스트가 통과했지만 깊이 테스트가 실패 할 경우 버퍼의 내용으로 수행 할 작업. 기본값 : 유지.

 

Comp, Pass, Fail and ZFail will be applied to the front-facing geometry, unless Cull Front is specified, in which case it’s back-facing geometry. You can also explicitly specify the two-sided stencil state by defining CompFront, PassFront, FailFront, ZFailFront (for front-facing geometry), and CompBack, PassBack, FailBack, ZFailBack (for back-facing geometry).

 

 

Cull Front가 지정되지 않은 경우 Comp, Pass, Fail 및 ZFail이 전면 대칭 지오메트리에 적용됩니다. CompFront, PassFront, FailFront, ZFailFront (정면 지오메트리의 경우) 및 CompBack, PassBack, FailBack, ZFailBack (후면 지오메트리의 경우)을 정의하여 양면 스텐실 상태를 명시 적으로 지정할 수도 있습니다.

 

 

Comparison Function

Comparison function is one of the following:

   

Greater

Only render pixels whose reference value is greater than the value in the buffer.

참조 값이 버퍼의 값보다 큰 픽셀 만 렌더링합니다.

 

GEqual

Only render pixels whose reference value is greater than or equal to the value in the buffer.

참조 값이 버퍼의 값보다 크거나 같은 픽셀 만 렌더링합니다.

 

 

Less

Only render pixels whose reference value is less than the value in the buffer.

참조 값이 버퍼의 값보다 작은 픽셀 만 렌더링합니다.

 

LEqual

Only render pixels whose reference value is less than or equal to the value in the buffer.

 참조 값이 버퍼의 값보다 작거나 같은 픽셀 만 렌더링합니다.

 

Equal

Only render pixels whose reference value equals the value in the buffer.

참조 값이 버퍼의 값과 동일한 픽셀 만 렌더링합니다.

 

NotEqual

Only render pixels whose reference value differs from the value in the buffer.

참조 값이 버퍼의 값과 다른 픽셀 만 렌더링합니다.

 

Always

Make the stencil test always pass.

스텐실 테스트를 항상 통과 시키십시오.

Never

Make the stencil test always fail.

스텐실 테스트를 항상 실패하게 만드십시오.

 

 

 

 

Stencil Operation

Stencil operation is one of the following:

   

Keep

Keep the current contents of the buffer.

버퍼의 현재 내용을 유지하십시오.

Zero

Write 0 into the buffer.

버퍼에 0을 씁니다.

Replace

Write the reference value into the buffer.

참조 값을 버퍼에 씁니다.

IncrSat

Increment the current value in the buffer. If the value is 255 already, it stays at 255.

버퍼의 현재 값을 증가시킵니다. 값이 이미 255이면 255로 유지됩니다.

 

DecrSat

Decrement the current value in the buffer. If the value is 0 already, it stays at 0.

버퍼의 현재 값을 감소시킵니다. 값이 이미 0이면 0으로 유지됩니다.

 

Invert

Negate all the bits.

모든 비트를 부정합니다.

 

IncrWrap

Increment the current value in the buffer. If the value is 255 already, it becomes 0.

버퍼의 현재 값을 증가시킵니다. 값이 이미 255이면 0이됩니다.

 

DecrWrap

Decrement the current value in the buffer. If the value is 0 already, it becomes 255.

버퍼의 현재 값을 감소시킵니다. 값이 이미 0이면 255가됩니다.

 

 

Deferred rendering path

Stencil functionality for objects rendered in the deferred rendering path is somewhat limited, as during the base pass and lighting pass the stencil buffer is used for other purposes. During those two stages stencil state defined in the shader will be ignored and only taken into account during the final pass. Because of that it’s not possible to mask out these objects based on a stencil test, but they can still modify the buffer contents, to be used by objects rendered later in the frame. Objects rendered in the forward rendering path following the deferred path (e.g. transparent objects or objects without a surface shader) will set their stencil state normally again.

The deferred rendering path uses the three highest bits of the stencil buffer, plus up to four more highest bits - depending on how many light mask layers are used in the scene. It is possible to operate within the range of the “clean” bits using the stencil read and write masks, or you can force the camera to clean the stencil buffer after the lighting pass using Camera.clearStencilAfterLightingPass.

 

 

스텐실 버퍼가 다른 목적으로 사용되는 기본 패스 및 조명 패스 중에는 지연 렌더링 경로에서 렌더링 된 객체의 스텐실 기능이 다소 제한적입니다. 이 두 단계 동안 쉐이더에 정의 된 스텐실 상태는 무시되고 마지막 단계에서만 고려됩니다. 이 때문에 스텐실 테스트를 기반으로 이러한 객체를 마스크 처리 할 수는 없지만 나중에 프레임에서 렌더링되는 객체가 사용하도록 버퍼 내용을 수정할 수 있습니다. 지연 경로를 따르는 순방향 렌더링 경로에서 렌더링 된 객체 (예 : 투명한 객체 또는 표면 셰이더가없는 객체)는 스텐실 상태를 정상적으로 다시 설정합니다.

지연 렌더링 경로는 스텐실 버퍼의 세 개의 최상위 비트와 최대 네 개의 최상위 비트를 사용합니다 (장면에서 사용되는 조명 마스크 레이어의 수에 따라 다름). 스텐실 읽기 및 쓰기 마스크를 사용하여 "깨끗한"비트 범위 내에서 작동하거나 Camera.clearStencilAfterLightingPass를 사용하여 조명 통과 후 카메라가 스텐실 버퍼를 청소하도록 할 수 있습니다.

 

'TA > Unity' 카테고리의 다른 글

Unity Alpha Blend Mode Toggle  (0) 2020.07.07
unity shader 프로퍼티 숨기기  (0) 2020.07.07
라이팅 모델  (0) 2020.07.07
타일 프로퍼티 숨기기 / 프로퍼티 이름달기  (0) 2020.07.07
감마환경에서 PBR쉐이더 보정(리니어)  (0) 2020.07.07
Posted by 프리랜서 디자이너