<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>UnityShader Archives - 어제와 내일의 나 그 사이의 이야기</title>
	<atom:link href="https://lycos7560.com/category/unity/unity_shader/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>생각의 흐름을 타고 다니며 만드는 블로그</description>
	<lastBuildDate>Sun, 08 Sep 2024 00:07:14 +0000</lastBuildDate>
	<language>ko-KR</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://lycos7560.com/wp-content/uploads/2022/11/cropped-cropped-cropped-log-1-150x150-1-80x80.png</url>
	<title>UnityShader Archives - 어제와 내일의 나 그 사이의 이야기</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Unity URP Input.hlsl</title>
		<link>https://lycos7560.com/unity/unity-urp-input-hlsl/38299/</link>
					<comments>https://lycos7560.com/unity/unity-urp-input-hlsl/38299/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Sat, 07 Sep 2024 23:23:29 +0000</pubDate>
				<category><![CDATA[Unity]]></category>
		<category><![CDATA[UnityShader]]></category>
		<category><![CDATA[Core.hlsl]]></category>
		<category><![CDATA[HLSL Shader]]></category>
		<category><![CDATA[Input.hlsl]]></category>
		<category><![CDATA[normalWS]]></category>
		<category><![CDATA[Packages/com.unity.render-pipelines.universal]]></category>
		<category><![CDATA[positionCS]]></category>
		<category><![CDATA[positionWS]]></category>
		<category><![CDATA[Shader]]></category>
		<category><![CDATA[ShaderLab]]></category>
		<category><![CDATA[ShaderLibrary]]></category>
		<category><![CDATA[shadowMask]]></category>
		<category><![CDATA[tangentToWorld]]></category>
		<category><![CDATA[Unity Shader]]></category>
		<guid isPermaLink="false">https://lycos7560.com/?p=38299</guid>

					<description><![CDATA[<p>Universal RP 17.0.3 include &#8220;Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl&#8221; 내부에 input이 포함됨 include &#8220;Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl&#8221; Input.hlsl 1. 헤더 정의 및 보호구문 헤더 파일을 여러 번 포함하는 것을 방지 UNIVERSAL_INPUT_INCLUDED가 정의되지 않은 경우에만 코드가 실행되도록 합니다. 2. 패키지 및 설정 파일 포함 URP의 설정 및 구성을 정의하는 파일을 포함 이 파일에는 URP에서 사용하는 여러 가지 상수 값과 설정이 정의되어 있습니다. 3. [&#8230;]</p>
<p>The post <a href="https://lycos7560.com/unity/unity-urp-input-hlsl/38299/">Unity URP Input.hlsl</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="1056" height="649" src="https://lycos7560.com/wp-content/uploads/2024/09/image-12.png" alt="" class="wp-image-38302" srcset="https://lycos7560.com/wp-content/uploads/2024/09/image-12.png 1056w, https://lycos7560.com/wp-content/uploads/2024/09/image-12-300x184.png 300w, https://lycos7560.com/wp-content/uploads/2024/09/image-12-768x472.png 768w" sizes="(max-width: 1056px) 100vw, 1056px" /></figure>



<p>Universal RP 17.0.3</p>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<p>include &#8220;Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl&#8221; 내부에 input이 포함됨 <br><strong>include &#8220;Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl&#8221; </strong></p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p><strong>Input.hlsl</strong></p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#ifndef UNIVERSAL_INPUT_INCLUDED
#define UNIVERSAL_INPUT_INCLUDED
// URP package specific shader input variables and defines.
// Unity Engine specific built-in shader input variables are defined in .universal/ShaderLibrary/UnityInput.hlsl

#include "Packages/com.unity.render-pipelines.universal-config/Runtime/ShaderConfig.cs.hlsl"

#define MAX_VISIBLE_LIGHTS_UBO  32
#define MAX_VISIBLE_LIGHTS_SSBO 256

// Keep in sync with RenderingUtils.useStructuredBuffer
#define USE_STRUCTURED_BUFFER_FOR_LIGHT_DATA 0

#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderTypes.cs.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Deprecated.hlsl"

// Must match: UniversalRenderPipeline.maxVisibleAdditionalLights
#if defined(SHADER_API_MOBILE) &amp;&amp; defined(SHADER_API_GLES30)
    #define MAX_VISIBLE_LIGHTS MAX_VISIBLE_LIGHT_COUNT_LOW_END_MOBILE
// WebGPU's minimal limits are based on mobile rather than desktop, so it will need to assume mobile.
#elif defined(SHADER_API_MOBILE) || (defined(SHADER_API_GLCORE) &amp;&amp; !defined(SHADER_API_SWITCH)) || defined(SHADER_API_GLES3) || defined(SHADER_API_WEBGPU) // Workaround because SHADER_API_GLCORE is also defined when SHADER_API_SWITCH is
    #define MAX_VISIBLE_LIGHTS MAX_VISIBLE_LIGHT_COUNT_MOBILE
#else
    #define MAX_VISIBLE_LIGHTS MAX_VISIBLE_LIGHT_COUNT_DESKTOP
#endif

// Match with values in UniversalRenderPipeline.cs
#define MAX_ZBIN_VEC4S 1024
#if MAX_VISIBLE_LIGHTS &lt;= 16
    #define MAX_LIGHTS_PER_TILE 32
    #define MAX_TILE_VEC4S 1024
    #define MAX_REFLECTION_PROBES 16
#elif MAX_VISIBLE_LIGHTS &lt;= 32
    #define MAX_LIGHTS_PER_TILE 32
    #define MAX_TILE_VEC4S 1024
    #define MAX_REFLECTION_PROBES 32
#else
    #define MAX_LIGHTS_PER_TILE MAX_VISIBLE_LIGHTS
    #define MAX_TILE_VEC4S 4096
    #define MAX_REFLECTION_PROBES 64
#endif

struct InputData
{
    float3  positionWS;
    float4  positionCS;
    float3  normalWS;
    half3   viewDirectionWS;
    float4  shadowCoord;
    half    fogCoord;
    half3   vertexLighting;
    half3   bakedGI;
    float2  normalizedScreenSpaceUV;
    half4   shadowMask;
    half3x3 tangentToWorld;

    #if defined(DEBUG_DISPLAY)
    half2   dynamicLightmapUV;
    half2   staticLightmapUV;
    float3  vertexSH;

    half3 brdfDiffuse;
    half3 brdfSpecular;

    // Mipmap Streaming Debug
    float2 uv;
    uint mipCount;

    // texelSize :
    // x = 1 / width
    // y = 1 / height
    // z = width
    // w = height
    float4 texelSize;

    // mipInfo :
    // x = quality settings minStreamingMipLevel
    // y = original mip count for texture
    // z = desired on screen mip level
    // w = loaded mip level
    float4 mipInfo;

    // streamInfo :
    // x = streaming priority
    // y = time stamp of the latest texture upload
    // z = streaming status
    // w = 0
    float4 streamInfo;

    float3 originalColor;
    #endif
};

///////////////////////////////////////////////////////////////////////////////
//                      Constant Buffers                                     //
///////////////////////////////////////////////////////////////////////////////

half4 _GlossyEnvironmentColor;
half4 _SubtractiveShadowColor;

half4 _GlossyEnvironmentCubeMap_HDR;
TEXTURECUBE(_GlossyEnvironmentCubeMap);
SAMPLER(sampler_GlossyEnvironmentCubeMap);

#define _InvCameraViewProj unity_MatrixInvVP
float4 _ScaledScreenParams;

// x = Mip Bias
// y = 2.0 ^ [Mip Bias]
float2 _GlobalMipBias;

// 1.0 if it's possible for AlphaToMask to be enabled for this draw and 0.0 otherwise
float _AlphaToMaskAvailable;

float4 _MainLightPosition;
// In Forward+, .a stores whether the main light is using subtractive mixed mode.
half4 _MainLightColor;
half4 _MainLightOcclusionProbes;
uint _MainLightLayerMask;

// x: SSAO Enabled/Disabled (Needed for situations when OFF keyword is stripped out but feature disabled in runtime)
// yz are currently unused
// w: directLightStrength
half4 _AmbientOcclusionParam;

half4 _AdditionalLightsCount;

uint _RenderingLayerMaxInt;
float _RenderingLayerRcpMaxInt;

// Screen coord override.
float4 _ScreenCoordScaleBias;
float4 _ScreenSizeOverride;

uint _EnableProbeVolumes;

#if USE_FORWARD_PLUS
float4 _FPParams0;
float4 _FPParams1;
float4 _FPParams2;

#define URP_FP_ZBIN_SCALE (_FPParams0.x)
#define URP_FP_ZBIN_OFFSET (_FPParams0.y)
#define URP_FP_PROBES_BEGIN ((uint)_FPParams0.z)
// Directional lights would be in all clusters, so they don't go into the cluster structure.
// Instead, they are stored first in the light buffer.
#define URP_FP_DIRECTIONAL_LIGHTS_COUNT ((uint)_FPParams0.w)

// Scale from screen-space UV [0, 1] to tile coordinates [0, tile resolution].
#define URP_FP_TILE_SCALE ((float2)_FPParams1.xy)
#define URP_FP_TILE_COUNT_X ((uint)_FPParams1.z)
#define URP_FP_WORDS_PER_TILE ((uint)_FPParams1.w)

#define URP_FP_ZBIN_COUNT ((uint)_FPParams2.x)
#define URP_FP_TILE_COUNT ((uint)_FPParams2.y)

#endif

#if USE_STRUCTURED_BUFFER_FOR_LIGHT_DATA
StructuredBuffer&lt;LightData> _AdditionalLightsBuffer;
StructuredBuffer&lt;int> _AdditionalLightsIndices;
#else
// GLES3 causes a performance regression in some devices when using CBUFFER.
#ifndef SHADER_API_GLES3
CBUFFER_START(AdditionalLights)
#endif
float4 _AdditionalLightsPosition[MAX_VISIBLE_LIGHTS];
// In Forward+, .a stores whether the light is using subtractive mixed mode.
half4 _AdditionalLightsColor[MAX_VISIBLE_LIGHTS];
half4 _AdditionalLightsAttenuation[MAX_VISIBLE_LIGHTS];
half4 _AdditionalLightsSpotDir[MAX_VISIBLE_LIGHTS];
half4 _AdditionalLightsOcclusionProbes[MAX_VISIBLE_LIGHTS];
float _AdditionalLightsLayerMasks[MAX_VISIBLE_LIGHTS]; // we want uint[] but Unity api does not support it.
#ifndef SHADER_API_GLES3
CBUFFER_END
#endif
#endif

#if USE_FORWARD_PLUS

CBUFFER_START(urp_ZBinBuffer)
        float4 urp_ZBins[MAX_ZBIN_VEC4S];
CBUFFER_END
CBUFFER_START(urp_TileBuffer)
        float4 urp_Tiles[MAX_TILE_VEC4S];
CBUFFER_END

TEXTURE2D(urp_ReflProbes_Atlas);
float urp_ReflProbes_Count;

// 2023.3 Deprecated. This is for backwards compatibility. Remove in the future.
#define samplerurp_ReflProbes_Atlas sampler_LinearClamp

#ifndef SHADER_API_GLES3
CBUFFER_START(urp_ReflectionProbeBuffer)
#endif
float4 urp_ReflProbes_BoxMax[MAX_REFLECTION_PROBES];          // w contains the blend distance
float4 urp_ReflProbes_BoxMin[MAX_REFLECTION_PROBES];          // w contains the importance
float4 urp_ReflProbes_ProbePosition[MAX_REFLECTION_PROBES];   // w is positive for box projection, |w| is max mip level
float4 urp_ReflProbes_MipScaleOffset[MAX_REFLECTION_PROBES * 7];
#ifndef SHADER_API_GLES3
CBUFFER_END
#endif

#endif

#define UNITY_MATRIX_M     unity_ObjectToWorld
#define UNITY_MATRIX_I_M   unity_WorldToObject
#define UNITY_MATRIX_V     unity_MatrixV
#define UNITY_MATRIX_I_V   unity_MatrixInvV
#define UNITY_MATRIX_P     OptimizeProjectionMatrix(glstate_matrix_projection)
#define UNITY_MATRIX_I_P   unity_MatrixInvP
#define UNITY_MATRIX_VP    unity_MatrixVP
#define UNITY_MATRIX_I_VP  unity_MatrixInvVP
#define UNITY_MATRIX_MV    mul(UNITY_MATRIX_V, UNITY_MATRIX_M)
#define UNITY_MATRIX_T_MV  transpose(UNITY_MATRIX_MV)
#define UNITY_MATRIX_IT_MV transpose(mul(UNITY_MATRIX_I_M, UNITY_MATRIX_I_V))
#define UNITY_MATRIX_MVP   mul(UNITY_MATRIX_VP, UNITY_MATRIX_M)
#define UNITY_PREV_MATRIX_M   unity_MatrixPreviousM
#define UNITY_PREV_MATRIX_I_M unity_MatrixPreviousMI

// Note: #include order is important here.
// UnityInput.hlsl must be included before UnityInstancing.hlsl, so constant buffer
// declarations don't fail because of instancing macros.
// UniversalDOTSInstancing.hlsl must be included after UnityInstancing.hlsl
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityInput.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UniversalDOTSInstancing.hlsl"

// VFX may also redefine UNITY_MATRIX_M / UNITY_MATRIX_I_M as static per-particle global matrices.
#ifdef HAVE_VFX_MODIFICATION
#include "Packages/com.unity.visualeffectgraph/Shaders/VFXMatricesOverride.hlsl"
#endif

#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/SpaceTransforms.hlsl"

#endif
</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">1. 헤더 정의 및 보호구문</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#ifndef UNIVERSAL_INPUT_INCLUDED
#define UNIVERSAL_INPUT_INCLUDED</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p>헤더 파일을 여러 번 포함하는 것을 방지</p>



<p><code>UNIVERSAL_INPUT_INCLUDED</code>가 정의되지 않은 경우에만 코드가 실행되도록 합니다.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">2. 패키지 및 설정 파일 포함</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#include "Packages/com.unity.render-pipelines.universal-config/Runtime/ShaderConfig.cs.hlsl"</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p>URP의 설정 및 구성을 정의하는 파일을 포함</p>



<p>이 파일에는 URP에서 사용하는 여러 가지 상수 값과 설정이 정의되어 있습니다.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">3. 최대 조명 및 타일링 설정</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#define MAX_VISIBLE_LIGHTS_UBO  32
#define MAX_VISIBLE_LIGHTS_SSBO 256</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p>UBO(Uniform Buffer Object)와 SSBO(Shader Storage Buffer Object)에 사용할 수 있는 최대 조명 개수를 정의</p>



<p>MAX_VISIBLE_LIGHTS_UBO: UBO 방식으로 사용할 수 있는 최대 조명 수 (32).</p>



<p>MAX_VISIBLE_LIGHTS_SSBO: SSBO 방식으로 사용할 수 있는 최대 조명 수 (256).</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">4. 조명 데이터 저장 방법 결정</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#define USE_STRUCTURED_BUFFER_FOR_LIGHT_DATA 0</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p>0으로 설정되어 있으며, 이는 <strong>Structured Buffer</strong>가 아닌 <strong>Constant Buffer</strong>를 사용하여 조명 데이터를 저장함을 의미합니다.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">5. 플랫폼에 따른 최대 조명 설정</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">// Must match: UniversalRenderPipeline.maxVisibleAdditionalLights
#if defined(SHADER_API_MOBILE) &amp;&amp; defined(SHADER_API_GLES30)
    #define MAX_VISIBLE_LIGHTS MAX_VISIBLE_LIGHT_COUNT_LOW_END_MOBILE
// WebGPU's minimal limits are based on mobile rather than desktop, so it will need to assume mobile.
#elif defined(SHADER_API_MOBILE) || (defined(SHADER_API_GLCORE) &amp;&amp; !defined(SHADER_API_SWITCH)) || defined(SHADER_API_GLES3) || defined(SHADER_API_WEBGPU) // Workaround because SHADER_API_GLCORE is also defined when SHADER_API_SWITCH is
    #define MAX_VISIBLE_LIGHTS MAX_VISIBLE_LIGHT_COUNT_MOBILE
#else
    #define MAX_VISIBLE_LIGHTS MAX_VISIBLE_LIGHT_COUNT_DESKTOP
#endif</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p><strong>플랫폼에 따라</strong> 최대 조명 수를 다르게 설정합니다. </p>



<p>모바일 플랫폼에서는 자원을 덜 사용하도록 제한을 두며, 데스크탑에서는 더 많은 조명을 허용합니다.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">6. 입력 데이터 구조체 (InputData)</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">struct InputData
{
    float3  positionWS;
    float4  positionCS;
    float3  normalWS;
    half3   viewDirectionWS;
    float4  shadowCoord;
    half    fogCoord;
    half3   vertexLighting;
    half3   bakedGI;
    float2  normalizedScreenSpaceUV;
    half4   shadowMask;
    half3x3 tangentToWorld;
};</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p><strong>InputData</strong> 구조체는 Shader에서 필요한 여러 데이터를 모아둔 것입니다.</p>



<ul class="wp-block-list">
<li><code>positionWS</code>: <strong>월드 좌표계에서의 정점 위치</strong>.</li>



<li><code>positionCS</code>: <strong>클립 좌표계에서의 정점 위치</strong>.</li>



<li><code>normalWS</code>: <strong>월드 좌표계에서의 법선 벡터</strong>.</li>



<li><code>viewDirectionWS</code>: <strong>월드 좌표계에서의 시선 방향</strong>.</li>



<li><code>shadowCoord</code>: <strong>그림자 좌표</strong>.</li>



<li><code>vertexLighting</code>: <strong>정점 기반의 조명</strong>.</li>



<li><code>bakedGI</code>: <strong>프리컴퓨티드 전역 조명</strong>.</li>



<li><code>normalizedScreenSpaceUV</code>: <strong>화면 공간 UV 좌표</strong>.</li>



<li><code>shadowMask</code>: <strong>그림자 마스크</strong>.</li>



<li><code>tangentToWorld</code>: <strong>탄젠트 공간에서 월드 공간으로 변환하는 행렬</strong>.</li>
</ul>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">7. 그 외 입력 구조체 (DEBUG_DISPLAY 포함)</h4>



<p><strong>DEBUG_DISPLAY</strong>가 정의되어 있는 경우 추가적인 디버그용 데이터를 받습니다.</p>



<ul class="wp-block-list">
<li>동적, 정적 라이트맵 UV 좌표, 텍스처 스트리밍 관련 정보 등을 포함합니다.</li>
</ul>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">8. 상수 버퍼 및 조명 데이터</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">half4 _GlossyEnvironmentColor;
half4 _SubtractiveShadowColor;
half4 _GlossyEnvironmentCubeMap_HDR;
TEXTURECUBE(_GlossyEnvironmentCubeMap);
SAMPLER(sampler_GlossyEnvironmentCubeMap);</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p>환경 반사, 그림자 색상, 큐브맵 반사 등과 관련된 상수 값들이 정의됩니다.</p>



<p><strong>텍스처</strong>와 <strong>샘플러</strong>도 정의됩니다.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">9. 주 조명 및 추가 조명 데이터</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">float4 _MainLightPosition;
half4 _MainLightColor;
float4 _AdditionalLightsPosition[MAX_VISIBLE_LIGHTS];
half4 _AdditionalLightsColor[MAX_VISIBLE_LIGHTS];</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p><strong>주 조명</strong>과 <strong>추가 조명</strong>에 대한 데이터를 저장합니다.</p>



<p>각 조명에 대해 위치, 색상, 감쇠(Attenuation), 스포트라이트 방향 등이 포함됩니다.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="751" height="700" src="https://lycos7560.com/wp-content/uploads/2024/09/image-14.png" alt="" class="wp-image-38309" srcset="https://lycos7560.com/wp-content/uploads/2024/09/image-14.png 751w, https://lycos7560.com/wp-content/uploads/2024/09/image-14-300x280.png 300w" sizes="(max-width: 751px) 100vw, 751px" /></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">10. 타일 기반 및 반사 프로브 처리 (Forward Plus)</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">CBUFFER_START(urp_TileBuffer)
    float4 urp_Tiles[MAX_TILE_VEC4S];
CBUFFER_END</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p><strong>타일 기반 조명 처리</strong> 및 <strong>반사 프로브</strong>에 대한 데이터를 정의합니다. </p>



<p>이는 Forward Plus 렌더링에서 사용됩니다.타일당 조명 수, 타일 크기, 반사 프로브의 위치 등을 정의합니다.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">11. 매트릭스 정의</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#define UNITY_MATRIX_M     unity_ObjectToWorld
#define UNITY_MATRIX_I_M   unity_WorldToObject</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p><strong>객체에서 월드로 변환하는 매트릭스</strong>와 <strong>반대로 월드에서 객체로 변환하는 매트릭스</strong> 등 다양한 매트릭스가 정의됩니다.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">12. 기타 패키지 포함</h4>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/UnityInput.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl"</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p>Unity의 인스턴싱 및 DOTS 관련 쉐이더 라이브러리를 포함하여 <strong>인스턴싱 처리</strong> 및 <strong>VFX 처리</strong> 관련 기능을 지원합니다.</p>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<p>이 코드는 <strong>Universal Render Pipeline</strong>에서 사용하는 다양한 <strong>조명</strong>, <strong>타일 기반 조명 처리</strong>, <strong>반사 처리</strong> 및 <strong>그림자 처리</strong>를 위한 입력 데이터를 처리하는 방법을 정의합니다.</p>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
<p>The post <a href="https://lycos7560.com/unity/unity-urp-input-hlsl/38299/">Unity URP Input.hlsl</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lycos7560.com/unity/unity-urp-input-hlsl/38299/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>URP_Unlit_Grayscale / Hue Shader &#8211; HLSL</title>
		<link>https://lycos7560.com/unity/urp_unlit_grayscale-hue-shader-hlsl/38278/</link>
					<comments>https://lycos7560.com/unity/urp_unlit_grayscale-hue-shader-hlsl/38278/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Sat, 07 Sep 2024 00:27:56 +0000</pubDate>
				<category><![CDATA[Unity]]></category>
		<category><![CDATA[UnityShader]]></category>
		<category><![CDATA[Fragment]]></category>
		<category><![CDATA[Grayscale]]></category>
		<category><![CDATA[HLSL]]></category>
		<category><![CDATA[HLSL Shader]]></category>
		<category><![CDATA[Hue]]></category>
		<category><![CDATA[Opaque]]></category>
		<category><![CDATA[Shader]]></category>
		<category><![CDATA[ShaderLab]]></category>
		<category><![CDATA[UniversalPipeline]]></category>
		<category><![CDATA[Unlit]]></category>
		<category><![CDATA[URP]]></category>
		<category><![CDATA[Vertex]]></category>
		<guid isPermaLink="false">https://lycos7560.com/?p=38278</guid>

					<description><![CDATA[<p>Grayscale_URP_Unlit.shader Grayscale 변환 원리 : 주어진 코드에서 색상을 흑백으로 변환하는 원리는 색상의 밝기(휘도, Luminance)를 계산하는 것에 기반합니다. 인간의 눈은 색상마다 민감도가 다르기 때문에, 각 RGB 채널에 가중치를 부여하여 밝기를 계산합니다. RGB를 Grayscale로 변환하는 원리 인간의 눈은 각각의 색상 성분(R, G, B)에 대해 감도가 다르다. 일반적으로 녹색(G) 성분에 가장 민감하고, 빨간색(R) 성분에 중간 정도로 민감하며, 파란색(B) [&#8230;]</p>
<p>The post <a href="https://lycos7560.com/unity/urp_unlit_grayscale-hue-shader-hlsl/38278/">URP_Unlit_Grayscale / Hue Shader &#8211; HLSL</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p><strong>Grayscale_URP_Unlit.shader</strong></p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Shader "Unlit/lycos/Grayscale_URP_Unlit"
{
    Properties
    {
        [MainTexture] _BaseMap("Texture", 2D) = "white" {}
        _GrayscaleIntensity("Grayscale Intensity", Range(0, 1)) = 1.0 // 흑백 효과 강도 (0: 원본 색상, 1: 완전 흑백)
    }
    SubShader
    {
        Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "RenderPipeline" = "UniversalPipeline" }

        Pass
        {
            Name  "Grayscale_URP_Unlit"
            Tags {"LightMode" = "SRPDefaultUnlit"} // 이 Pass는 Unlit(조명이 없는) 모드로 작동함을 선언

            HLSLPROGRAM
            #pragma target 4.5 // Shader 모델 4.5를 대상
            #pragma vertex vert // vertex shader 선언 (vert 함수)
            #pragma fragment frag // fragment shader 선언 (frag 함수)
            #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
            // Constant Buffer 
            // Unity의 각 Material 상수를 정의
            CBUFFER_START(UnityPerMaterial) 
                float4 _BaseMap_ST; // TEXTURE UV 좌표 변환에 사용되는 정보 (offset, tiling)
                float _GrayscaleIntensity; // 흑백 효과 강도
            CBUFFER_END
            TEXTURE2D(_BaseMap);  // TEXTURE2D 선언
            SAMPLER(sampler_BaseMap); // SAMPLER 선언
            // vertex shader의 입력 구조체 
            struct Attributes
            {
                float4 positionOS : POSITION;  // 모델 공간에서의 정점 위치 (float3, float4)
                float2 uv : TEXCOORD0;   // 첫 번째 UV 텍스처 좌표 (float2, float3, float4)
                float4 color : COLOR;  // 정점 별 색상  (float4)
            };
            // Varyings 구조체 정의
            // 출력 구조체로, fragment Shader에서 사용할 데이터(예: 변환된 위치, UV 좌표 등)를 포함
            struct Varyings
            {
                float4 positionCS : SV_POSITION;
                float2 uv : TEXCOORD0;
                float4 color : COLOR;
            };
            // vertex shader가 Attributes를 사용
            Varyings vert(Attributes input)
            {
                // 출력 변수를 정의
                Varyings output = (Varyings)0; // Varyings 초기화, 모든 필드에 기본값을 할당
                float4 positionOS = input.positionOS; // 모델 공간에서의 정점 위치를 float4 형태로 저장
                float3 positionWS = TransformObjectToWorld(positionOS.xyz); // 모델 공간에서 월드 공간으로의 변환을 수행
                float4 positionCS = TransformWorldToHClip(positionWS); // 월드 공간에서 클립 공간으로의 변환을 수행
                output.positionCS = positionCS; // 변환된 클립 공간 위치를 출력 구조체 output에 저장
                output.uv = input.uv; // 입력으로 받은 UV 좌표를 출력 구조체 output에 저장
                output.color = input.color;
                return output;
            }
            // 프래그먼트 셰이더(fragment shader) 
            // 픽셀 단위로 호출되며, 각 픽셀의 최종 색상을 계산해 화면에 출력
            // 기본적으로 입력된 UV 좌표를 이용해 텍스처 색상을 샘플링하고, 
            // 최종적으로 머티리얼의 색상과 결합하여 픽셀의 색상을 반환하는 역할
            float4 frag(Varyings input) : SV_Target
            {
                // UV 좌표 변환을 위한 계산
                float2 baseMapUV = input.uv.xy * _BaseMap_ST.xy + _BaseMap_ST.zw;
                // SAMPLE_TEXTURE2D 함수를 사용하여 텍스처를 샘플링합니다.
                float4 texColor = SAMPLE_TEXTURE2D(_BaseMap, sampler_BaseMap, baseMapUV);
                // Grayscale 변환
                float gray = dot(texColor.rgb, float3(0.299, 0.587, 0.114));
                // 흑백 효과의 강도를 적용
                // lerp 함수를 사용하여 texColor와 변환된 흑백 색상 사이에서 _GrayscaleIntensity 값을 기반으로 색상을 보간합니다.
                float4 finalColor = lerp(texColor, float4(gray, gray, gray, texColor.a), _GrayscaleIntensity);

                // 최종 계산된 색상을 출력합니다. SV_Target은 이 값이 픽셀 셰이더의 출력으로 화면에 렌더링된다는 것을 의미합니다.
                return finalColor;
            }
            ENDHLSL
        }
    }
}
</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-video"><video height="1440" style="aspect-ratio: 2560 / 1440;" width="2560" controls muted src="https://lycos7560.com/wp-content/uploads/2024/09/녹화_2024_09_07_09_00_02_758.mp4"></video></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">Grayscale 변환 원리 :</h2>



<p>주어진 코드에서 색상을 흑백으로 변환하는 원리는 색상의 밝기(휘도, Luminance)를 계산하는 것에 기반합니다. </p>



<p>인간의 눈은 색상마다 민감도가 다르기 때문에, 각 RGB 채널에 가중치를 부여하여 밝기를 계산합니다.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">// Grayscale 변환
float gray = dot(texColor.rgb, float3(0.299, 0.587, 0.114));
</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">RGB를 Grayscale로 변환하는 원리</h3>



<p>인간의 눈은 각각의 색상 성분(R, G, B)에 대해 감도가 다르다.</p>



<p>일반적으로 <strong>녹색(G)</strong> 성분에 가장 민감하고, <strong>빨간색(R)</strong> 성분에 중간 정도로 민감하며, <strong>파란색(B)</strong> 성분에 가장 덜 민감하다. </p>



<p>따라서, 각 색상 성분에 적절한 가중치를 부여하여 이를 반영한 값을 계산해야 더 자연스러운 Grayscale 변환이 된다.</p>



<p>그래서 RGB 값에서 <strong>Grayscale</strong> 값을 구하는 공식은 각 성분의 가중치를 적용한 합으로 나타낸다.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="385" height="40" src="https://lycos7560.com/wp-content/uploads/2024/09/image-7.png" alt="" class="wp-image-38284" srcset="https://lycos7560.com/wp-content/uploads/2024/09/image-7.png 385w, https://lycos7560.com/wp-content/uploads/2024/09/image-7-300x31.png 300w" sizes="(max-width: 385px) 100vw, 385px" /></figure>



<p>이 가중치는 인간의 시각적 감도를 반영한 표준 가중치라고 할 수 있다.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">내적(Dot Product) 사용 이유</h3>



<p>내적은 두 벡터 간의 대응되는 성분을 곱한 후 더하는 연산입니다. </p>



<p>RGB 값을 각각의 가중치와 곱한 후 더하는 이 과정을 <strong>내적</strong>을 통해 쉽게 계산할 수 있습니다. </p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">float gray = dot(texColor.rgb, float3(0.299, 0.587, 0.114));</pre>



<p>이 공식을 내적 연산을 사용하여 간결하게 표현한 것입니다.</p>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<p><strong>HueAdjustment_URP_Unlit.shader</strong></p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Shader "Unlit/lycos/HueAdjustment_URP_Unlit"
{
    Properties
    {
        [MainTexture] _BaseMap("Texture", 2D) = "white" {} // 기본 텍스처
        _HueAdjustment("Hue Adjustment", Range(-1, 1)) = 0.0 // 색조 조정 값 (-1: -180도, 1: 180도)
    }
    SubShader
    {
        Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "RenderPipeline" = "UniversalPipeline" }

        Pass
        {
            Name  "HueAdjustment_URP_Unlit"
            Tags {"LightMode" = "SRPDefaultUnlit"} // 이 Pass는 Unlit(조명이 없는) 모드로 작동함을 선언

            HLSLPROGRAM
            #pragma target 4.5 // Shader 모델 4.5를 대상으로 함
            #pragma vertex vert // vertex shader 선언
            #pragma fragment frag // fragment shader 선언
            #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"

            // Constant Buffer
            // Unity의 각 Material 상수를 정의
            CBUFFER_START(UnityPerMaterial) 
                float4 _BaseMap_ST; // 텍스처의 UV 좌표 변환 정보 (offset, tiling)
                float _HueAdjustment; // 색조 조정 값
            CBUFFER_END

            TEXTURE2D(_BaseMap);  // 텍스처 선언
            SAMPLER(sampler_BaseMap); // 샘플러 선언

            // Vertex Shader의 입력 구조체
            struct Attributes
            {
                float4 positionOS : POSITION;  // 모델 공간에서의 정점 위치
                float2 uv : TEXCOORD0;   // UV 텍스처 좌표
                float4 color : COLOR;  // 정점 색상
            };

            // Varyings 구조체 정의
            // Fragment Shader에서 사용할 데이터(예: 변환된 위치, UV 좌표 등)를 포함
            struct Varyings
            {
                float4 positionCS : SV_POSITION; // 클립 공간에서의 정점 위치
                float2 uv : TEXCOORD0; // UV 좌표
                float4 color : COLOR; // 색상
            };

            // Vertex Shader
            Varyings vert(Attributes input)
            {
                Varyings output = (Varyings)0; // Varyings 초기화
                float4 positionOS = input.positionOS; // 모델 공간에서의 정점 위치 저장
                float3 positionWS = TransformObjectToWorld(positionOS.xyz); // 모델 공간에서 월드 공간으로 변환
                float4 positionCS = TransformWorldToHClip(positionWS); // 월드 공간에서 클립 공간으로 변환
                output.positionCS = positionCS; // 변환된 클립 공간 위치 저장
                output.uv = input.uv; // UV 좌표 저장
                output.color = input.color; // 색상 저장
                return output;
            }

            float3 ApplyHue(float3 col, float hueAdjust)
            {
                // RGB 색상을 HSV 색상 공간으로 변환
                float4 K = float4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
                float4 P = lerp(float4(col.bg, K.wz), float4(col.gb, K.xy), step(col.b, col.g));
                float4 Q = lerp(float4(P.xyw, col.r), float4(col.r, P.yzx), step(P.x, col.r));
                float D = Q.x - min(Q.w, Q.y);
                float E = 1e-10; // 작은 값 추가
                float3 hsv = float3(abs(Q.z + (Q.w - Q.y)/(6.0 * D + E)), D / (Q.x + E), Q.x);

                // 색조 조정
                float hue = hsv.x + hueAdjust;
                hsv.x = (hue &lt; 0)
                        ? hue + 1
                        : (hue > 1)
                            ? hue - 1
                            : hue;

                // HSV 색상을 RGB 색상으로 변환
                float4 K2 = float4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
                float3 P2 = abs(frac(hsv.xxx + K2.xyz) * 6.0 - K2.www);
                float3 result = hsv.z * lerp(K2.xxx, saturate(P2 - K2.xxx), hsv.y);
                return result;
            }

            // Fragment Shader
            float4 frag(Varyings input) : SV_Target
            {
                // UV 좌표 변환
                float2 baseMapUV = input.uv.xy * _BaseMap_ST.xy + _BaseMap_ST.zw;
                // 텍스처 샘플링
                float4 texColor = SAMPLE_TEXTURE2D(_BaseMap, sampler_BaseMap, baseMapUV);
                // 색조 조정
                float3 hueAdjustedColor = ApplyHue(texColor.rgb, _HueAdjustment);
                // 최종 색상 반환
                float4 finalColor = float4(hueAdjustedColor, texColor.a);

                // 최종 계산된 색상을 출력
                return finalColor;
            }
            ENDHLSL
        }
    }
}
</pre>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-video"><video height="1440" style="aspect-ratio: 2560 / 1440;" width="2560" controls muted src="https://lycos7560.com/wp-content/uploads/2024/09/녹화_2024_09_07_09_24_17_343.mp4"></video></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">1. RGB to HSV 변환 (RGB 색상을 HSV 색상 공간으로 변환)</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">float4 K = float4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
float4 P = lerp(float4(col.bg, K.wz), float4(col.gb, K.xy), step(col.b, col.g));
float4 Q = lerp(float4(P.xyw, col.r), float4(col.r, P.yzx), step(P.x, col.r));
float D = Q.x - min(Q.w, Q.y);
float E = 1e-10; // 작은 값 추가
float3 hsv = float3(abs(Q.z + (Q.w - Q.y) / (6.0 * D + E)), D / (Q.x + E), Q.x);</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p><strong>입력 변수</strong>: <code>col</code>은 RGB 색상을 나타내는 <code>float3</code> 값입니다. 이 색상을 HSV로 변환하는 과정입니다.</p>



<p><code>K</code>: 색상 변환에 필요한 상수 값입니다. 다양한 색상 조합을 비교할 때 사용됩니다.</p>



<p><code>P</code>, <code>Q</code>: <code>lerp</code>(선형 보간) 함수와 <code>step</code> 함수를 사용하여 색상 성분을 비교하고 보간합니다. 이를 통해 RGB에서 가장 큰 값과 작은 값을 찾고, 색상 성분을 적절히 섞어 색상 차이 <code>D</code>와 관련된 값을 계산합니다.</p>



<p><code>D</code>: RGB 색상의 최댓값과 최솟값의 차이를 나타내며, 이것은 채도(Saturation)를 결정하는 값입니다.</p>



<p><code>hsv.x</code>: 색상(Hue)을 계산하기 위한 값입니다. RGB에서 Hue는 특정 범위의 계산을 통해 구해지며, 이 값은 색상 톤을 나타냅니다.</p>



<p><code>hsv.y</code>: 채도(Saturation)를 계산한 값입니다. </p>



<p><code>D</code>를 RGB에서의 최댓값과 나누어 채도를 구합니다.</p>



<p><code>hsv.z</code>: 명도(Value)로, RGB 색상에서의 최댓값이 됩니다.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">2. 색조 조정 (Hue Shift)</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">float hue = hsv.x + hueAdjust;
hsv.x = (hue &lt; 0) ? hue + 1 : (hue > 1) ? hue - 1 : hue;</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p><code>hueAdjust</code>: 함수의 인자로 전달된 <strong>색조 변경 값</strong>입니다.</p>



<p><code>hsv.x + hueAdjust</code>: 기존의 색조에 새로운 색조 조정 값을 더해 색조를 변경합니다.</p>



<p><code>hsv.x</code>: Hue는 0에서 1 사이의 값으로 표현되므로, <code>hue</code> 값이 0보다 작으면 1을 더하고, 1보다 크면 1을 빼서 순환시킵니다. 이는 색조의 값을 항상 0~1 범위 내에 유지시키기 위한 작업입니다.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">3. HSV to RGB 변환 (HSV를 다시 RGB로 변환)</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">float4 K2 = float4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
float3 P2 = abs(frac(hsv.xxx + K2.xyz) * 6.0 - K2.www);
float3 result = hsv.z * lerp(K2.xxx, saturate(P2 - K2.xxx), hsv.y);
</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p><code>K2</code>: HSV에서 RGB로 변환할 때 사용되는 상수 값입니다.</p>



<p><code>frac(hsv.xxx + K2.xyz)</code>: 이 계산을 통해 <code>hsv.x</code>에 기반한 색상 조합을 생성합니다.</p>



<p><code>P2</code>: 색상을 변환할 때 필요한 중간 계산으로, 색조(Hue) 정보를 바탕으로 RGB로 변환하는데 필요한 보간을 수행합니다.</p>



<p><code>lerp</code>: 보간을 사용하여 최종 RGB 값에 대한 보정을 수행합니다. <code>hsv.y</code>는 채도, <code>hsv.z</code>는 명도에 해당하는 값을 적용하여 최종적인 색상 값을 구합니다.</p>



<p><code>result</code>: 변환된 최종 <strong>RGB 값</strong>입니다.</p>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<p></p>



<p></p>
<p>The post <a href="https://lycos7560.com/unity/urp_unlit_grayscale-hue-shader-hlsl/38278/">URP_Unlit_Grayscale / Hue Shader &#8211; HLSL</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lycos7560.com/unity/urp_unlit_grayscale-hue-shader-hlsl/38278/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		<enclosure url="https://lycos7560.com/wp-content/uploads/2024/09/녹화_2024_09_07_09_00_02_758.mp4" length="1791108" type="video/mp4" />
<enclosure url="https://lycos7560.com/wp-content/uploads/2024/09/녹화_2024_09_07_09_24_17_343.mp4" length="2780514" type="video/mp4" />

			</item>
		<item>
		<title>Unity Urp Shader Vertex, Attributes, fragment  Unlit 예시</title>
		<link>https://lycos7560.com/unity/unity-urp-shader-vertex-attributes-struct-%ec%98%88%ec%8b%9c/38254/</link>
					<comments>https://lycos7560.com/unity/unity-urp-shader-vertex-attributes-struct-%ec%98%88%ec%8b%9c/38254/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Fri, 06 Sep 2024 04:31:28 +0000</pubDate>
				<category><![CDATA[Unity]]></category>
		<category><![CDATA[UnityShader]]></category>
		<category><![CDATA[Attributes]]></category>
		<category><![CDATA[Core]]></category>
		<category><![CDATA[Core.hlsl]]></category>
		<category><![CDATA[Fragment]]></category>
		<category><![CDATA[positionCS]]></category>
		<category><![CDATA[positionOS]]></category>
		<category><![CDATA[Shader]]></category>
		<category><![CDATA[SpaceTransforms]]></category>
		<category><![CDATA[struct]]></category>
		<category><![CDATA[TransformObjectToWorld]]></category>
		<category><![CDATA[TransformWorldToView]]></category>
		<category><![CDATA[Unlit]]></category>
		<category><![CDATA[URP]]></category>
		<category><![CDATA[URP SHADER]]></category>
		<category><![CDATA[Varyings]]></category>
		<category><![CDATA[Vertex]]></category>
		<guid isPermaLink="false">https://lycos7560.com/?p=38254</guid>

					<description><![CDATA[<p>&#8220;Unlit/URP_UnlitBase&#8220; 참고 &#8220;Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl&#8220; &#8220;Packages/com.unity.render-pipelines.core/ShaderLibrary/SpaceTransforms.hlsl&#8221;</p>
<p>The post <a href="https://lycos7560.com/unity/unity-urp-shader-vertex-attributes-struct-%ec%98%88%ec%8b%9c/38254/">Unity Urp Shader Vertex, Attributes, fragment  Unlit 예시</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>&#8220;<strong>Unlit/URP_UnlitBase</strong>&#8220;</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Shader "URP/Unlit/URP_UnlitBase"
{
    Properties
    {
        [MainTexture] _BaseMap("Texture", 2D) = "white" {}
        [MainColor] _BaseColor("Color", Color) = (1, 1, 1, 1)
    }

        SubShader
        {
            Tags { "RenderType" = "Opaque" "Queue" = "Geometry" "RenderPipeline" = "UniversalPipeline" }
            LOD 100

            Pass
            {
                Name  "URP_UnlitBase"
                Tags {"LightMode" = "SRPDefaultUnlit"} // 이 Pass는 Unlit(조명이 없는) 모드로 작동함을 선언

                HLSLPROGRAM
                #pragma target 4.5 // Shader 모델 4.5를 대상

                // vertex shader 선언 (vert 함수)
                // vert라는 이름의 함수를 vertex shader로 사용 선언
                // vert는 입력으로 Attributes 구조체를 받고, 처리된 결과를 반환
                #pragma vertex vert // vertex shader 선언 (vert 함수)
                #pragma fragment frag // fragment shader 선언 (frag 함수)

                #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"

                // Constant Buffer 
                // Unity의 각 Material 상수를 정의
                CBUFFER_START(UnityPerMaterial) 
                    float4 _BaseMap_ST; // TEXTURE UV 좌표 변환에 사용되는 정보 (offset, tiling)
                    float4 _BaseColor; // 설정 색상
                CBUFFER_END

                TEXTURE2D(_BaseMap);  // TEXTURE2D 선언
                SAMPLER(sampler_BaseMap); // SAMPLER 선언

                // vertex shader의 입력 구조체 
                struct Attributes
                {
                    float4 positionOS : POSITION;  // 모델 공간에서의 정점 위치 (float3, float4)
                    float3 normalOS : NORMAL;  // 모델 공간에서의 정점 법선 (float3)
                    float2 uv : TEXCOORD0;   // 첫 번째 UV 텍스처 좌표 (float2, float3, float4)
                    float2 uv2 : TEXCOORD1;  // 두 번째 UV 텍스처 좌표 (float2, float3, float4)
                    float2 uv3 : TEXCOORD2;  // 세 번째 UV 텍스처 좌표 (float2, float3, float4)
                    float2 uv4 : TEXCOORD3;  // 넷 번째 UV 텍스처 좌표 (float2, float3, float4)
                    float4 tangentOS : TANGENT;  // 모델 공간에서의 접선 벡터 (normal mapping에 사용)
                    float4 color : COLOR;  // 정점 별 색상  (float4)
                    int4 blendIndices : BLENDINDICES;  // 스킨 매싱에서 뼈대 인덱스
                };

                // Varyings 구조체 정의
                // 출력 구조체로, fragment Shader에서 사용할 데이터(예: 변환된 위치, UV 좌표 등)를 포함
                struct Varyings
                {
                    float4 positionCS : SV_POSITION;
                    float2 uv : TEXCOORD0;
                    float4 color : COLOR;
                };


                // vertex shader가 Attributes를 사용
                Varyings vert(Attributes input)
                {
                    // 출력 변수를 정의
                    Varyings output = (Varyings)0; // Varyings 초기화, 모든 필드에 기본값을 할당

                    // 모델 공간에서의 정점 위치를 float4 형태로 저장
                    float4 positionOS = input.positionOS;

                    // 모델 공간에서 월드 공간으로의 변환을 수행
                    float3 positionWS = TransformObjectToWorld(positionOS.xyz);

                    // 월드 공간에서 뷰 공간으로의 변환을 수행
                    float3 positionVS = TransformWorldToView(positionWS);

                    // 월드 공간에서 클립 공간으로의 변환을 수행
                    // 클립 공간 : 렌더링 파이프라인에서 최종적으로 화면에 출력될 좌표계
                    float4 positionCS = TransformWorldToHClip(positionWS);

                    // 변환된 클립 공간 위치를 출력 구조체 output에 저장
                    output.positionCS = positionCS;
                    // 입력으로 받은 UV 좌표를 출력 구조체 output에 저장
                    output.uv = input.uv;
                    output.color = input.color;

                    return output;
                }

                // 프래그먼트 셰이더(fragment shader) 
                // 픽셀 단위로 호출되며, 각 픽셀의 최종 색상을 계산해 화면에 출력
                // 기본적으로 입력된 UV 좌표를 이용해 텍스처 색상을 샘플링하고, 
                // 최종적으로 머티리얼의 색상과 결합하여 픽셀의 색상을 반환하는 역할
                float4 frag(Varyings input) : SV_Target
                {
                    // UV 좌표 변환을 위한 계산
                    // input.uv.xy는 입력된 UV 좌표이며, _BaseMap_ST.xy는 텍스처 타일링(scale)을 나타내고,
                    // _BaseMap_ST.zw는 오프셋을 나타냅니다.
                    // 따라서, 기본 UV 좌표에 타일링 및 오프셋을 적용하여 최종적으로 텍스처 좌표를 결정합니다.
                    float2 baseMapUV = input.uv.xy * _BaseMap_ST.xy + _BaseMap_ST.zw;

                    // SAMPLE_TEXTURE2D 함수를 사용하여 텍스처를 샘플링합니다.
                    // _BaseMap은 텍스처 리소스, sampler_BaseMap은 해당 텍스처를 샘플링하는 샘플러입니다.
                    // baseMapUV는 변환된 UV 좌표입니다.
                    // 이 과정에서 지정된 텍스처 좌표를 기준으로 텍스처 색상을 가져옵니다.
                    float4 texColor = SAMPLE_TEXTURE2D(_BaseMap, sampler_BaseMap, baseMapUV);

                    // 텍스처 색상과 기본 색상을 곱하여 최종 색상을 계산합니다.
                    // _BaseColor는 머티리얼에서 설정된 색상이며, 이를 텍스처 샘플링 결과와 곱하여 결과적으로
                    // 텍스처와 색상이 결합된 최종 색상을 생성합니다.
                    float4 finalColor = texColor * _BaseColor;

                    // 최종 계산된 색상을 출력합니다. SV_Target은 이 값이 픽셀 셰이더의 출력으로 화면에 렌더링된다는 것을 의미합니다.
                    return finalColor;
                }

                ENDHLSL
            }
        }
}
</pre>



<p></p>



<p></p>



<h2 class="wp-block-heading">참고</h2>



<p>&#8220;<strong>Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl</strong>&#8220;</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#ifndef UNIVERSAL_PIPELINE_CORE_INCLUDED
#define UNIVERSAL_PIPELINE_CORE_INCLUDED

// 현재 URP에서는 가상 텍스처링(Virtual Texturing)을 지원하지 않으므로,
// 가상 텍스처링을 사용하는 셰이더가 일반 텍스처 샘플링으로 대체되도록 강제합니다.
#define FORCE_VIRTUAL_TEXTURING_OFF 1

// 포워드 플러스(Forward+) 렌더링이 활성화된 경우와 그렇지 않은 경우에 따라
// 추가 조명을 지원하는지 여부와 포워드 플러스 사용 여부를 설정합니다.
#if defined(_FORWARD_PLUS)
#define _ADDITIONAL_LIGHTS 1
#undef _ADDITIONAL_LIGHTS_VERTEX
#define USE_FORWARD_PLUS 1
#else
#define USE_FORWARD_PLUS 0
#endif

// URP와 관련된 공통 헤더 파일들을 포함합니다.
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Packing.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Version.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Input.hlsl"

// Z-버퍼의 방향과 관련된 매크로 정의
#if UNITY_REVERSED_Z
    // Z-버퍼가 반전된 경우에 대한 처리입니다. 
    // GL과 D3D의 경우 Z-값의 클립 범위를 조정합니다.
    #if (defined(SHADER_API_GLCORE) &amp;&amp; !defined(SHADER_API_SWITCH)) || defined(SHADER_API_GLES) || defined(SHADER_API_GLES3)
        // GL에서는 Z-클립 범위가 [near, -far]이므로, 이를 [0, far]로 변환합니다.
        #define UNITY_Z_0_FAR_FROM_CLIPSPACE(coord) max((coord - _ProjectionParams.y)/(-_ProjectionParams.z-_ProjectionParams.y)*_ProjectionParams.z, 0)
    #else
        // D3D에서는 Z-클립 범위가 [near, 0]이므로, 이를 [0, far]로 변환합니다.
        // max를 사용하는 것은 경사 행렬의 경우 근접 평면이 올바르지 않거나 의미가 없을 때를 대비합니다.
        #define UNITY_Z_0_FAR_FROM_CLIPSPACE(coord) max(((1.0-(coord)/_ProjectionParams.y)*_ProjectionParams.z),0)
    #endif
#elif UNITY_UV_STARTS_AT_TOP
    // D3D에서는 Z-클립 범위가 [0, far]이므로, 추가적인 변환이 필요하지 않습니다.
    #define UNITY_Z_0_FAR_FROM_CLIPSPACE(coord) (coord)
#else
    // OpenGL에서는 Z-클립 범위가 [-near, far]이므로, 이를 [0, far]로 변환합니다.
    #define UNITY_Z_0_FAR_FROM_CLIPSPACE(coord) max(((coord + _ProjectionParams.y)/(_ProjectionParams.z+_ProjectionParams.y))*_ProjectionParams.z, 0)
#endif

// 스테레오 렌더링 관련 매크로 정의
#if defined(UNITY_STEREO_INSTANCING_ENABLED) || defined(UNITY_STEREO_MULTIVIEW_ENABLED)
    // 스테레오 렌더링이 활성화된 경우, 텍스처를 배열로 처리합니다.
    #define SLICE_ARRAY_INDEX   unity_StereoEyeIndex

    // 스테레오 렌더링 시 사용하는 텍스처 배열 매크로 정의
    #define TEXTURE2D_X(textureName)                                        TEXTURE2D_ARRAY(textureName)
    #define TEXTURE2D_X_PARAM(textureName, samplerName)                     TEXTURE2D_ARRAY_PARAM(textureName, samplerName)
    #define TEXTURE2D_X_ARGS(textureName, samplerName)                      TEXTURE2D_ARRAY_ARGS(textureName, samplerName)
    #define TEXTURE2D_X_HALF(textureName)                                   TEXTURE2D_ARRAY_HALF(textureName)
    #define TEXTURE2D_X_FLOAT(textureName)                                  TEXTURE2D_ARRAY_FLOAT(textureName)

    #define LOAD_TEXTURE2D_X(textureName, unCoord2)                         LOAD_TEXTURE2D_ARRAY(textureName, unCoord2, SLICE_ARRAY_INDEX)
    #define LOAD_TEXTURE2D_X_LOD(textureName, unCoord2, lod)                LOAD_TEXTURE2D_ARRAY_LOD(textureName, unCoord2, SLICE_ARRAY_INDEX, lod)
    #define SAMPLE_TEXTURE2D_X(textureName, samplerName, coord2)            SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, SLICE_ARRAY_INDEX)
    #define SAMPLE_TEXTURE2D_X_LOD(textureName, samplerName, coord2, lod)   SAMPLE_TEXTURE2D_ARRAY_LOD(textureName, samplerName, coord2, SLICE_ARRAY_INDEX, lod)
    #define GATHER_TEXTURE2D_X(textureName, samplerName, coord2)            GATHER_TEXTURE2D_ARRAY(textureName, samplerName, coord2, SLICE_ARRAY_INDEX)
    #define GATHER_RED_TEXTURE2D_X(textureName, samplerName, coord2)        GATHER_RED_TEXTURE2D(textureName, samplerName, float3(coord2, SLICE_ARRAY_INDEX))
    #define GATHER_GREEN_TEXTURE2D_X(textureName, samplerName, coord2)      GATHER_GREEN_TEXTURE2D(textureName, samplerName, float3(coord2, SLICE_ARRAY_INDEX))
    #define GATHER_BLUE_TEXTURE2D_X(textureName, samplerName, coord2)       GATHER_BLUE_TEXTURE2D(textureName, samplerName, float3(coord2, SLICE_ARRAY_INDEX))

#else
    // 스테레오 렌더링이 비활성화된 경우, 일반적인 2D 텍스처 샘플링 매크로 정의
    #define SLICE_ARRAY_INDEX       0

    #define TEXTURE2D_X(textureName)                                        TEXTURE2D(textureName)
    #define TEXTURE2D_X_PARAM(textureName, samplerName)                     TEXTURE2D_PARAM(textureName, samplerName)
    #define TEXTURE2D_X_ARGS(textureName, samplerName)                      TEXTURE2D_ARGS(textureName, samplerName)
    #define TEXTURE2D_X_HALF(textureName)                                   TEXTURE2D_HALF(textureName)
    #define TEXTURE2D_X_FLOAT(textureName)                                  TEXTURE2D_FLOAT(textureName)

    #define LOAD_TEXTURE2D_X(textureName, unCoord2)                         LOAD_TEXTURE2D(textureName, unCoord2)
    #define LOAD_TEXTURE2D_X_LOD(textureName, unCoord2, lod)                LOAD_TEXTURE2D_LOD(textureName, unCoord2, lod)
    #define SAMPLE_TEXTURE2D_X(textureName, samplerName, coord2)            SAMPLE_TEXTURE2D(textureName, samplerName, coord2)
    #define SAMPLE_TEXTURE2D_X_LOD(textureName, samplerName, coord2, lod)   SAMPLE_TEXTURE2D_LOD(textureName, samplerName, coord2, lod)
    #define GATHER_TEXTURE2D_X(textureName, samplerName, coord2)            GATHER_TEXTURE2D(textureName, samplerName, coord2)
    #define GATHER_RED_TEXTURE2D_X(textureName, samplerName, coord2)        GATHER_RED_TEXTURE2D(textureName, samplerName, coord2)
    #define GATHER_GREEN_TEXTURE2D_X(textureName, samplerName, coord2)      GATHER_GREEN_TEXTURE2D(textureName, samplerName, coord2)
    #define GATHER_BLUE_TEXTURE2D_X(textureName, samplerName, coord2)       GATHER_BLUE_TEXTURE2D(textureName, samplerName, coord2)
#endif

///
/// 텍스처 샘플링 매크로 오버라이드: 스케일링 지원
///
/// mip bias가 지원되는 플랫폼에서는 모든 2D 텍스처 샘플링 작업을 글로벌 mip bias 기능을 지원하도록 재정의합니다.
/// 이 기능은 이미지 스케일링이 활성화된 경우 렌더링 품질을 향상시키기 위해 사용됩니다.
/// 최종 이미지 해상도에 따라 mip 레벨을 선택할 수 있도록 mip lod 계산에 bias 값을 추가합니다.

#ifdef PLATFORM_SAMPLE_TEXTURE2D_BIAS
    #ifdef  SAMPLE_TEXTURE2D
        #undef  SAMPLE_TEXTURE2D
        #define SAMPLE_TEXTURE2D(textureName, samplerName, coord2) \
            PLATFORM_SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2,  _GlobalMipBias.x)
    #endif
    #ifdef  SAMPLE_TEXTURE2D_BIAS
        #undef  SAMPLE_TEXTURE2D_BIAS
        #define SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2, bias) \
            PLATFORM_SAMPLE_TEXTURE2D_BIAS(textureName, samplerName, coord2,  (bias + _GlobalMipBias.x))
    #endif
#endif

#ifdef PLATFORM_SAMPLE_TEXTURE2D_GRAD
    #ifdef  SAMPLE_TEXTURE2D_GRAD
        #undef  SAMPLE_TEXTURE2D_GRAD
        #define SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, dpdx, dpdy) \
            PLATFORM_SAMPLE_TEXTURE2D_GRAD(textureName, samplerName, coord2, (dpdx * _GlobalMipBias.y), (dpdy * _GlobalMipBias.y))
    #endif
#endif

#ifdef PLATFORM_SAMPLE_TEXTURE2D_ARRAY_BIAS
    #ifdef  SAMPLE_TEXTURE2D_ARRAY
        #undef  SAMPLE_TEXTURE2D_ARRAY
        #define SAMPLE_TEXTURE2D_ARRAY(textureName, samplerName, coord2, index) \
            PLATFORM_SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, _GlobalMipBias.x)
    #endif
    #ifdef  SAMPLE_TEXTURE2D_ARRAY_BIAS
        #undef  SAMPLE_TEXTURE2D_ARRAY_BIAS
        #define SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, bias) \
            PLATFORM_SAMPLE_TEXTURE2D_ARRAY_BIAS(textureName, samplerName, coord2, index, (bias + _GlobalMipBias.x))
    #endif
#endif

#ifdef PLATFORM_SAMPLE_TEXTURECUBE_BIAS
    #ifdef  SAMPLE_TEXTURECUBE
        #undef  SAMPLE_TEXTURECUBE
        #define SAMPLE_TEXTURECUBE(textureName, samplerName, coord3) \
            PLATFORM_SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, _GlobalMipBias.x)
    #endif
    #ifdef  SAMPLE_TEXTURECUBE_BIAS
        #undef  SAMPLE_TEXTURECUBE_BIAS
        #define SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, bias) \
            PLATFORM_SAMPLE_TEXTURECUBE_BIAS(textureName, samplerName, coord3, (bias + _GlobalMipBias.x))
    #endif
#endif

#ifdef PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_BIAS
    #ifdef  SAMPLE_TEXTURECUBE_ARRAY
        #undef  SAMPLE_TEXTURECUBE_ARRAY
        #define SAMPLE_TEXTURECUBE_ARRAY(textureName, samplerName, coord3, index)\
            PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, _GlobalMipBias.x)
    #endif

    #ifdef  SAMPLE_TEXTURECUBE_ARRAY_BIAS
        #undef  SAMPLE_TEXTURECUBE_ARRAY_BIAS
        #define SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, bias)\
            PLATFORM_SAMPLE_TEXTURECUBE_ARRAY_BIAS(textureName, samplerName, coord3, index, (bias + _GlobalMipBias.x))
    #endif
#endif

// 글로벌 mip bias 곱셈기
#define VT_GLOBAL_MIP_BIAS_MULTIPLIER (_GlobalMipBias.y)

// 구조체 정의
// 정점의 위치 정보를 담는 구조체입니다.
struct VertexPositionInputs
{
    float3 positionWS; // 월드 공간에서의 위치
    float3 positionVS; // 뷰 공간에서의 위치
    float4 positionCS; // 동차 클립 공간에서의 위치
    float4 positionNDC;// 동차 정규화된 장치 좌표
};

// 정점의 법선 정보를 담는 구조체입니다.
struct VertexNormalInputs
{
    real3 tangentWS;   // 월드 공간에서의 탄젠트 벡터
    real3 bitangentWS; // 월드 공간에서의 비탄젠트 벡터
    float3 normalWS;   // 월드 공간에서의 법선 벡터
}

// 추가적인 셰이더 변수와 함수 정의를 포함한 헤더 파일들
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/ShaderVariablesFunctions.hlsl"
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Deprecated.hlsl"

#endif</pre>



<p></p>



<p></p>



<p><strong>&#8220;Packages/com.unity.render-pipelines.core/ShaderLibrary/SpaceTransforms.hlsl&#8221;</strong></p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#ifndef UNITY_SHADER_VARIABLES_FUNCTIONS_INCLUDED
#define UNITY_SHADER_VARIABLES_FUNCTIONS_INCLUDED

#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/SpaceTransforms.hlsl"

// 주의: '_WorldSpaceCameraPos'는 Unity의 레거시 코드에 의해 설정됩니다.
float3 GetPrimaryCameraPosition()
{
#if (SHADEROPTIONS_CAMERA_RELATIVE_RENDERING != 0)
    // 카메라 상대 렌더링이 활성화된 경우, 카메라 위치는 (0, 0, 0)으로 간주합니다.
    return float3(0, 0, 0);
#else
    // 그렇지 않은 경우, 실제 월드 좌표계를 기준으로 카메라 위치를 반환합니다.
    return _WorldSpaceCameraPos;
#endif
}

// 예: 주 카메라 또는 그림자를 캐스팅하는 빛의 위치일 수 있습니다.
float3 GetCurrentViewPosition()
{
#if defined(SHADERPASS) &amp;&amp; (SHADERPASS != SHADERPASS_SHADOWS)
    // 그림자 패스가 아닌 경우 주 카메라 위치를 반환합니다.
    return GetPrimaryCameraPosition();
#else
    // 일반적인 해결책입니다.
    // 그러나 주 카메라의 경우 '_WorldSpaceCameraPos'를 사용하는 것이 더 좋습니다. 이는 캐시 일관성에도 유리하고, 
    // 카메라 상대 렌더링이 활성화된 경우 위치를 0으로 설정할 수 있기 때문입니다.
    return UNITY_MATRIX_I_V._14_24_34;
#endif
}

// 현재 뷰의 월드 공간에서의 전방(중앙) 방향을 반환합니다.
float3 GetViewForwardDir()
{
    float4x4 viewMat = GetWorldToViewMatrix();
    return -viewMat[2].xyz;
}

// 현재 뷰가 원근 투영을 수행하는 경우 'true'를 반환합니다.
bool IsPerspectiveProjection()
{
#if defined(SHADERPASS) &amp;&amp; (SHADERPASS != SHADERPASS_SHADOWS)
    // 그림자 패스가 아닌 경우 원근 투영 여부를 검사합니다.
    return (unity_OrthoParams.w == 0);
#else
    // TODO: 그림자 패스에서 'unity_OrthoParams'를 설정해야 합니다.
    return UNITY_MATRIX_P[3][3] == 0;
#endif
}

// 월드 공간에서의 뷰 방향을 정규화하여 계산합니다 (뷰어를 향해 있음).
float3 GetWorldSpaceNormalizeViewDir(float3 positionWS)
{
    if (IsPerspectiveProjection())
    {
        // 원근 투영인 경우
        float3 V = GetCurrentViewPosition() - positionWS;
        return normalize(V);
    }
    else
    {
        // 정사영인 경우
        return -GetViewForwardDir();
    }
}

// UNITY_MATRIX_V는 Z 축이 뷰어를 향하는 오른손 좌표계를 정의합니다.
// 이 함수는 Z 축의 방향을 반전하여(앞쪽을 향하게) 뷰 공간 좌표계를 왼손 좌표계로 만듭니다.
void GetLeftHandedViewSpaceMatrices(out float4x4 viewMatrix, out float4x4 projMatrix)
{
    viewMatrix = UNITY_MATRIX_V;
    viewMatrix._31_32_33_34 = -viewMatrix._31_32_33_34;

    projMatrix = UNITY_MATRIX_P;
    projMatrix._13_23_33_43 = -projMatrix._13_23_33_43;
}

// Z 클리핑과 관련된 부분으로, 뒤집어진 Z 버퍼를 사용하는 경우에 대한 조건부 매크로 정의
#if UNITY_REVERSED_Z
    #if (defined(SHADER_API_GLCORE) &amp;&amp; !defined(SHADER_API_SWITCH)) || defined(SHADER_API_GLES) || defined(SHADER_API_GLES3)
        // 뒤집어진 Z를 사용하는 OpenGL에서는 클리핑 범위가 [near, -far]입니다.
        // 성능을 위해 리매핑하지 않고 그대로 사용합니다 (범위가 충분히 가깝기 때문입니다).
        #define UNITY_Z_0_FAR_FROM_CLIPSPACE(coord) max(-(coord), 0)
    #else
        // 뒤집어진 Z를 사용하는 Direct3D에서는 클리핑 범위가 [near, 0]입니다.
        // [0, far]로 리매핑합니다.
        #define UNITY_Z_0_FAR_FROM_CLIPSPACE(coord) max(((1.0-(coord)/_ProjectionParams.y)*_ProjectionParams.z),0)
    #endif
#elif UNITY_UV_STARTS_AT_TOP
    // 뒤집어진 Z를 사용하지 않는 Direct3D에서는 클리핑 범위가 [0, far]이므로 아무것도 할 필요가 없습니다.
    #define UNITY_Z_0_FAR_FROM_CLIPSPACE(coord) (coord)
#else
    // OpenGL에서는 클리핑 범위가 [-near, far]이므로 성능을 위해 리매핑하지 않고 그대로 사용합니다 (범위가 충분히 가깝기 때문입니다).
    #define UNITY_Z_0_FAR_FROM_CLIPSPACE(coord) (coord)
#endif

#endif // UNITY_SHADER_VARIABLES_FUNCTIONS_INCLUDED</pre>



<p></p>



<p></p>



<p></p>



<p></p>
<p>The post <a href="https://lycos7560.com/unity/unity-urp-shader-vertex-attributes-struct-%ec%98%88%ec%8b%9c/38254/">Unity Urp Shader Vertex, Attributes, fragment  Unlit 예시</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lycos7560.com/unity/unity-urp-shader-vertex-attributes-struct-%ec%98%88%ec%8b%9c/38254/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Unity UniversalRenderPipelineAsset&#038;Data 변경</title>
		<link>https://lycos7560.com/unity/unity-universalrenderpipelineassetdata-%eb%b3%80%ea%b2%bd/38250/</link>
					<comments>https://lycos7560.com/unity/unity-universalrenderpipelineassetdata-%eb%b3%80%ea%b2%bd/38250/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Fri, 06 Sep 2024 01:54:17 +0000</pubDate>
				<category><![CDATA[Unity]]></category>
		<category><![CDATA[UnityShader]]></category>
		<category><![CDATA[Bindingflag]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[FieldInfo]]></category>
		<category><![CDATA[GraphicsSettings]]></category>
		<category><![CDATA[m_RendererDataList]]></category>
		<category><![CDATA[QualitySettings]]></category>
		<category><![CDATA[RendererDataList]]></category>
		<category><![CDATA[ScriptableRendererData]]></category>
		<category><![CDATA[study]]></category>
		<category><![CDATA[UniversalRenderPipelineAsset]]></category>
		<category><![CDATA[URP]]></category>
		<category><![CDATA[공부]]></category>
		<category><![CDATA[리플렉션]]></category>
		<guid isPermaLink="false">https://lycos7560.com/?p=38250</guid>

					<description><![CDATA[<p>The post <a href="https://lycos7560.com/unity/unity-universalrenderpipelineassetdata-%eb%b3%80%ea%b2%bd/38250/">Unity UniversalRenderPipelineAsset&amp;Data 변경</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<pre class="EnlighterJSRAW" data-enlighter-language="csharp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">using UnityEngine;
using UnityEngine.Rendering.Universal;
using UnityEngine.Rendering;
using System.Reflection;

public class UniversalRenderPipelineSetting : MonoBehaviour
{
    [SerializeField]
    UniversalRenderPipelineAsset URPPerformant;
    [SerializeField]
    UniversalRenderPipelineAsset URPBalanced;
    [SerializeField]
    UniversalRenderPipelineAsset URPHighFidelity;
    [SerializeField]
    UniversalRenderPipelineAsset URPOne;

    private void Awake()
    {
        Get_CurrentUniversalRenderPipelineAsset();
        Change_UniversalRenderPipelineAssetSetting();
    }

    void Get_CurrentUniversalRenderPipelineAsset() 
    {
        // 현재 UniversalRenderPipelineAsset을 확인
        UniversalRenderPipelineAsset _UniversalRenderPipelineAsset = GraphicsSettings.currentRenderPipeline as UniversalRenderPipelineAsset;
        Debug.Log($"&lt;color=red>{_UniversalRenderPipelineAsset.name}&lt;/color>");

        // UniversalRenderPipelineAsset을 URP-Balanced로 변경
        QualitySettings.renderPipeline = URPBalanced;
        _UniversalRenderPipelineAsset = GraphicsSettings.currentRenderPipeline as UniversalRenderPipelineAsset;
        Debug.Log($"&lt;color=green>{_UniversalRenderPipelineAsset.name}&lt;/color>");

        // UniversalRenderPipelineAsset을 URP-HighFidelity로 변경
        QualitySettings.renderPipeline = URPHighFidelity;
        _UniversalRenderPipelineAsset = GraphicsSettings.currentRenderPipeline as UniversalRenderPipelineAsset;
        Debug.Log($"&lt;color=blue>{_UniversalRenderPipelineAsset.name}&lt;/color>");
    }

    void Change_UniversalRenderPipelineAssetSetting()
    {
        // UniversalRenderPipelineAsset을 URPOne으로 변경
        QualitySettings.renderPipeline = URPOne;
        UniversalRenderPipelineAsset _UniversalRenderPipelineAsset = GraphicsSettings.currentRenderPipeline as UniversalRenderPipelineAsset;
        Debug.Log($"&lt;color=green>{_UniversalRenderPipelineAsset.name}&lt;/color>"); // UniversalRenderPipelineAsset 변경 확인

        // URP Renderer List 리플렉션 참조 (Internal 변수라서 그냥 참조 불가능)
        // 리플렉션(Reflection)은 C#에서 런타임 중에 객체나 타입의 정보를 조사하고 조작할 수 있는 기능
        // 일반적으로 접근할 수 없는 필드나 메서드, 속성 등의 정보를 런타임에 동적으로 가져올 수 있음.
        // 이를 통해 코드가 실행되는 동안 타입에 대한 정보(예: 클래스 내부의 변수, 메서드)를 알아내거나 수정할 수 있음.
        // 이 코드에서 리플렉션 참조는 클래스의 비공개 필드를 접근하기 위해 사용
        // 여기서 m_RendererDataList라는 필드는 UniversalRenderPipelineAsset 클래스의 내부(private) 필드로, 일반적으로 외부에서 접근할 수 없음.
        // 리플렉션을 사용하여 private 또는 internal 필드도 가져옴
        // (using System.Reflection)
        FieldInfo propertyInfo = _UniversalRenderPipelineAsset.GetType().GetField("m_RendererDataList", BindingFlags.Instance | BindingFlags.NonPublic);
        // indingFlags.Instance | BindingFlags.NonPublic 의 설명 / Bindingflags
        // https://learn.microsoft.com/ko-kr/dotnet/api/system.reflection.bindingflags?view=net-8.0

        ScriptableRendererData[] _ScriptableRendererDataList = (ScriptableRendererData[])propertyInfo.GetValue(_UniversalRenderPipelineAsset);
        foreach (ScriptableRendererData _ScriptableRendererData in _ScriptableRendererDataList)
        {
            Debug.Log($"&lt;color=green> ScriptableRendererData : {_ScriptableRendererData.name}&lt;/color>");
        }

    }
}
</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="1920" height="1006" src="https://lycos7560.com/wp-content/uploads/2024/09/image-4-1.jpg" alt="" class="wp-image-38252" srcset="https://lycos7560.com/wp-content/uploads/2024/09/image-4-1.jpg 1920w, https://lycos7560.com/wp-content/uploads/2024/09/image-4-1-300x157.jpg 300w, https://lycos7560.com/wp-content/uploads/2024/09/image-4-1-768x402.jpg 768w, https://lycos7560.com/wp-content/uploads/2024/09/image-4-1-1536x805.jpg 1536w" sizes="(max-width: 1920px) 100vw, 1920px" /></figure>
<p>The post <a href="https://lycos7560.com/unity/unity-universalrenderpipelineassetdata-%eb%b3%80%ea%b2%bd/38250/">Unity UniversalRenderPipelineAsset&amp;Data 변경</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lycos7560.com/unity/unity-universalrenderpipelineassetdata-%eb%b3%80%ea%b2%bd/38250/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Write HLSL Shader in Unity (URP)</title>
		<link>https://lycos7560.com/unity/write-hlsl-shader-in-unity-urp_qwer/38216/</link>
					<comments>https://lycos7560.com/unity/write-hlsl-shader-in-unity-urp_qwer/38216/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Tue, 03 Sep 2024 23:59:39 +0000</pubDate>
				<category><![CDATA[Unity]]></category>
		<category><![CDATA[UnityShader]]></category>
		<category><![CDATA[DirectX]]></category>
		<category><![CDATA[HLSL]]></category>
		<category><![CDATA[Shader]]></category>
		<category><![CDATA[ShaderLab]]></category>
		<category><![CDATA[URP]]></category>
		<category><![CDATA[그래픽]]></category>
		<category><![CDATA[쉐이더]]></category>
		<guid isPermaLink="false">https://lycos7560.com/?p=38216</guid>

					<description><![CDATA[<p>HLSL in Unity https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderPrograms.html In Unity, you use the HLSL programming language to write shader programs.(Unity에서는 HLSL 프로그래밍 언어를 사용하여 셰이더를 작성합니다.) This section of the manual includes information on using HLSL in a Unity-specific way. (이 메뉴얼의 섹션은 HLSL을 Unity-specific 방식으로 사용하는 방법이 포함되어있습니다.* Unity-specific =&#62; Unity 엔진에서 HLSL을 사용하는 특수한 규칙이나 패턴을 의미,Unity는 [&#8230;]</p>
<p>The post <a href="https://lycos7560.com/unity/write-hlsl-shader-in-unity-urp_qwer/38216/">Write HLSL Shader in Unity (URP)</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">HLSL in Unity</h2>



<p><a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderPrograms.html" target="_blank" rel="noreferrer noopener">https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderPrograms.html</a></p>


				<div class="wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-21e4a904      "
					data-scroll= "1"
					data-offset= "30"
					style=""
				>
				<div class="uagb-toc__wrap">
						<div class="uagb-toc__title">
							Content						</div>
																						<div class="uagb-toc__list-wrap ">
						<ol class="uagb-toc__list"><li class="uagb-toc__list"><a href="#hlsl-in-unity" class="uagb-toc-link__trigger">HLSL in Unity</a><ul class="uagb-toc__list"><li class="uagb-toc__list"><a href="#adding-hlsl-code-to-your-shaderlab-codeshaderlab-code에-hlsl-코드-추가" class="uagb-toc-link__trigger">Adding HLSL code to your ShaderLab code(ShaderLab code에 HLSL 코드 추가)</a><li class="uagb-toc__list"><li class="uagb-toc__list"><a href="#hlsl-syntax-hlsl-구문" class="uagb-toc-link__trigger">HLSL syntax (HLSL 구문)</a></li></ul></li><li class="uagb-toc__list"><a href="#preprocessor-directives-in-hlsl-hlsl의-전처리기-지시어" class="uagb-toc-link__trigger">Preprocessor directives in HLSL (HLSL의 전처리기 지시어)</a><ul class="uagb-toc__list"><li class="uagb-toc__list"><a href="#include-and-include-with-pragmas-directives-in-hlslhlsl의-include-및-include-with-pragmas-지시어" class="uagb-toc-link__trigger">include and include_with_pragmas directives in HLSL(HLSL의 include 및 include_with_pragmas 지시어)</a><li class="uagb-toc__list"><li class="uagb-toc__list"><a href="#provide-information-to-the-shader-compiler-in-hlslhlsl의-shader-compiler에-정보-제공" class="uagb-toc-link__trigger">Provide information to the shader compiler in HLSL(HLSL의 shader compiler에 정보 제공)</a><li class="uagb-toc__list"><li class="uagb-toc__list"><a href="#targeting-shader-models-and-gpu-features-in-hlslhlsl의-셰이더-모델-및-gpu-기능-타겟팅" class="uagb-toc-link__trigger">Targeting shader models and GPU features in HLSL(HLSL의 셰이더 모델 및 GPU 기능 타겟팅)</a><li class="uagb-toc__list"><li class="uagb-toc__list"><a href="#targeting-graphics-apis-and-platforms-in-hlslhlsl에서-그래픽-api-및-플랫폼-타겟팅" class="uagb-toc-link__trigger">Targeting graphics APIs and platforms in HLSL(HLSL에서 그래픽 API 및 플랫폼 타겟팅)</a><li class="uagb-toc__list"><li class="uagb-toc__list"><a href="#declaring-and-using-shader-keywords-in-hlslhlsl에서-쉐이더-키워드-선언-및-사용" class="uagb-toc-link__trigger">Declaring and using shader keywords in HLSL(HLSL에서 쉐이더 키워드 선언 및 사용)</a></li></ul></li></ul></li><li class="uagb-toc__list"><a href="#shader-semantics-쉐이더-의미론" class="uagb-toc-link__trigger">Shader semantics (쉐이더 의미론)</a><ul class="uagb-toc__list"><li class="uagb-toc__list"><a href="#vertex-shader-input-semantics-정점-쉐이더-입력-의미론" class="uagb-toc-link__trigger">Vertex shader input semantics (정점 쉐이더 입력 의미론)</a><li class="uagb-toc__list"><li class="uagb-toc__list"><a href="#fragment-shader-output-semantics-프래그먼트픽셀-쉐이더-출력-의미론" class="uagb-toc-link__trigger">Fragment shader output semantics (프래그먼트(픽셀) 쉐이더 출력 의미론)</a><li class="uagb-toc__list"><li class="uagb-toc__list"><a href="#vertex-shader-outputs-and-fragment-shader-inputsvertex-shader-출력과-fragment-shader-입력" class="uagb-toc-link__trigger">Vertex shader outputs and fragment shader inputs(Vertex shader 출력과 fragment shader 입력)</a><li class="uagb-toc__list"><li class="uagb-toc__list"><a href="#other-special-semantics-기타-특수-의미론" class="uagb-toc-link__trigger">Other special semantics (기타 특수 의미론)</a></li></ul></li></ul></li></ul></li><li class="uagb-toc__list"><a href="#accessing-shader-properties-in-cghlslcghlsl에서-셰이더-속성-접근" class="uagb-toc-link__trigger">Accessing shader properties in Cg/HLSL(Cg/HLSL에서 셰이더 속성 접근)</a><ul class="uagb-toc__list"><li class="uagb-toc__list"><a href="#how-property-values-are-provided-to-shaders-속성-값이-shader에-제공되는-방법" class="uagb-toc-link__trigger">How property values are provided to shaders (속성 값이 shader에 제공되는 방법)</a><li class="uagb-toc__list"><li class="uagb-toc__list"><a href="#serialized-and-runtime-material-properties-직렬화된-머티리얼-속성과-런타임-머티리얼-속성" class="uagb-toc-link__trigger">Serialized and Runtime Material properties (직렬화된 머티리얼 속성과 런타임 머티리얼 속성)</a><li class="uagb-toc__list"><li class="uagb-toc__list"><a href="#special-texture-properties-특수-텍스처-속성" class="uagb-toc-link__trigger">Special Texture properties (특수 텍스처 속성)</a></li></ul></li></ul></li></ul></li></ul></li><li class="uagb-toc__list"><a href="#providing-vertex-data-to-vertex-programs-버텍스-프로그램에-버텍스-데이터-제공" class="uagb-toc-link__trigger">Providing vertex data to vertex programs (버텍스 프로그램에 버텍스 데이터 제공)</a><li class="uagb-toc__list"><a href="#built-in-shader-include-files" class="uagb-toc-link__trigger">Built-in shader include files</a><ul class="uagb-toc__list"><li class="uagb-toc__list"><a href="#hlslsupportcginc" class="uagb-toc-link__trigger">HLSLSupport.cginc</a><li class="uagb-toc__list"><li class="uagb-toc__list"><a href="#unityshadervariablescginc" class="uagb-toc-link__trigger">UnityShaderVariables.cginc</a><li class="uagb-toc__list"><li class="uagb-toc__list"><a href="#unitycgcginc" class="uagb-toc-link__trigger">UnityCG.cginc</a></ul></ul></ul></ul></ul></ol>					</div>
									</div>
				</div>
			


<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p>In Unity, you use the HLSL programming language to write shader programs.<br>(Unity에서는 HLSL 프로그래밍 언어를 사용하여 셰이더를 작성합니다.)</p>



<p>This section of the manual includes information on using HLSL in a Unity-specific way. <br>(이 메뉴얼의 섹션은 HLSL을 Unity-specific 방식으로 사용하는 방법이 포함되어있습니다.<br>* Unity-specific =&gt; Unity 엔진에서 HLSL을 사용하는 특수한 규칙이나 패턴을 의미,<br>Unity는 기본적인 HLSL 문법과 개념을 사용하지만, Shader를 작성할 때 ShaderLab 시스템과 통합하여 사용하는 방식을 채택하고 있음.<br>렌더링 파이프라인과 호환되도록 설계된 특정 구조와 방법)</p>



<p>For general information on writing HLSL, see <a href="https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl" target="_blank" rel="noreferrer noopener">Microsoft’s HLSL documentation</a>.<br>(HLSL 작성에 대한 일반적인 정보는 <a href="https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl">Microsoft의 HLSL 문서를 참조하세요.</a>)</p>



<p>Note: Unity originally used the Cg language, hence the name of some of Unity’s keywords (CGPROGRAM) and file extensions (.cginc). <br>(참고:  Unity는 원래 Cg 언어를 사용했기 때문에  Unity의 일부 키워드(CGPROGRAM)와 파일 확장자(.cginc)의 이름을 사용했습니다.)</p>



<p>Unity no longer uses Cg, but these names are still in use.<br>(유니티는 더 이상 Cg를 사용하지 않지만 이러한 이름은 여전히 사용되고 있습니다.)</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">Adding HLSL code to your ShaderLab code<br>(ShaderLab code에 HLSL 코드 추가)</h3>



<p>You place your HLSL code inside code blocks in your&nbsp;ShaderLab code.<br>ShaderLab code 블록 안에 HLSL code를 넣습니다.</p>



<p>They usually look like this:<br>보통 아래와 같이 보입니다.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">  Pass {
      // ... the usual pass state setup ...
      
      HLSLPROGRAM
      // compilation directives for this snippet, e.g.:
      #pragma vertex vert
      #pragma fragment frag
      
      // the shader program itself
      
      ENDHLSL

      // ... the rest of pass ...
  }</pre>



<div style="height:10px" aria-hidden="true" class="wp-block-spacer"></div>



<p>For more information on shader code blocks, see&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-shaderlab-code-blocks.html">ShaderLab: adding shader programs</a>.<br>(shader code  blocks에 대한 자세한 내용은 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-shaderlab-code-blocks.html">ShaderLab: shader 프로그램 추가</a>를 참조하세요.)</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">HLSL syntax (HLSL 구문)</h3>



<p>HLSL has two syntaxes: a legacy DirectX 9-style syntax, and a more modern DirectX 10+ style syntax.<br>(HLSL에는 기존 DirectX 9 스타일 syntax와 최신 DirectX 10+ 스타일 syntax의 두 가지 syntax가 있습니다.)</p>



<p>The difference is mostly in how texture sampling functions work:<br>(차이점은 대부분 텍스처 샘플링 기능의 작동 방식에 있습니다:)</p>



<ul class="wp-block-list">
<li>&#8211; The legacy syntax uses sampler2D, tex2D() and similar functions. This syntax works on all platforms.<br>(기존 구문은 sampler2D, tex2D() 및 유사한 기능을 사용합니다. 이 syntax는 모든 플랫폼에서 작동합니다.)</li>



<li>&#8211; The DX10+ syntax uses Texture2D, SamplerState and .Sample() functions.<br>(DX10+ 구문은 Texture2D, SamplerState 및 .Sample() 함수를 사용합니다.)<br>Some forms of this syntax do not work on OpenGL platforms, because textures and samplers are not different objects in OpenGL.<br>(textures와  samplers 는 OpenGL에서 서로 다른 개체가 아니기 때문에 이 syntax의 일부 형태는 OpenGL 플랫폼에서 작동하지 않습니다.)</li>
</ul>



<p>Unity provides shader libraries that contain preprocessor macros to help you manage these differences.<br>(Unity는 이러한 차이점을 관리하는 데 도움이 되는 전처리 매크로(preprocessor macros)가 포함된 shader libraries를 제공합니다.)</p>



<p>For more information, see&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-BuiltinMacros.html" target="_blank" rel="noreferrer noopener">Built-in shader macros</a>.<br>자세한 내용은 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-BuiltinMacros.html" target="_blank" rel="noreferrer noopener">Built-in shader macros</a>를 참조하세요.</p>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide" style="margin-top:var(--wp--preset--spacing--80);margin-bottom:var(--wp--preset--spacing--80)"/>



<div class="wp-block-uagb-container uagb-block-d72f70ee alignfull uagb-is-root-container">
<p></p>



<h2 class="wp-block-heading">Preprocessor directives in HLSL <br>(HLSL의 전처리기 지시어)</h2>



<p><a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-preprocessor-directives.html">https://docs.unity3d.com/2023.2/Documentation/Manual/shader-preprocessor-directives.html</a></p>



<p>Internally, shader compilation has multiple stages.<br>(내부적으로 shader 컴파일에는 여러 단계가 있습니다.)</p>



<p>The first stage is <strong>preprocessing</strong>, where a program called the preprocessor prepares the code for compilation.<br>(첫 번째 단계는 <strong>전처리 단계</strong>로, 전처리라는 프로그램이 코드를 컴파일을 위해 준비합니다.)</p>



<p><strong>Preprocessor directives</strong> are instructions for the preprocessor.<br>(<strong>전처리기 지시어</strong>는 전처기기에 대한 지시 사항입니다.)</p>



<p>This section of the manual contains information on Unity-specific ways of working with HLSL preprocessor directives, and HLSL preprocessor directives that are unique to Unity. <br>(이 manual의 이 section에는 Unity-specific 방식으로 HLSL 전처리기 지시어를 사용하는 방법과 Unity에 고유한 HLSL 전처리기 지시어에 대한 정보가 포함되어 있습니다.)</p>



<p>It does not contain exhaustive documentation on all the preprocessor directives that HLSL supports, or general information on working with preprocessor directives in HLSL. <br>(HLSL이 지원하는 모든 전처리기 지시어에 대한 포괄적인 문서나 HLSL의 전처리기 지시어를 사용하는 방법에 대한 일반적인 정보는 포함되어 있지 않습니다.)</p>



<p>For that information, see the HLSL documentation: &nbsp;<a href="https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-appendix-preprocessor" target="_blank" rel="noreferrer noopener">Preprocessor directives (HLSL)</a><br>(해당 정보는 HLSL 문서의 전처리기 지시어(Preprocessor directives) 섹션을 참조하세요. : &nbsp;<a href="https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-appendix-preprocessor" target="_blank" rel="noreferrer noopener">Preprocessor directives (HLSL)</a>)</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th class="has-text-align-left" data-align="left"><strong>Page</strong></th><th class="has-text-align-left" data-align="left"><strong>Description</strong></th></tr></thead><tbody><tr><td class="has-text-align-left" data-align="left"><a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-include-directives.html">include and include_with_pragmas directives in HLSL</a><br>(HLSL에서 include 및 include_with_pragmas 지시어)</td><td class="has-text-align-left" data-align="left">Working with<code>&nbsp;#include</code>&nbsp; and the Unity-specific&nbsp;<code>#include_with_pragmas</code>&nbsp;directives in HLSL in Unity.<br>(Unity에서 HLSL에서 <code>#include</code>와 Unity-specific <code>#include_with_pragmas</code> 지시어를 사용하는 방법에 대한 설명.)</td></tr><tr><td class="has-text-align-left" data-align="left"><a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-PragmaDirectives.html">Provide information to the shader compiler in HLSL</a><br>(HLSL에서 셰이더 컴파일러에 정보 제공하기)</td><td class="has-text-align-left" data-align="left">Working with&nbsp;<code>#pragma</code>&nbsp;directives and the&nbsp;<code>#define_for_platform_compiler</code>&nbsp;directive in HLSL in Unity.<br>(Unity에서 HLSL에서 <code>#pragma</code> 지시어와 <code>#define_for_platform_compiler</code> 지시어를 사용하는 방법에 대한 설명.)</td></tr><tr><td class="has-text-align-left" data-align="left"><a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderCompileTargets.html">Targeting shader models and GPU features in HLSL</a><br>(HLSL에서 셰이더 모델 및 GPU 기능 타겟팅하기)</td><td class="has-text-align-left" data-align="left">sing&nbsp;<code>#pragma</code>&nbsp;directives to indicate that your&nbsp;<strong>shader</strong> requires certain GPU features.<br>(셰이더가 특정 GPU 기능을 요구함을 나타내기 위해 <code>#pragma</code> 지시어를 사용하는 방법에 대한 설명.)</td></tr><tr><td class="has-text-align-left" data-align="left"><a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderCompilationAPIs.html">Targeting graphics APIs and platforms in HLSL</a><br>(HLSL에서 그래픽스 API 및 플랫폼 타겟팅하기)</td><td class="has-text-align-left" data-align="left">Using&nbsp;<code>#pragma</code>&nbsp;directives to target specific graphics API and platforms.<br>(특정 그래픽스 API와 플랫폼을 타겟팅하기 위해 <code>#pragma</code> 지시어를 사용하는 방법에 대한 설명.)</td></tr><tr><td class="has-text-align-left" data-align="left"><a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-MultipleProgramVariants.html">Declaring and using shader keywords in HLSL</a><br>HLSL에서 셰이더 키워드 선언 및 사용하기</td><td class="has-text-align-left" data-align="left">Using&nbsp;<code>#pragma</code>&nbsp;directives to declare shader keywords and&nbsp;<code>#if</code>&nbsp;directives to indicate that code depends on the state of shader keywords.<br>(셰이더 키워드를 선언하기 위해 <code>#pragma</code> 지시어를 사용하고, 셰이더 키워드의 상태에 따라 코드가 의존하는 것을 나타내기 위해 <code>#if</code> 지시어를 사용하는 방법에 대한 설명.)</td></tr></tbody></table></figure>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">include and include_with_pragmas directives in HLSL<br>(HLSL의 <code>include</code> 및 <code>include_with_pragmas</code> 지시어)</h3>



<p><a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-include-directives.html">https://docs.unity3d.com/2023.2/Documentation/Manual/shader-include-directives.html</a></p>



<p>In HLSL,&nbsp;<code>#include</code>&nbsp;directives are a type of&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-preprocessor-directives.html">preprocessor directive</a>.<br>(HLSL에서 <code>#include</code> 지시어는 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-preprocessor-directives.html">전처리기 지시어</a>의 일종입니다.)</p>



<p>They instruct the compiler to include the contents of one HLSL file inside another.<br>(이들은 컴파일러에게 하나의 HLSL 파일의 내용을 다른 파일에 포함하도록 지시합니다.)</p>



<p>The file that they include is called an&nbsp;<strong>include file</strong>.<br>(이때 포함되는 파일을 <strong>include file</strong>이라고 합니다.)</p>



<p>In Unity, regular&nbsp;<code>#include</code>&nbsp;directives work the same as in standard HLSL.<br>(Unity에서 일반적인 <code>#include</code> 지시어는 표준 HLSL과 동일하게 작동합니다.)</p>



<p>For more information on regular&nbsp;<code>#include</code>&nbsp;directives, see the HLSL documentation:&nbsp;<a href="https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-appendix-pre-include" target="_blank" rel="noreferrer noopener">include Directive</a>.<br>일반적인 <code>#include</code> 지시어에 대한 자세한 정보는 HLSL 문서의 <a href="https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-appendix-pre-include"><code>include Directive</code>를 참조</a>하세요.</p>



<p>Unity also provides an additional, Unity-specific&nbsp;<code>#include_with_pragmas</code>&nbsp;directive.<br>(Unity는 추가적으로 Unity-specific <code>#include_with_pragmas</code> 지시어를 제공합니다.)</p>



<p>The&nbsp;<code>#include_with_pragmas</code>&nbsp;directive works the same as a regular&nbsp;<code>#include</code>&nbsp;directive, but it also allows you to use&nbsp;<code>#pragma</code>&nbsp;directives in the include file. <br>(<code>#include_with_pragmas</code> 지시어는 일반 <code>#include</code> 지시어와 동일하게 작동하지만, 포함 파일 내에서 <code>#pragma</code> 지시어를 사용할 수 있게 해줍니다.)</p>



<p>This means that the&nbsp;<code>#include_with_pragmas</code>&nbsp;directive allows you to share&nbsp;<code>#pragma</code>&nbsp;directives between multiple files.<br>(즉, <code>#include_with_pragmas</code> 지시어를 사용하면 <strong>여러 파일 간에 <code>#pragma</code> 지시어를 공유</strong>할 수 있습니다.)</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">Using the include_with_pragmas directive<br>(<code>include_with_pragmas</code> 지시어 사용하기)</h4>



<p><strong>Note:</strong>&nbsp;To use&nbsp;<code>#include_with_pragmas</code>&nbsp;directives, you must enable the&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-compilation.html#preprocessor">Caching Shader Preprocessor</a>.<br>(<strong>참고</strong>: <code>#include_with_pragmas</code> 지시어를 사용하려면 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-compilation.html#preprocessor">Caching Shader Preprocessor</a>를 활성화해야 합니다.)</p>



<p>This example demonstrates how to use the Unity-specific&nbsp;<code>#include_with_pragmas</code>&nbsp;directive to enable a common workflow improvement: the ability to toggle&nbsp;<strong>shader</strong> debugging on and off for multiple shaders, without needing to edit every shader source file every time.<br>(다음 예시는 Unity-specific <code>#include_with_pragmas</code> 지시어를 사용하여 셰이더 디버깅을 켜고 끌 수 있는 일반적인 작업 흐름 개선 방법을 보여줍니다.<br> 이를 통해 여러 셰이더의 디버깅을 설정할 때마다 매번 셰이더 소스 파일을 수정할 필요가 없습니다.)</p>



<p>The following line demonstrates the contents of the include file.<br>(다음 줄은 포함 파일의 내용을 보여줍니다.)</p>



<p>It contains a single pragma directive that enables shader debugging:<br>(이 파일에는 셰이더 디버깅을 활성화하는 단일 <code>#pragma</code> 지시어가 포함되어 있습니다:)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">// Comment out the following line to disable shader debugging
// (다음 줄의 주석 처리('#')를 제거하면 hader debugging이 비활성화됩니다)
#pragma enable_d3d11_debug_symbols</pre>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p>In each shader that you want to debug, add an&nbsp;<code>#include_with_pragmas</code>&nbsp;directive that points to the include file.<br>(디버깅할 각 shader에 대해, 포함 파일을 가리키는 <code>#include_with_pragmas</code> 지시어를 추가하세요.)</p>



<p>Put the directive near the other&nbsp;<code>#pragma</code>&nbsp;directives, like this:<br>(이 지시어를 다른 <code>#pragma</code> 지시어들 근처에 배치합니다.)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">// Example pragma directives
#pragma target 4.0 // Shader가 DirectX 11의 Shader 모델 4.0을 대상으로 한다는 것을 지정
#pragma vertex vert // vert라는 이름의 버텍스 Shader 함수를 사용하겠다고 선언
#pragma fragment frag // frag라는 이름의 프래그먼트 Shader 함수를 사용하겠다고 선언

// Replace path-to-include-file with the path to the include file 
// (지정된 경로의 포함 파일을 포함하며, 이 파일에 있는 #pragma 지시어도 함께 적용)
// (경로 "path-to-include-file"는 실제 포함 파일의 경로로 대체해야 합니다.)
#include_with_pragmas "path-to-include-file"

// The rest of the HLSL code goes here
------------------------------
#include_with_pragmas "path-to-include-file" 지시어를 사용하면, 
해당 경로에 있는 파일(path-to-include-file) 내부의 #pragma 지시어들을 여러 shader 파일에서 공유
여러 shader에서 공통으로 사용하는 #pragma 지시어를 한 곳에서 관리할 수 있게 됩니다.</pre>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p>Now, when you want to toggle shader debugging on and off for all shaders that use the include file, you only need to change a single line in the include file. <br>(이제 포함 파일을 사용하는 모든 shader에 대해 shader debugging을 켜고 끄고 싶을 때, 포함 파일의 한 줄만 변경하면 됩니다.)</p>



<p>When Unity recompiles the shaders, it includes the amended line.<br>(Unity가 셰이더를 다시 컴파일할 때, 수정된 줄이 포함됩니다.)</p>



<p><strong>Note:</strong>&nbsp;If a shader file uses&nbsp;<code>#include</code>&nbsp;to import a file that contains an&nbsp;<code>#include_with_pragmas</code>&nbsp;directive, Unity ignores the&nbsp;<code>#pragma</code>&nbsp;directives in the file the&nbsp;<code>#include_with_pragmas</code>&nbsp;directive references.<br>(<strong>참고: </strong>shader 파일이 <code>#include_with_pragmas</code> 지시어를 포함하는 파일을 <code>#include</code>로 가져오는 경우, Unity는 <code>#include_with_pragmas</code> 지시어가 참조하는 파일의 <code>#pragma</code> 지시어를 무시합니다)</p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">Provide information to the shader compiler in HLSL<br>(HLSL의 shader compiler에 정보 제공)</h3>



<p><a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-PragmaDirectives.html">https://docs.unity3d.com/2023.2/Documentation/Manual/SL-PragmaDirectives.html</a></p>



<p>In HLSL, you can use the following types of&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-preprocessor-directives.html">preprocessor directive</a>&nbsp;to provide information to the&nbsp;<strong>shader</strong> compiler:<br>(HLSL에서 셰이더 컴파일러에 정보를 제공하기 위해 다음과 같은 전처리 지시어를 사용할 수 있습니다 <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<ul class="wp-block-list">
<li><code>#pragma</code></li>



<li><code>#define_for_platform_compiler</code></li>
</ul>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">Pragma directives (Pragma 지시어)</h4>



<p><code>#pragma</code>&nbsp;directives provide additional information to the shader compiler that isn’t covered by other types of preprocessor directive.<br>(<code>#pragma</code> 지시어는 다른 종류의 전처리 지시어로는 다룰 수 없는 추가적인 정보를 Shader Compiler에 제공합니다.)</p>



<p>You can put&nbsp;<code>#pragma</code>&nbsp;directives anywhere in your HLSL code, but it is a common convention to put them at the start, like this:<br>(<code>#pragma</code> 지시어는 HLSL 코드의 어디에나 넣을 수 있지만, <strong>일반적으로 코드의 시작 부분에 배치하는 것이 관례</strong>입니다. 다음과 같이 사용할 수 있습니다:)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#pragma target 3.0 // Shader가 DirectX 9의 Shader 모델 3.0을 대상으로 한다는 것을 지정
#pragma exclude_renderers vulkan // 특정 렌더링 API에서 Shader를 제외 / Vulkan 렌더링 API를 사용할 때는 컴파일되거나 실행되지 않음
#pragma vertex vert // vert라는 이름의 버텍스 Shader 함수를 사용하겠다고 선언
#pragma fragment frag // frag라는 이름의 프래그먼트 Shader 함수를 사용하겠다고 선언

// The rest of your HLSL code goes here
// 나머지 HLSL 코드는 여기에 작성합니다</pre>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<h5 class="wp-block-heading">Limitations (제한 사항)</h5>



<p>There are some limitations around the use of&nbsp;<code>#pragma</code>&nbsp;directives:<br>(<code>#pragma</code> 지시어 사용에 몇 가지 제한 사항이 있습니다:)</p>



<ul class="wp-block-list">
<li>&#8211; You can use&nbsp;<code>#pragma</code>directives inside conditional (<code>#if</code>) directives if the expression depends only on:<br>(<code>#pragma</code> 지시어는 조건부 지시어(<code>#if</code>) 내에서 사용할 수 있지만, 조건식은 다음에만 의존해야 합니다:)
<ul class="wp-block-list">
<li>Any custom&nbsp;<code>#define</code>&nbsp;directives in your own code<br>(사용자 정의 <code>#define</code> 지시어)</li>



<li>The following platform keywords :<br>(특정 플랫폼 키워드:)<br><code>SHADER_API_MOBILE</code>,&nbsp;<code>SHADER_API_DESKTOP</code>,&nbsp;<code>UNITY_NO_RGBM</code>,&nbsp;<code>UNITY_USE_NATIVE_HDR</code>,&nbsp;<code>UNITY_FRAMEBUFFER_FETCH_AVAILABLE</code>,&nbsp;<code>UNITY_NO_CUBEMAP_ARRAY</code></li>



<li>The&nbsp;<code>UNITY_VERSION</code>&nbsp;macro<br>(<code>UNITY_VERSION</code> 매크로)</li>
</ul>
</li>
</ul>



<ul class="wp-block-list">
<li>&#8211; You can only use Unity-specific&nbsp;<code>#pragma</code>&nbsp;directives in&nbsp;<code>.shader</code>&nbsp;files, and in files that you include with the&nbsp;<code>#include_with_pragmas</code>&nbsp;directive.<br>( Unity-specific <code>#pragma</code> 지시어는 <code>.shader</code> 파일과 <code>#include_with_pragmas</code> 지시어로 포함된 파일에서만 사용할 수 있습니다.)</li>



<li>Unity does not support them in files that you include with the&nbsp;<code>#include</code>&nbsp;directive; the compiler ignores them.<br>(<code>#include</code> 지시어로 포함된 파일에서는 지원되지 않으며, 컴파일러는 이를 무시합니다.)</li>



<li></li>



<li>&#8211; You can only use standard HLSL&nbsp;<code>#pragma</code>&nbsp;directives in files that you include with the&nbsp;<code>#include</code>&nbsp;directive. <br>(표준 HLSL <code>#pragma</code> 지시어는 <code>#include</code> 지시어로 포함된 파일에서만 사용할 수 있습니다.)<br>Unity does not support them in&nbsp;<code>.shader</code>&nbsp;files, or in files that you include with an&nbsp;<code>#include_with_pragmas</code>&nbsp;directive; the compiler ignores them.<br>(<code>.shader</code> 파일이나 <code>#include_with_pragmas</code> 지시어로 포함된 파일에서는 지원되지 않으며, 컴파일러는 이를 무시합니다.)</li>
</ul>



<p><strong>Note:</strong>&nbsp;If a shader file uses&nbsp;<code>#include</code>&nbsp;to import a file that contains an&nbsp;<code>#include_with_pragmas</code>&nbsp;directive, Unity ignores the&nbsp;<code>#pragma</code>&nbsp;directives in the file the&nbsp;<code>#include_with_pragmas</code>&nbsp;directive references.<br>(참고: 셰이더 파일이 <code>#include</code>를 사용하여 <code>#include_with_pragmas</code> 지시어가 포함된 파일을 가져오는 경우, <br>Unity는 <code>#include_with_pragmas</code> 지시어가 참조하는 파일의 <code>#pragma</code> 지시어를 무시합니다.<br>=&gt; <code>#include</code>로 가져온 shader 파일이 <code>#include_with_pragmas</code> 지시어를 포함하는 경우, <br>Unity는 <code>#include_with_pragmas</code> 지시어가 참조하는 파일의 <code>#pragma</code> 지시어를 무시)</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h5 class="wp-block-heading">Standard pragma directives (표준 pragma 지시어)</h5>



<p>Unity supports all&nbsp;#pragma&nbsp;directives that are part of standard HLSL, as long as these directives are in regular include files.<br>(Unity는 표준 HLSL의 모든 <code>#pragma</code> 지시어를 지원합니다, 이 지시어들은 일반적인 포함 파일에서 사용될 수 있습니다.)</p>



<p>For more information on these directives, see the HLSL documentation:&nbsp;<a href="https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-appendix-pre-pragma">pragma Directive.</a><br>(자세한 내용은 HLSL 문서의 <a href="https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-appendix-pre-pragma" target="_blank" rel="noreferrer noopener"><code>pragma Directive</code>를 참조</a>하세요.)</p>



<div style="height:10px" aria-hidden="true" class="wp-block-spacer"></div>



<h5 class="wp-block-heading">Surface Shaders (표면 셰이더)</h5>



<p>If you are writing a&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-SurfaceShaders.html" target="_blank" rel="noreferrer noopener">Surface Shader</a>, use this directive to tell the compiler which function to use as the&nbsp;<strong>surface function</strong>, and pass data to that function.<br>(<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-SurfaceShaders.html" target="_blank" rel="noreferrer noopener">Surface Shader</a>를 작성할 때는 다음과 같은 지시어를 사용하여 컴파일러에 <strong>surface function</strong>과 그에 필요한 데이터를 전달할 수 있습니다:)</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th class="has-text-align-left" data-align="left"><strong>Statement</strong></th><th class="has-text-align-left" data-align="left"><strong>Function</strong></th></tr></thead><tbody><tr><td class="has-text-align-left" data-align="left"><code>#pragma surface &lt;surface function&gt; &lt;lighting model&gt; &lt;optional parameters&gt;</code></td><td class="has-text-align-left" data-align="left">Compile the function with the given name as the surface shader, so that it works with the given lighting model. For more information, see&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-SurfaceShaders.html" target="_blank" rel="noreferrer noopener">Surface Shaders</a>.<br>(주어진 이름을 서피스 셰이더로 사용하여 주어진 조명 모델과 함께 작동하도록 함수를 컴파일합니다. 자세한 내용은 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-SurfaceShaders.html" target="_blank" rel="noreferrer noopener">Surface Shaders</a>를 참조하세요.)</td></tr></tbody></table></figure>



<div style="height:10px" aria-hidden="true" class="wp-block-spacer"></div>



<h5 class="wp-block-heading">Shader stages (Shader 단계)</h5>



<p>If you are writing a regular graphics shader, use these directives to tell the compiler which functions to use for different shader stages.<br>(일반 graphics shader를 작성할 때는 다음 지시어를 사용하여 컴파일러에 다양한 shader 단계에 사용할 함수를 알려줍니다.)</p>



<p>The&nbsp;<code>#pragma vertex</code>&nbsp;and&nbsp;<code>#pragma fragment</code>&nbsp;directives are required, but other stages are optional.<br>(<code>#pragma vertex</code>와 <code>#pragma fragment</code> 지시어는 필수이며, 다른 단계는 선택적입니다.)</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th class="has-text-align-left" data-align="left"><strong>Statement</strong></th><th class="has-text-align-left" data-align="left"><strong>Function</strong></th></tr></thead><tbody><tr><td class="has-text-align-left" data-align="left"><code>#pragma vertex &lt;name&gt;</code></td><td class="has-text-align-left" data-align="left">Compile the function with the given name as the vertex shader. <br>(지정된 이름의 함수를 정점 셰이더로 컴파일합니다.)<br>Replace &lt;name&gt; with the function name. <br>(<code>&lt;name&gt;</code>을 함수 이름으로 교체하세요.)<br>This directive is required in regular graphics shaders.<br>(이 지시어는 일반 그래픽 셰이더에서 필수입니다.)</td></tr><tr><td class="has-text-align-left" data-align="left"><code>#pragma fragment &lt;name&gt;</code></td><td class="has-text-align-left" data-align="left">Compile the function with the given name as the fragment shader.<br>(지정된 이름의 함수를  fragment shader로 컴파일합니다.)<br>Replace &lt;name&gt; with the function name.<br>(<code>&lt;name&gt;</code>을 함수 이름으로 교체하세요.)<br>This directive is required in regular graphics shaders.<br>(이 지시어는 일반 graphics shaders에서 필수입니다.)</td></tr><tr><td class="has-text-align-left" data-align="left"><code>#pragma geometry &lt;name&gt;</code></td><td class="has-text-align-left" data-align="left">Compile the function with the given name as the geometry shader.<br>(지정된 이름의 함수를 기하학 셰이더로 컴파일합니다.)<br>Replace &lt;name&gt; with the function name. <br>(&lt;name&gt;을 함수 이름으로 교체하세요.)<br>This option automatically turns on&nbsp;<code>#pragma require geometry</code>; <br>(이 옵션은 자동으로 <code>#pragma require geometry</code>를 활성화합니다.)<br>for more information, see&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderCompileTargets.html">Targeting shader models and GPU features in HLSL</a>.<br>(자세한 내용은 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderCompileTargets.html" target="_blank" rel="noreferrer noopener">HLSL의 셰이더 모델 및 GPU 기능을 참조하세요.</a>)<br><br><strong>Note</strong>: Metal does not support geometry shaders.<br>(<strong>참고</strong>: Metal[애플]은 기하학 셰이더를 지원하지 않습니다.)</td></tr><tr><td class="has-text-align-left" data-align="left"><code>#pragma hull &lt;name&gt;</code></td><td class="has-text-align-left" data-align="left">Compile the function with the given name as the DirectX 11 hull shader. <br>(지정된 이름의 함수를 DirectX 11 hull Shader로 컴파일합니다.)<br>Replace &lt;name&gt; with the function name. <br>(&lt;name&gt;을 함수 이름으로 교체하세요.)<br>This automatically adds&nbsp;<code>#pragma require tessellation</code>; <br>(이 옵션은 자동으로 #pragma require tessellation을 활성화합니다.)<br>for more information, see&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderCompileTargets.html" target="_blank" rel="noreferrer noopener">Targeting shader models and GPU features in HLSL</a>.<br>(자세한 내용은 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderCompileTargets.html">HLSL의 셰이더 모델 및 GPU 기능</a><a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderCompileTargets.html" target="_blank" rel="noreferrer noopener">을</a><a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderCompileTargets.html"> 참조하세요.</a>)<br><br>&#8211; hull Shader : shader 모델 5.0에서 도입된 기능으로, 복잡한 기하학적 세부사항을 동적으로 생성하는 데 사용<br>Hull Shader는 이 테셀레이션(<strong>일정한 형태의 도형들로 평면을 빈틈 없이 채우는 것</strong>.) <br>프로세스의 첫 번째 단계로, 입력된 기하학을 테셀레이션(세분화)할 수 있도록 정보를 제공</td></tr><tr><td class="has-text-align-left" data-align="left"><code>#pragma domain &lt;name&gt;</code></td><td class="has-text-align-left" data-align="left">Compile the function with the given name as the DirectX 11 domain shader. <br>(지정된 이름의 함수를 DirectX 11 Domain shader로 컴파일합니다.)<br>Replace &lt;name&gt; with the function name. <br>(&lt;name&gt;을 함수 이름으로 교체하세요.)<br>This option automatically turns on&nbsp;<code>#pragma require tessellation</code>; <br>(이 옵션은 자동으로 <code>#pragma require tessellation</code>을 활성화합니다.)<br>for more information, see&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderCompileTargets.html" target="_blank" rel="noreferrer noopener">Targeting shader models and GPU features in HLSL</a>.<br>(자세한 내용은<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderCompileTargets.html" target="_blank" rel="noreferrer noopener"> HLSL의 셰이더 모델 및 GPU 기능을 참조하세요.</a>)</td></tr></tbody></table></figure>



<div style="height:10px" aria-hidden="true" class="wp-block-spacer"></div>



<h5 class="wp-block-heading">Shader variants and keywords (Shader 변형 및 키워드)</h5>



<p>Use these directives to tell the shader compiler how to handle&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-variants-and-keywords.html" target="_blank" rel="noreferrer noopener">shader variants and keywords</a>.<br>(다음 지시어를 사용하여 shader  컴파일러에 shader  <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-variants-and-keywords.html" target="_blank" rel="noreferrer noopener">변형 및 키워드</a>를 처리하는 방법을 지시할 수 있습니다.)</p>



<p>For more information, see&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-MultipleProgramVariants.html" target="_blank" rel="noreferrer noopener">Declaring and using shader keywords in HLSL</a>.<br>(자세한 내용은 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-MultipleProgramVariants.html" target="_blank" rel="noreferrer noopener">HLSL의 셰이더 키워드 선언 및 사용을 참조</a>하세요.)</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th class="has-text-align-left" data-align="left"><strong>Directive</strong></th><th class="has-text-align-left" data-align="left"><strong>Description</strong></th></tr></thead><tbody><tr><td class="has-text-align-left" data-align="left"><code>#pragma multi_compile &lt;keywords&gt;</code></td><td class="has-text-align-left" data-align="left">Declares a collection of keywords. The compiler includes all of the keywords in the build.<br>(여러 개의 키워드를 선언합니다. 컴파일러는 모든 키워드를 포함하여 빌드를 생성합니다.)<br>You can use suffixes such as&nbsp;<code>_local</code>&nbsp;to set additional options.<br>(<code>_local</code>과 같은 접미사를 사용하여 추가 옵션을 설정할 수 있습니다.)<br>For more information and a list of supported suffixes, see&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-MultipleProgramVariants.html" target="_blank" rel="noreferrer noopener">Declaring and using shader keywords in HLSL</a>.<br>(자세한 내용과 지원되는 접미사 목록은 HLSL의 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-MultipleProgramVariants.html" target="_blank" rel="noreferrer noopener">shader 키워드 선언 및 사용을 참조</a>하세요.)</td></tr><tr><td class="has-text-align-left" data-align="left"><code>#pragma shader_feature &lt;keywords&gt;</code></td><td class="has-text-align-left" data-align="left">Declares a collection of keywords. The compiler excludes unused keywords from the build.<br>(여러 개의 키워드를 선언합니다. 컴파일러는 사용되지 않는 키워드를 빌드에서 제외합니다.)<br>You can use suffixes such as&nbsp;<code>_local</code>&nbsp;to set additional options.<br>(<code>_local</code>과 같은 접미사를 사용하여 추가 옵션을 설정할 수 있습니다.)<br>For more information and a list of supported suffixes, see&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-MultipleProgramVariants.html" target="_blank" rel="noreferrer noopener">Declaring and using shader keywords in HLSL</a>.<br>(자세한 내용과 지원되는 접미사 목록은 HLSL의 shader <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-MultipleProgramVariants.html" target="_blank" rel="noreferrer noopener">키워드 선언 및 사용을 참조</a>하세요.)</td></tr><tr><td class="has-text-align-left" data-align="left"><code>#pragma hardware_tier_variants &lt;values&gt;</code></td><td class="has-text-align-left" data-align="left"><strong>Built-in Render Pipeline</strong> only: Add keywords for&nbsp;<strong>graphics tiers</strong>&nbsp;when compiling for a given graphics API. <br>(<strong>Built-in Render Pipeline</strong>에서만 사용됩니다. 주어진 그래픽 API를 위해 <strong>graphics tiers</strong>에 대한 키워드를 추가합니다.)<br>For more information, see&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/graphics-tiers.html" target="_blank" rel="noreferrer noopener">Graphics tiers</a>.<br>그래픽 티어에 대한 자세한 내용은 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/graphics-tiers.html" target="_blank" rel="noreferrer noopener">Graphics tiers를 참조</a>하세요.</td></tr><tr><td class="has-text-align-left" data-align="left"><code>#pragma skip_variants &lt;list of keywords&gt;</code></td><td class="has-text-align-left" data-align="left">Strip specified keywords.<br>(지정된 키워드를 생략하여 빌드에서 제거합니다.)</td></tr></tbody></table></figure>



<div style="height:10px" aria-hidden="true" class="wp-block-spacer"></div>



<h5 class="wp-block-heading">Graphics APIs</h5>



<p>Use these directives to tell Unity to include or exclude code for a given graphics API.<br>(다음 지시어를 사용하여 Unity에 특정 그래픽 API에 대한 코드를 포함하거나 제외하도록 지시할 수 있습니다.)</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th class="has-text-align-left" data-align="left"><strong>Statement</strong></th><th class="has-text-align-left" data-align="left"><strong>Function</strong></th></tr></thead><tbody><tr><td class="has-text-align-left" data-align="left"><code>#pragma only_renderers &lt;value&gt;</code></td><td class="has-text-align-left" data-align="left">Compile this shader program only for given graphics APIs. <br>(이 셰이더 프로그램을 지정된 그래픽 API에 대해서만 컴파일합니다.)<br>Replace &lt;values&gt; with a space-delimited list of valid values.<br>(<code>&lt;value&gt;</code>를 유효한 값들의 공백으로 구분된 목록으로 교체하세요.)<br>For more information and a list of valid values, see&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderCompilationAPIs.html" target="_blank" rel="noreferrer noopener">Targeting graphics APIs and platforms in HLSL</a>.<br>(자세한 내용과 유효한 값 목록은<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderCompilationAPIs.html" target="_blank" rel="noreferrer noopener"> HLSL의 그래픽 API 및 플랫폼 타겟팅을 참조</a>하세요.)</td></tr><tr><td class="has-text-align-left" data-align="left"><code>#pragma exclude_renderers &lt;value&gt;</code></td><td class="has-text-align-left" data-align="left">Do not compile this shader program for given graphics APIs. <br>(이 셰이더 프로그램을 지정된 그래픽 API에 대해 컴파일하지 않습니다.)<br>Replace &lt;value&gt; with a space-delimited list of valid values. <br>(<code>&lt;value&gt;</code>를 유효한 값들의 공백으로 구분된 목록으로 교체하세요.)<br>For more information and a list of valid values, see&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderCompilationAPIs.html" target="_blank" rel="noreferrer noopener">Targeting graphics APIs and platforms in HLSL</a>.<br>(자세한 내용과 유효한 값 목록은 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderCompilationAPIs.html" target="_blank" rel="noreferrer noopener">HLSL의 그래픽 API 및 플랫폼 타겟팅을 참조</a>하세요.)</td></tr></tbody></table></figure>



<div style="height:10px" aria-hidden="true" class="wp-block-spacer"></div>



<h5 class="wp-block-heading">Other pragma directives (기타 <code>#pragma</code> 지시어)</h5>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Statement</strong></th><th><strong>Function</strong></th></tr></thead><tbody><tr><td><code>#pragma instancing_options &lt;options&gt;</code></td><td>Enable GPU instancing in this shader, with given options. <br>(주어진 옵션을 사용하여 이 셰이더에서 GPU 인스턴싱을 활성화합니다.)<br>For more information, see&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/GPUInstancing.html" target="_blank" rel="noreferrer noopener">GPU instancing</a><br>(자세한 내용은 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/GPUInstancing.html" target="_blank" rel="noreferrer noopener">GPU instancing</a>을 참조하세요.)</td></tr><tr><td><code>#pragma once</code></td><td>Put this directive in a file to ensure that the compiler includes the file only once in a shader program.<br>(이 지시어를 파일에 추가하면 컴파일러가 해당 파일을 셰이더 프로그램에서 한 번만 포함하도록 보장합니다.)<br><strong>Note:</strong>&nbsp;Unity only supports this directive when the&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-compilation.html#preprocessor" target="_blank" rel="noreferrer noopener">Caching Shader Preprocessor</a>&nbsp;is enabled.<br>(<strong>참고</strong>: Unity는 이 지시어를 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-compilation.html#preprocessor" target="_blank" rel="noreferrer noopener">Caching Shader Preprocessor</a>가 활성화된 경우에만 지원합니다.)</td></tr><tr><td><code>#pragma enable_d3d11_debug_symbols</code></td><td>Generates shader debug symbols for supported graphics APIs, and disables optimizations for all graphics APIs. <br>(지원되는 그래픽 API에 대해 셰이더 디버그 심볼을 생성하고, <strong>모든 그래픽 API에 대해 최적화를 비활성화</strong>합니다.)<br>Use this for debugging shader code in an external tool.<br>(외부 도구에서 셰이더 코드를 <strong>디버깅</strong>할 때 사용합니다.)<br>Unity generates debug symbols for Vulkan, DirectX 11 and 12, and supported console platforms.<br>(Unity는 Vulkan, DirectX 11 및 12 및 지원되는 console  platforms에 대한 debug symbols을 생성합니다.)<br><strong>Warning:</strong>&nbsp;Using this results in an increased file size and reduced shader performance. <br>(이 지시어를 사용하면 파일 크기가 증가하고 셰이더 성능이 저하될 수 있습니다.)<br>When you have finished debugging your shaders and you are ready to make a final build of your application, remove this line from your shader source code and recompile the shaders.<br>(shader 디버깅을 완료하고 application을 최종 빌드할 준비가 되면 shader 소스 코드에서 이 줄을 제거하고 shader를 다시 컴파일합니다.)</td></tr><tr><td><code>#pragma skip_optimizations &lt;value&gt;</code></td><td>Forces optimizations off for given graphics APIs. <br>(주어진 그래픽 API에 대해 최적화를 강제로 비활성화합니다.)<br>Replace &lt;values&gt; with a space-delimited list of valid values. <br>(<code>&lt;value&gt;</code>를 유효한 값들의 공백으로 구분된 목록으로 교체하세요.)<br>For a list of valid values, see&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderCompilationAPIs.html" target="_blank" rel="noreferrer noopener">Targeting graphics APIs and platforms in HLSL</a><br>(유효한 값 목록은 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderCompilationAPIs.html" target="_blank" rel="noreferrer noopener">HLSL의 그래픽 API 및 플랫폼 타겟팅을 참조</a>하세요.)</td></tr><tr><td><code>#pragma hlslcc_bytecode_disassembly</code></td><td>Embed disassembled HLSLcc bytecode into a translated shader.<br>(번역된 셰이더에 disassembled HLSLcc 바이트코드를 포함합니다.)</td></tr><tr><td><code>#pragma disable_fastmath</code></td><td>Enable precise IEEE 754 rules involving NaN handling. <br>(NaN 처리와 관련된 IEEE 754 규칙을 정확히 따릅니다.)<br>This currently only affects the Metal platform.<br>(현재 Metal 플랫폼에서만 영향을 미칩니다.)</td></tr><tr><td><code>#pragma editor_sync_compilation</code></td><td>Force synchronous compilation. This affects the Unity Editor only. <br>(동기식 컴파일을 강제합니다. 이는 Unity Editor에만 영향을 미칩니다.)<br>For more information, see&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/AsynchronousShaderCompilation.html" target="_blank" rel="noreferrer noopener">Asynchronous Shader compilation</a>.<br>(자세한 내용은 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/AsynchronousShaderCompilation.html" target="_blank" rel="noreferrer noopener">Asynchronous(비동기) Shader</a> 컴파일을 참조하세요.)</td></tr><tr><td><code>#pragma enable_cbuffer</code></td><td>Emit&nbsp;<code>cbuffer(name)</code>&nbsp;when using&nbsp;<code>CBUFFER_START(name)</code>&nbsp;and&nbsp;<code>CBUFFER_END</code>&nbsp;macros from HLSLSupport even if the current platform does not support constant buffers.<br>(현재 플랫폼이 상수 버퍼를 지원하지 않더라도 <code>CBUFFER_START(name)</code> 및 <code>CBUFFER_END</code> 매크로를 사용할 때 <code>cbuffer(name)</code>을 생성합니다.)<br></td></tr></tbody></table></figure>



<div style="height:10px" aria-hidden="true" class="wp-block-spacer"></div>



<h5 class="wp-block-heading">Use a define_for_platform_compiler directive<br>(<code>#define_for_platform_compiler</code> 지시어 사용하기)</h5>



<p>Use a&nbsp;<code>#define_for_platform_compiler</code>&nbsp;directive in your shader code to send a&nbsp;<code>#define</code>&nbsp;directive to the shader compiler.<br>(shader 코드에서 <code>#define_for_platform_compiler</code> 지시어를 사용하여 shader 컴파일러에 <code>#define</code> 지시어를 전달할 수 있습니다.)</p>



<p>For example,&nbsp;<code>#define_for_platform_compiler EXAMPLE_SYMBOL</code>&nbsp;sends a&nbsp;<code>#define EXAMPLE_SYMBOL</code>&nbsp;directive to the shader compiler that defines a symbol called&nbsp;<code>EXAMPLE_SYMBOL</code>. <br>(예를 들어, <code>#define_for_platform_compiler EXAMPLE_SYMBOL</code>은 <code>#define EXAMPLE_SYMBOL</code> 지시어를 shader 컴파일러에 전달하여 <code>EXAMPLE_SYMBOL</code>이라는 심볼을 정의합니다.)</p>



<p>Refer to external shader compiler documentation, for example&nbsp;<a href="https://learn.microsoft.com/en-us/windows/win32/direct3dtools/fxc" target="_blank" rel="noreferrer noopener">Microsoft’s documentation on the FXC compiler</a>, for more information about symbols that shader compilers use.<br>(이와 관련된 자세한 내용은 외부 셰이더 컴파일러 문서, <a href="https://learn.microsoft.com/en-us/windows/win32/direct3dtools/fxc" target="_blank" rel="noreferrer noopener">예를 들어 Microsoft의 FXC 컴파일러 문서를 참조하세요.</a>)</p>



<p>The Unity preprocessor doesn’t use symbols you define with&nbsp;<code>#define_for_platform_compiler</code>, so you can’t use the symbols in your own shader code. <br>(Unity 전처리기는 <code>#define_for_platform_compiler</code>로 정의한 심볼을 사용하지 않습니다. 따라서, 이러한 심볼을 shader 코드에서 직접 사용할 수 없습니다.)</p>



<p>For example, in the above example, if you add shader code inside an&nbsp;<code>#if (EXAMPLE_SYMBOL)</code>&nbsp;statement, the code won’t run.<br>(예를 들어, 위의 예제에서 <code>#if (EXAMPLE_SYMBOL)</code> 구문 안에 셰이더 코드를 추가하더라도 그 코드는 실행되지 않습니다.)</p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">Targeting shader models and GPU features in HLSL<br>(HLSL의 셰이더 모델 및 GPU 기능 타겟팅)</h3>



<p><a href="https://docs.unity3d.com/2022.3/Documentation/Manual/SL-ShaderCompileTargets.html" target="_blank" rel="noreferrer noopener">https://docs.unity3d.com/2022.3/Documentation/Manual/SL-ShaderCompileTargets.html</a></p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p>You can use&nbsp;<a href="https://docs.unity3d.com/2022.3/Documentation/Manual/SL-PragmaDirectives.html"><code>#pragma</code>&nbsp;directives</a>&nbsp;to indicate that a&nbsp;<strong>shader</strong> requires certain GPU features.<br>(#pragma 지시어를 사용하여 Shader가 특정 GPU 기능을 필요로 한다는 것을 명시할 수 있습니다.)</p>



<p>At runtime, Unity uses this information to determine whether a shader program is compatible with the current hardware.<br>(Unity는 런타임 시 이 정보를 사용하여 Shader 프로그램이 현재 하드웨어와 호환되는지 여부를 판단합니다.)</p>



<p>You can specify individual GPU features with the&nbsp;<code>#pragma require</code>&nbsp;directive, or specify a&nbsp;<strong>shader model</strong>&nbsp;with the&nbsp;<code>#pragma target</code>&nbsp;directive.<br>(#pragma require 지시어로 개별 GPU 기능을 지정하거나, #pragma target 지시어로 Shader 모델을 지정할 수 있습니다.)</p>



<p> A shader model is a shorthand for a group of GPU features; internally, it is the same as a&nbsp;<code>#pragmarequire</code>&nbsp;directive with the same list of features.<br>(Shader 모델은 여러 GPU 기능을 하나로 묶은 단축어로, 내부적으로 동일한 기능 목록을 가진 #pragma require 지시어와 동일합니다.)</p>



<p>It is important to correctly describe the GPU features that your shader requires.<br>(Shader가 필요로 하는 GPU 기능을 정확히 기술하는 것이 중요합니다.)</p>



<p> If your shader uses features that are not included in the list of requirements, this can result in either compile time errors, or in devices failing to support shaders at runtime.<br>(Shader에서 사용한 기능이 요구 사항 목록에 포함되지 않은 경우, 컴파일 시 오류가 발생하거나 런타임 시 디바이스에서 Shader를 지원하지 못하는 상황이 발생할 수 있습니다.)</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">Default behavior (기본 동작)</h4>



<p>By default, Unity compiles shaders with&nbsp;<code>#pragma require derivatives</code>, which corresponds to&nbsp;<code>#pragma target 2.5</code>.<br>(Unity는 기본적으로 #pragma require derivatives로 Shader를 컴파일하며, 이는 #pragma target 2.5에 해당합니다.)</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">Special requirements for shader stages (shader 단계에 대한 특별 요구 사항)</h4>



<p>If your shader defines certain shader stages, Unity automatically adds items to the list of requirements.<br>(Shader가 특정 Shader 단계를 정의하는 경우, Unity는 자동으로 요구 사항 목록에 항목을 추가합니다.)</p>



<ul class="wp-block-list">
<li>&#8211; If a shader defines a geometry stage (with&nbsp;<code>#pragma geometry</code>), Unity automatically adds&nbsp;<code>geometry</code>&nbsp;to the list of requirements.<br>(#pragma geometry), Unity는 자동으로 요구 사항 목록에 geometry를 추가합니다.)</li>



<li>&#8211; If a shader defines a tessellation stage (with&nbsp;<code>#pragma hull</code>&nbsp;or&nbsp;<code>#pragma domain</code>), Unity automatically adds&nbsp;<code>tessellation</code>&nbsp;to the list of requirements.<br>(#pragma hull 또는 #pragma domain), Unity는 자동으로 요구 사항 목록에 tessellation을 추가합니다.)</li>
</ul>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p>If the list of requirements (or the equivalent target value) does not already include these values, Unity displays a warning message when it compiles the shader, to indicate that it has added these requirements.<br>(요구 사항 목록에 이러한 값들이 이미 포함되어 있지 않다면, Unity는 Shader를 컴파일할 때 이러한 요구 사항이 추가되었음을 알리는 경고 메시지를 표시합니다.)</p>



<p>To avoid seeing this warning message, explicitly add the requirements or use an appropriate target value in your code.<br>(이 경고 메시지를 피하려면 코드에서 명시적으로 요구 사항을 추가하거나 적절한 target 값을 사용해야 합니다.)</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">Specifying GPU features or a shader model (GPU 기능 또는 셰이더 모델 지정)</h4>



<p>To specify required features, use the&nbsp;<code>#pragma require</code>&nbsp;directive, followed by a list of space-delimited values. For example:<br>(필요한 기능을 지정하려면, #pragma require 지시어를 사용하고 공백으로 구분된 값들의 목록을 나열합니다. 예를 들어서:)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#pragma require integers mrt8

// integers: Shader에서 정수 연산을 지원하는 GPU를 요구
// 이는 정수 기반의 계산이나 비트 연산을 수행하는 Shader에서 필수

// mrt8: 최대 8개의 Multiple Render Targets (MRTs)을 지원하는 GPU를 요구
// mrt는 Shader가 한 번의 렌더 패스에서 여러 개의 렌더 타겟에 출력할 수 있도록 하는 기능</pre>



<p>You can also use the&nbsp;<code>#pragma require</code>&nbsp;directive followed by a colon and a list of space-delimited&nbsp;<a href="https://docs.unity3d.com/2022.3/Documentation/Manual/SL-MultipleProgramVariants.html" target="_blank" rel="noreferrer noopener">shader keywords</a>.<br>(#pragma require 지시어 뒤에 콜론과 공백으로 구분된 <a href="https://docs.unity3d.com/2022.3/Documentation/Manual/SL-MultipleProgramVariants.html" target="_blank" rel="noreferrer noopener">Shader 키워드</a> 목록을 추가할 수도 있습니다.)</p>



<p>This means that the requirement applies only to variants that are used when any of the given keywords are enabled. For example:<br>(이는 지정된 키워드가 활성화될 때 사용되는 변형에만 해당 요구 사항이 적용됨을 의미합니다. 예를 들어)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#pragma require integers mrt8 : EXAMPLE_KEYWORD OTHER_EXAMPLE_KEYWORD</pre>



<p>You can use multiple&nbsp;<code>#pragma require</code>&nbsp;lines.<br>(#pragma require 지시어를 여러 줄 사용할 수 있습니다.)</p>



<p>In this example, the shader requires&nbsp;<code>integers</code>&nbsp;in all cases, and&nbsp;<code>mrt8</code>&nbsp;if EXAMPLE_KEYWORD is enabled.<br>(이 예제에서는 Shader가 모든 경우에 integers를 필요로 하며, EXAMPLE_KEYWORD가 활성화된 경우 mrt8도 필요로 합니다.)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#pragma require integers
#pragma require integers mrt8 : EXAMPLE_KEYWORD</pre>



<p>To specify a shader model, use&nbsp;<code>#pragma target</code>&nbsp;directive. For example:<br>(Shader 모델을 지정하려면, #pragma target 지시어를 사용하십시오.)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#pragma target 4.0</pre>



<p>You can also use the&nbsp;<code>#pragma target</code>&nbsp;directive followed by a list of space-delimited&nbsp;<a href="https://docs.unity3d.com/2022.3/Documentation/Manual/SL-MultipleProgramVariants.html" target="_blank" rel="noreferrer noopener">shader keywords</a>.<br>(#pragma target 지시어 뒤에 공백으로 구분된 <a href="https://docs.unity3d.com/2022.3/Documentation/Manual/SL-MultipleProgramVariants.html" target="_blank" rel="noreferrer noopener">Shader 키워드</a> 목록을 추가할 수도 있습니다.)</p>



<p>This means that the requirement applies only to variants that are used when any of the given keywords are enabled. For example:<br>(이는 지정된 키워드가 활성화될 때 사용되는 변형에만 해당 요구 사항이 적용됨을 의미합니다. 를 들어서)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#pragma target 4.0 EXAMPLE_KEYWORD OTHER_EXAMPLE_KEYWORD</pre>



<p><strong>Note:</strong>&nbsp;The syntax for specifying keywords for&nbsp;<code>#pragma require</code>&nbsp;and&nbsp;<code>#pragma target</code>&nbsp;is slightly different.<br>(<strong>참고</strong>: #pragma require와 #pragma target에 대한 키워드를 지정하는 문법은 약간 다릅니다.)</p>



<p>When you specify keywords for&nbsp;<code>#pragma require</code>, you use a colon.<br>(#pragma require에 키워드를 지정할 때는 콜론(:)을 사용합니다.)</p>



<p>When you specify keywords for&nbsp;<code>#pragma target</code>, you do not use a colon.<br>(#pragma target에 키워드를 지정할 때는 콜론을 사용하지 않습니다.)</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">List of ‘#pragma target’ values (<code>#pragma target</code> 값 목록)</h4>



<p>Here is the list of shader models that Unity uses, and the combination of&nbsp;<code>#pragma require</code>&nbsp;values that each corresponds to.<br>(다음은 Unity에서 사용하는 Shader 모델 목록과 각각에 해당하는 <code>#pragma require</code> 값의 조합입니다.)</p>



<p><strong>Note:</strong>&nbsp;Unity’s shader models are similar to DirectX shader models and OpenGL version requirements, but they do not correspond exactly.<br>(<strong>참고:</strong> Unity의 Shader 모델은 DirectX Shader 모델 및 OpenGL 버전 요구 사항과 유사하지만, 정확히 일치하지는 않습니다.)</p>



<p>Read the descriptions carefully to ensure that you understand the differences.<br> (차이를 이해하려면 설명을 주의 깊게 읽으십시오.)</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th class="has-text-align-left" data-align="left"><strong>Value</strong></th><th class="has-text-align-left" data-align="left"><strong>Description</strong></th><th class="has-text-align-left" data-align="left"><strong>Support</strong></th><th class="has-text-align-left" data-align="left"><strong>Equivalent&nbsp;<code>#pragma require</code>&nbsp;values</strong></th></tr></thead><tbody><tr><td class="has-text-align-left" data-align="left"><code>2.0</code></td><td class="has-text-align-left" data-align="left">Equivalent to&nbsp;<a href="https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-sm2" target="_blank" rel="noreferrer noopener">DirectX shader model 2.0</a>.<br>(DirectX Shader 모델 2.0과 동일합니다.)<br><br>Limited amount of arithmetic and texture instructions; <br>(제한된 산술 및 텍스처 명령어;)<br>8 interpolators; no vertex texture sampling; no derivatives in fragment shaders; no explicit LOD texture sampling.<br>(8개의 보간자; 버텍스 텍스처 샘플링 없음; 프래그먼트 Shader에서 미분 없음; 명시적인 LOD 텍스처 샘플링 없음.))</td><td class="has-text-align-left" data-align="left">Works on all platforms supported by Unity.<br>(Unity가 지원하는 모든 플랫폼에서 작동합니다.)</td><td class="has-text-align-left" data-align="left">N/A</td></tr><tr><td class="has-text-align-left" data-align="left"><code>2.5</code></td><td class="has-text-align-left" data-align="left">Almost the same as 3.0, but with only 8 interpolators, and no explicit LOD texture sampling.<br>(Shader 모델 3.0과 거의 동일하지만, 8개의 보간자만 사용하며 명시적인 LOD 텍스처 샘플링이 없습니다.)</td><td class="has-text-align-left" data-align="left">DirectX 11 feature level 9+<br>OpenGL 3.2+<br>OpenGL ES 2.0<br>Vulkan<br>Metal</td><td class="has-text-align-left" data-align="left"><code>derivatives</code></td></tr><tr><td class="has-text-align-left" data-align="left"><code>3.0</code></td><td class="has-text-align-left" data-align="left">Equivalent to&nbsp;<a href="https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-sm3" target="_blank" rel="noreferrer noopener">DirectX shader model 3.0</a>.<br>(DirectX Shader 모델 3.0과 동일합니다.)</td><td class="has-text-align-left" data-align="left">DirectX 11 feature level 10 +<br>OpenGL 3.2+<br>OpenGL ES 3.0+<br>Vulkan<br>Metal<br><br>Might work on some OpenGL ES 2.0 devices, depending on driver extensions and features.<br>(드라이버 확장 및 기능에 따라 일부 OpenGL ES 2.0 디바이스에서 작동할 수 있습니다.)</td><td class="has-text-align-left" data-align="left">Everything in&nbsp;<code>2.5</code>, plus:<br>(2.5에 추가적으로:)<br><code>interpolators10 samplelod fragcoord</code></td></tr><tr><td class="has-text-align-left" data-align="left"><code>3.5</code></td><td class="has-text-align-left" data-align="left">Equivalent to&nbsp;<a href="https://en.wikipedia.org/wiki/OpenGL_ES#OpenGL_ES_3.0" target="_blank" rel="noreferrer noopener">OpenGL ES 3.0</a>.<br>(OpenGL ES 3.0과 동일합니다.)</td><td class="has-text-align-left" data-align="left">DirectX 11 feature level 10+<br>OpenGL 3.2+<br>OpenGL ES 3+<br>Vulkan<br>Metal</td><td class="has-text-align-left" data-align="left">Everything in&nbsp;<code>3.0</code>, plus:<br>(3.0에 추가적으로:)<br><code>interpolators15 mrt4 integers 2darray instancing</code></td></tr><tr><td class="has-text-align-left" data-align="left"><code>4.0</code></td><td class="has-text-align-left" data-align="left">Equivalent to&nbsp;<a href="https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-sm4" target="_blank" rel="noreferrer noopener">DirectX shader model 4.0</a>, but without the requirement to support 8 MRTs.<br>(DirectX Shader 모델 4.0과 동일하지만, 8 MRT 지원 요구 사항은 없습니다.)</td><td class="has-text-align-left" data-align="left">DirectX 11 feature level 10+<br>Desktop OpenGL 3.x<br>OpenGL ES 3.1<br>OpenGL 3.2+<br>OpenGL ES 3.1 + Android Extension Pack (AEP)<br>Vulkan<br>Metal (if no geometry stage is defined)<br>(Metal (geometry 단계가 정의되지 않은 경우))</td><td class="has-text-align-left" data-align="left">Everything in&nbsp;<code>3.5</code>, plus:<br>(3.5에 추가적으로:)<br><code>geometry</code></td></tr><tr><td class="has-text-align-left" data-align="left"><code>gl4.1</code></td><td class="has-text-align-left" data-align="left">Equivalent to&nbsp;<a href="https://en.wikipedia.org/wiki/OpenGL#OpenGL_4.1" target="_blank" rel="noreferrer noopener">OpenGL 4.1</a><br>(OpenGL 4.1과 동일합니다.)</td><td class="has-text-align-left" data-align="left">Desktop OpenGL 4.1<br>(데스크톱 OpenGL 4.1)<br>Shader model 4.0 + tessellation to match macOS 10.9 capabilities.<br>(Shader 모델 4.0에 tessellation이 추가되어 macOS 10.9 기능과 일치합니다.)</td><td class="has-text-align-left" data-align="left">Everything in&nbsp;<code>4.0</code>, plus:<br>(4.0에 추가적으로:)<br><code>cubearray tesshw tessellation msaatex</code></td></tr><tr><td class="has-text-align-left" data-align="left"><code>4.5</code></td><td class="has-text-align-left" data-align="left">Equivalent to&nbsp;<a href="https://en.wikipedia.org/wiki/OpenGL_ES#OpenGL_ES_3.1" target="_blank" rel="noreferrer noopener">OpenGL ES 3.1</a>.<br>(OpenGL ES 3.1과 동일합니다.)</td><td class="has-text-align-left" data-align="left">DirectX 11 feature level 11+<br>OpenGL 4.3+<br>OpenGL ES 3.1<br>Vulkan<br>Metal</td><td class="has-text-align-left" data-align="left">Everything in&nbsp;<code>3.5</code>, plus:<br>(3.5에 추가적으로:)<br><code>compute randomwrite msaatex</code></td></tr><tr><td class="has-text-align-left" data-align="left"><code>4.6</code></td><td class="has-text-align-left" data-align="left">Equivalent to&nbsp;<a href="https://en.wikipedia.org/wiki/OpenGL#OpenGL_4.1" target="_blank" rel="noreferrer noopener">OpenGL 4.1</a>.<br>(OpenGL 4.1과 동일합니다.)<br>This is the highest OpenGL level supported on a Mac.<br>이것이 Mac에서 지원되는 최고 OpenGL 수준입니다.)</td><td class="has-text-align-left" data-align="left">DirectX 11 feature level 11+<br>OpenGL 4.1+<br>OpenGL ES 3.1 + AEP<br>Vulkan<br>Metal (if no geometry stage is defined, and no hull or domain stage is defined)<br>(Metal (geometry 단계나 hull 또는 domain 단계가 정의되지 않은 경우))</td><td class="has-text-align-left" data-align="left">Everything in&nbsp;<code>4.0</code>, plus:<br>(4.0에 추가적으로:)<br><code>cubearray tesshw tessellation msaatex</code></td></tr><tr><td class="has-text-align-left" data-align="left"><code>5.0</code></td><td class="has-text-align-left" data-align="left">Equivalent to&nbsp;<a href="https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/d3d11-graphics-reference-sm5" target="_blank" rel="noreferrer noopener">DirectX shader model 5.0</a>, but without the requirement to support 32 interpolators or cubemap arrays.<br>(DirectX Shader 모델 5.0과 동일하지만, 32개의 보간자나 cubemap 배열 지원 요구 사항은 없습니다.)</td><td class="has-text-align-left" data-align="left">DirectX 11 feature level 11+<br>Desktop OpenGL &gt;= 4.2<br>OpenGL 4.3+<br>OpenGL ES 3.1 + AEP<br>Vulkan<br>Metal (if no geometry stage is defined, and no hull or domain stage is defined)<br>(Metal (geometry 단계나 hull 또는 domain 단계가 정의되지 않은 경우))</td><td class="has-text-align-left" data-align="left">Everything in&nbsp;<code>4.0</code>, plus:<br>(4.0에 추가적으로:)<br><code>compute randomwrite msaatex tesshw tessellation</code></td></tr></tbody></table></figure>



<p>For information on shader model support for console platforms, see the platform-specific documentation.<br>(콘솔 플랫폼의 Shader 모델 지원에 대한 정보는 플랫폼별 문서를 참조하십시오.)</p>



<p><strong>Notes:</strong></p>



<ul class="wp-block-list">
<li>&#8211; In the DirectX definitions, shader model 4.0 includes&nbsp;<code>mrt8</code>, and shader model 5.0 includes&nbsp;<code>interpolators32</code>&nbsp;and&nbsp;<code>cubearray</code>.<br>(DirectX 정의에서 Shader 모델 4.0은 mrt8을 포함하고, Shader 모델 5.0은 interpolators32와 cubearray를 포함합니다.)</li>



<li>Unity does not include these, for broader compatibility. To require these features, use an explicit&nbsp;<code>#pragma require</code>&nbsp;directive.<br>(Unity는 더 넓은 호환성을 위해 이를 포함하지 않습니다. 이러한 기능이 필요할 경우, 명시적으로 <code>#pragma require</code> 지시어를 사용하십시오.)</li>



<li>&#8211; If you use a target that requires&nbsp;<code>geometry</code>&nbsp;but your shader does not define a geometry stage, Unity removes&nbsp;<code>geometry</code>&nbsp;from the list of requirements at compile time.<br>(geometry가 필요한 target을 사용하였으나 Shader가 geometry 단계를 정의하지 않은 경우, Unity는 컴파일 시 요구 사항 목록에서 geometry를 제거합니다.)</li>



<li>&#8211; If you use a target that requires&nbsp;<code>tessellation</code>&nbsp;but your shader does not define a hull or domain stage, Unity removes&nbsp;<code>tessellation</code>&nbsp;from the list of requirements at compile time.<br>(tessellation이 필요한 target을 사용하였으나 Shader가 hull 또는 domain 단계를 정의하지 않은 경우, Unity는 컴파일 시 tessellation을 요구 사항 목록에서 제거합니다.)</li>
</ul>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">List of ‘#pragma require’ values (&#8216;#pragma required&#8217; 값 목록)</h4>



<p>Here are all the valid values for the&nbsp;<code>#pragma require</code>&nbsp;directive.<br>(다음은 <code>#pragma require</code> 지시어에 대한 모든 유효한 값들입니다.)</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Value</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>interpolators10</code></td><td>At least 10 vertex-to-fragment interpolators (“varyings”) are available.<br>(최소 10개의 버텍스-프래그먼트 보간자(“varyings”)가 제공됩니다.)</td></tr><tr><td><code>interpolators15</code></td><td>At least 15 vertex-to-fragment interpolators (“varyings”) are available.<br>(최소 15개의 버텍스-프래그먼트 보간자(“varyings”)가 제공됩니다.)<br><strong>Note:</strong>&nbsp;Internally, this also automatically adds&nbsp;<code>integers</code>&nbsp;to the list of requirements.<br>(참고: 내부적으로, 이는 자동으로 <code>integers</code>를 요구 사항 목록에 추가합니다.)</td></tr><tr><td><code>interpolators32</code></td><td>At least 32 vertex-to-fragment interpolators (“varyings”) are available.<br>(최소 32개의 버텍스-프래그먼트 보간자(“varyings”)가 제공됩니다.)</td></tr><tr><td><code>integers</code></td><td>Integers are a supported data type, including bit/shift operations.<br>(정수는 비트/시프트 연산을 포함한 지원 데이터 타입입니다.)<br><strong>Note:</strong>&nbsp;Internally, this also automatically adds&nbsp;<code>interpolators15</code>&nbsp;to the list of requirements.<br>(참고: 내부적으로, 이는 자동으로 <code>interpolators15</code>를 요구 사항 목록에 추가합니다.)</td></tr><tr><td><code>mrt4</code></td><td>At least 4 render targets are supported.<br>(최소 4개의 렌더 타겟이 지원됩니다.)</td></tr><tr><td><code>mrt8</code></td><td>At least 8 render targets are supported.<br>(최소 8개의 렌더 타겟이 지원됩니다.)</td></tr><tr><td><code>derivatives</code></td><td><strong>Pixel</strong> shader derivative instructions (ddx/ddy) are supported. <br>(Pixel shader 미분 명령(ddx/ddy)이 지원됩니다.)</td></tr><tr><td><code>samplelod</code></td><td>Explicit texture&nbsp;<strong>LOD</strong> sampling (tex2Dlod / SampleLevel) is supported.<br>(명시적인 텍스처 LOD 샘플링(tex2Dlod / SampleLevel)이 지원됩니다.)</td></tr><tr><td><code>fragcoord</code></td><td>Pixel location (XY on screen, ZW depth in clip space) input in pixel shader is supported.<br>(Pixel shader에서 Pixel 위치(화면상의 XY, 클립 공간에서의 ZW 깊이) 입력이 지원됩니다.)</td></tr><tr><td><code>2darray</code></td><td>2D texture arrays are a supported data type.<br>(2D 텍스처 배열이 지원되는 데이터 타입입니다.)</td></tr><tr><td><code>cubearray</code></td><td><strong>Cubemap</strong> arrays are a supported data type.<br>(Cubemap 배열이 지원되는 데이터 타입입니다.)</td></tr><tr><td><code>instancing</code></td><td>SV_InstanceID input system value is supported.<br>(SV_InstanceID 입력 시스템 값이 지원됩니다.)</td></tr><tr><td><code>geometry</code></td><td>Geometry shader stages are supported.<br>(Geometry shader 단계가 지원됩니다.)</td></tr><tr><td><code>compute</code></td><td>Compute shaders, structured buffers, and atomic operations are supported.<br>(Compute shader, 구조화된 버퍼, 원자 연산이 지원됩니다.)</td></tr><tr><td><code>randomwrite</code>&nbsp;or&nbsp;<code>uav</code></td><td>“Random write” (UAV) textures are supported.<br>(&#8220;랜덤 쓰기&#8221;(UAV) 텍스처가 지원됩니다.)</td></tr><tr><td><code>tesshw</code></td><td>Hardware tessellation is supported, but not necessarily tessellation (hull/domain) shader stages. <br>(하드웨어 테셀레이션이 지원되지만, 테셀레이션(hull/domain) shader 단계는 필수적으로 지원되지는 않습니다. )<br>For example, Metal supports tessellation, but not hull or domain stages.<br>(예를 들어, Metal은 테셀레이션을 지원하지만 hull 또는 domain 단계를 지원하지 않습니다.)</td></tr><tr><td><code>tessellation</code></td><td>Tessellation (hull/domain) shader stages are supported.<br>(테셀레이션(hull/domain) shader 단계가 지원됩니다.)</td></tr><tr><td><code>msaatex</code></td><td>The ability to access multi-sampled textures (Texture2DMS in HLSL) is supported.<br>(멀티 샘플링된 텍스처(Texture2DMS in HLSL)에 접근할 수 있는 기능이 지원됩니다.)</td></tr><tr><td><code>sparsetex</code></td><td>Sparse textures with residency info (“Tier2” support in DirectX terms;&nbsp;<code>CheckAccessFullyMapped</code>&nbsp;HLSL function).<br>(레지던시 정보가 포함된 Sparse 텍스처(DirectX 용어로 “Tier2” 지원; HLSL 함수 <code>CheckAccessFullyMapped</code>).)</td></tr><tr><td><code>framebufferfetch</code>&nbsp;or&nbsp;<code>fbfetch</code></td><td>Framebuffer fetch (the ability to read input pixel color in the pixel shader) is supported.<br>(프레임버퍼 패치(pixel shader에서 입력 픽셀 색상을 읽을 수 있는 기능)가 지원됩니다.)</td></tr><tr><td><code>setrtarrayindexfromanyshader</code></td><td>Setting the render target array index from any shader stage (not just the geometry shader stage) is supported.<br>(Geometry shader 단계뿐만 아니라 모든 shader 단계에서 렌더 타겟 배열 인덱스를 설정할 수 있는 기능이 지원됩니다.)</td></tr><tr><td>inlineraytracing</td><td>Inline&nbsp;<strong>ray tracing</strong> is supported, so you can generate ray queries in the&nbsp;<strong>rasterization</strong> and compute stages of a shader. <br>(인라인 레이 트레이싱이 지원되어, 쉐이더의 래스터화 및 컴퓨팅 단계에서 레이 쿼리를 생성할 수 있습니다.)<br>Refer to&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/ScriptReference/SystemInfo-supportsInlineRayTracing.html" target="_blank" rel="noreferrer noopener">SystemInfo.supportsInlineRayTracing</a>&nbsp;for more information.<br>(자세한 내용은 <code><a href="https://docs.unity3d.com/2023.2/Documentation/ScriptReference/SystemInfo-supportsInlineRayTracing.html" target="_blank" rel="noreferrer noopener">SystemInfo.supportsInlineRayTracing</a></code>을 참조하세요.)</td></tr></tbody></table></figure>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">Targeting graphics APIs and platforms in HLSL<br>(HLSL에서 그래픽 API 및 플랫폼 타겟팅)</h3>



<p>Some&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-PragmaDirectives.html" target="_blank" rel="noreferrer noopener"><code>#pragma</code>&nbsp;directives</a>&nbsp;take parameters that allow you to target specific graphics APIs and platforms.<br>(일부 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-PragmaDirectives.html" target="_blank" rel="noreferrer noopener"><code>#pragma</code> 지시어</a>는 특정 그래픽 API 및 플랫폼을 타겟팅할 수 있는 매개변수를 받습니다.)</p>



<p>This page contains information on using those directives, and provides a list of valid parameter values.<br>(이 페이지는 이러한 지시어 사용에 대한 정보를 제공하며, 유효한 매개변수 값 목록을 제공합니다.)</p>



<h4 class="wp-block-heading">Including or excluding graphics APIs<br>(그래픽 API 포함 또는 제외)</h4>



<p>By default, Unity compiles all&nbsp;<strong>shader</strong> programs for each graphics API in the list for the current build target.<br>(기본적으로 Unity는 현재 빌드 타겟의 목록에 있는 각 그래픽 API에 대해 모든 <strong>shader</strong> 프로그램을 컴파일합니다.)</p>



<p>Sometimes, you might want to compile certain shader programs only for certain graphics APIs; for example, if you use features that are not supported on all platforms.<br>(때로는 특정 그래픽 API에만 Shader 프로그램을 컴파일하고 싶을 수 있습니다. 예를 들어, 모든 플랫폼에서 지원되지 않는 기능을 사용할 경우입니다.)</p>



<p>To compile a shader program only for given APIs, use the&nbsp;<code>#pragma only_renderers</code>&nbsp;directive. You can pass multiple values, space delimited.<br>(특정 API에 대해서만  shader 프로그램을 컴파일하려면 <code>#pragma only_renderers</code> 지시어를 사용하십시오. 여러 값을 공백으로 구분하여 전달할 수 있습니다.)</p>



<p>This example demonstrates how to compile shaders only for Metal and Vulkan:<br>(다음 예는 Metal 및 Vulkan에 대해서만 shader를 컴파일하는 방법을 보여줍니다.)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#pragma only_renderers metal vulkan</pre>



<p>To exclude shader code from compilation by given compilers, use the&nbsp;<code>#pragma exclude_renderers</code>&nbsp;directive.<br>(특정 컴파일러에서 쉐이더 코드를 컴파일하지 않으려면 <code>#pragma exclude_renderers</code> 지시어를 사용하십시오. )</p>



<p>You can pass multiple values, space delimited.<br>(여러 값을 공백으로 구분하여 전달할 수 있습니다.)</p>



<p>This example demonstrates how to exclude a shader from compilation for Metal and Vulkan:<br>(다음 예는 Metal 및 Vulkan에 대한 shader 컴파일을 제외하는 방법을 보여줍니다.)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#pragma exclude_renderers metal vulkan</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">Generating shader variants for graphics tiers for a given graphics API<br>(주어진 그래픽 API에 대한 그래픽 티어의 shdaer 변형 생성)</h4>



<p>In the Built-in&nbsp;<strong>Render Pipeline</strong>, Unity automatically generates&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-variants.html" target="_blank" rel="noreferrer noopener">shader variants</a> that correspond to&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/graphics-tiers.html" target="_blank" rel="noreferrer noopener">graphics tiers</a>&nbsp;under certain conditions.<br>(Built-in&nbsp;<strong>Render Pipeline</strong>에서 Unity는 특정 조건 하에 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/graphics-tiers.html" target="_blank" rel="noreferrer noopener">graphics tiers</a>에 해당하는 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-variants.html" target="_blank" rel="noreferrer noopener">shader variants</a>을 자동으로 생성합니다.)</p>



<p>You can also force Unity to generate these variants, if required.<br>(필요시 Unity에 강제로 이러한 변형을 생성하게 할 수 있습니다.)</p>



<p>To do this, use the&nbsp;<code>#pragma hardware_tier_variants</code>&nbsp;preprocessor directive and specify the graphics APIs for which you want to generate tier shader variants.<br>(이를 위해 <code>#pragma hardware_tier_variants</code> 전처리 지시어를 사용하고 tier shader 변형을 생성하려는 그래픽 API를 지정하십시오.)</p>



<p>For example, this instructs Unity to compile tier shader variants for Metal:<br>(예를 들어, 이는 Unity가 Metal에 대한 tier shader 변형을 컴파일하도록 지시합니다.)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#pragma hardware_tier_variants metal</pre>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">List of valid parameter values (유효한 매개변수 값 목록)</h4>



<p>Supported values are:<br>(지원되는 값은 다음과 같습니다:)</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th><strong>Value</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><code>d3d11</code></td><td>DirectX 11 feature level 10 and above, DirectX 12</td></tr><tr><td><code>gles3</code></td><td>OpenGL ES 3.x,&nbsp;<strong>WebGL</strong> 2.0</td></tr><tr><td><code>ps4</code></td><td>PlayStation 4</td></tr><tr><td><code>xboxone</code></td><td>Xbox One and GameCore, DirectX 11 and DirectX 12</td></tr><tr><td><code>metal</code></td><td>iOS/Mac Metal</td></tr><tr><td><code>glcore</code></td><td>OpenGL 3.x, OpenGL 4.x</td></tr><tr><td><code>vulkan</code></td><td>Vulkan</td></tr><tr><td><code>switch</code></td><td>Nintendo Switch</td></tr><tr><td><code>ps5</code></td><td>PlayStation 5</td></tr></tbody></table></figure>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">Declaring and using shader keywords in HLSL<br>(HLSL에서 쉐이더 키워드 선언 및 사용)</h3>



<p>You can declare&nbsp;<strong>shader</strong> keywords so shaders behave differently when you enable or disable the keywords.<br>(<strong>shader</strong>키워드를 선언하여 키워드를 활성화하거나 비활성화할 때 shader가 다르게 동작하도록 할 수 있습니다.)</p>



<p>You can declare shader keywords in regular graphics shaders including&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-SurfaceShaders.html" target="_blank" rel="noreferrer noopener">surface shaders</a>, and&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/class-ComputeShader.html">comp</a><a href="https://docs.unity3d.com/2023.2/Documentation/Manual/class-ComputeShader.html" target="_blank" rel="noreferrer noopener">u</a><a href="https://docs.unity3d.com/2023.2/Documentation/Manual/class-ComputeShader.html">te shaders</a>.<br>(regular graphics shaders 및 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-SurfaceShaders.html" target="_blank" rel="noreferrer noopener">surface shaders</a>, <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/class-ComputeShader.html">comp</a><a href="https://docs.unity3d.com/2023.2/Documentation/Manual/class-ComputeShader.html" target="_blank" rel="noreferrer noopener">u</a><a href="https://docs.unity3d.com/2023.2/Documentation/Manual/class-ComputeShader.html">te shaders</a>에서 shader 키워드를 선언할 수 있습니다.)</p>



<h4 class="wp-block-heading">Declare shader keywords using pragma<br>(pragma를 사용한 shader 키워드 선언)</h4>



<p>To declare shader keywords, use a&nbsp;<code>#pragma</code>&nbsp;directive in the HLSL code. For example:<br>(shader 키워드를 선언하려면 HLSL 코드에서 <code>#pragma</code> 지시어를 사용하십시오. 예를 들어:)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#pragma shader_feature REFLECTION_TYPE1 REFLECTION_TYPE2 REFLECTION_TYPE3</pre>



<p>You can use one of the following shader directives:<br>(다음 쉐이더 지시어 중 하나를 사용할 수 있습니다:)</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th class="has-text-align-left" data-align="left"><strong>Shader directive</strong></th><th class="has-text-align-left" data-align="left"><strong>Branching type</strong></th><th class="has-text-align-left" data-align="left"><strong>Shader variants Unity creates</strong></th></tr></thead><tbody><tr><td class="has-text-align-left" data-align="left"><code>shader_feature</code></td><td class="has-text-align-left" data-align="left"><a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-branching.html#static-branching" target="_blank" rel="noreferrer noopener">Static branching</a></td><td class="has-text-align-left" data-align="left">Variants for keyword combinations you enable at build time<br>빌드 시점에서 활성화한 키워드 조합에 대한 변형을 생성합니다.</td></tr><tr><td class="has-text-align-left" data-align="left"><code>multi_compile</code></td><td class="has-text-align-left" data-align="left">Static branching</td><td class="has-text-align-left" data-align="left">Variants for every possible combination of keywords<br>가능한 모든 키워드 조합에 대한 변형을 생성합니다.</td></tr><tr><td class="has-text-align-left" data-align="left"><code>dynamic_branch</code></td><td class="has-text-align-left" data-align="left"><a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-branching.html#dynamic-branching" target="_blank" rel="noreferrer noopener">Dynamic branching</a></td><td class="has-text-align-left" data-align="left">No variants<br>변형을 생성하지 않습니다.</td></tr></tbody></table></figure>



<p>Read more about&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-conditionals.html" target="_blank" rel="noreferrer noopener">when to use which shader directive</a>.<br>(어떤 shader 지시어를 사용할지에 대한 추가 정보는 따로 참조하세요.)</p>



<p>See&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-keywords.html#keyword-limits" target="_blank" rel="noreferrer noopener">shader keyword limits</a>.<br>(<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-keywords.html#keyword-limits" target="_blank" rel="noreferrer noopener">shader 키워드 제한 사항</a>을 참조하세요.)</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">How sets of keywords work (키워드 집합이 작동하는 방식)</h4>



<p>The keywords in a single&nbsp;<code>#pragma</code>&nbsp;statement are together called a ‘set’. <br>(단일 <code>#pragma</code> 문에 포함된 키워드는 ‘집합’이라고 합니다.)</p>



<p>You can enable or disable multiple keywords in a set at the same time.<br>( 한 번에 여러 키워드를 활성화하거나 비활성화할 수 있습니다.)</p>



<p>For example, to declare a set of three keywords:<br>(예를 들어, 세 개의 키워드 집합을 선언하려면:)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#pragma shader_feature REFLECTION_TYPE1 REFLECTION_TYPE2 REFLECTION_TYPE3</pre>



<p>You can declare multiple sets of keywords in a single shader. For example, to create 2 sets:<br>(단일 shader에서 여러 키워드 집합을 선언할 수 있습니다. 예를 들어, 두 개의 집합을 만들려면:)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#pragma shader_feature REFLECTION_TYPE1 REFLECTION_TYPE2 REFLECTION_TYPE3
#pragma shader_feature RED GREEN BLUE WHITE</pre>



<p>You can’t do the following:<br>(다음은 할 수 없습니다:)</p>



<ul class="wp-block-list">
<li>&#8211; Include two keywords with the same name in one set.<br>(한 집합에 동일한 이름의 키워드를 포함할 수 없습니다.)</li>



<li>&#8211; Include duplicate keyword sets in one shader.<br>(하나의 shader에서 중복된 키워드 집합을 포함할 수 없습니다.)</li>



<li>&#8211; Declare a keyword as both&nbsp;<code>dynamic_branch</code>&nbsp;and&nbsp;<code>shader_feature</code>&nbsp;or&nbsp;<code>multi_compile</code>&nbsp;&#8211; Unity uses&nbsp;<code>dynamic_branch</code>&nbsp;if you do this.<br>(<code>dynamic_branch</code>와 <code>shader_feature</code> 또는 <code>multi_compile</code>을 동시에 선언할 수 없습니다. Unity는 이 경우 <code>dynamic_branch</code>를 사용합니다.)</li>
</ul>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">Make shader behavior conditional (쉐이더 동작을 조건부로 설정)</h4>



<p>To mark parts of your shader code conditional based on whether you enable or disable a shader keyword, use&nbsp;<a href="https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-if" target="_blank" rel="noreferrer noopener">an HLSL if statement</a>.<br>(shader 키워드의 활성화 여부에 따라 shader 코드의 일부를 조건부로 설정하려면 <a href="https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-if" target="_blank" rel="noreferrer noopener">HLSL의 <code>if</code> 문</a>을 사용하십시오.)</p>



<p>For example:<br>(예를 들어:)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#pragma multi_compile QUALITY_LOW QUALITY_MED QUALITY_HIGH

if (QUALITY_LOW)
{
    // code for low quality setting
    // 저품질 설정에 대한 코드
}
</pre>



<p>You can enable and disable keywords&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-keywords-material-inspector.html" target="_blank" rel="noreferrer noopener">using the Inspector</a>&nbsp;or&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-keywords-scripts.html" target="_blank" rel="noreferrer noopener">C# scripting</a>.<br>(<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-keywords-material-inspector.html" target="_blank" rel="noreferrer noopener">Inspector</a>나 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-keywords-scripts.html" target="_blank" rel="noreferrer noopener">C# 스크립팅</a>을 사용하여 키워드를 활성화하거나 비활성화할 수 있습니다.)</p>



<p>What Unity does with your shader code depends on which shader directive you use.<br>(Unity가 shader 코드에서 하는 작업은 사용하는 shader 지시어에 따라 다릅니다.)</p>



<p>If you use&nbsp;<code>dynamic_branch</code>, Unity creates a uniform Boolean variable for each keyword.<br>(만약 <code>dynamic_branch</code>를 사용하면, Unity는 각 키워드에 대해 uniform Boolean 변수를 생성합니다.)</p>



<p>When you enable a keyword, Unity sets the Boolean for that variable to&nbsp;<code>true</code>, and your GPU switches to using the code in the&nbsp;<code>if</code>&nbsp;statement for that keyword. <br>(키워드를 활성화하면 Unity는 해당 변수를 true로 설정하고 GPU가 해당 키워드의 <code>if</code> 문 코드를 사용하도록 전환합니다.)</p>



<p>This is dynamic branching.<br>(이것이 동적 분기입니다.)</p>



<p>If you use&nbsp;<code>shader_feature</code>&nbsp;or&nbsp;<code>multi_compile</code>, Unity creates separate&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-variants.html" target="_blank" rel="noreferrer noopener">shader varia</a><a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-variants.html">nts</a> for each keyword state. <br>(<code>shader_feature</code>나 <code>multi_compile</code>을 사용하는 경우 Unity는 각 키워드 상태에 대해 별도의 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-variants.html">shader variants</a>을 생성합니다.)</p>



<p>Each variant contains the code from an&nbsp;<code>if</code>&nbsp;branch for that keyword. <br>(각 변형은 해당 키워드의 <code>if</code> 분기 코드를 포함합니다.)</p>



<p>When you enable a keyword, Unity sends the matching variant to your GPU. This is static branching.<br>(키워드를 활성화하면 Unity는 해당 variant을 GPU로 보냅니다. 이것이 정적 분기입니다.)</p>



<p>Read more about&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-conditionals.html" target="_blank" rel="noreferrer noopener">when to use which shader directive</a>.<br>(어떤 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/shader-conditionals.html" target="_blank" rel="noreferrer noopener">shader 지시어를 사용할지에</a> 대한 추가 정보는 따로 참조하세요.)</p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">Use other statements to make shader behavior conditional<br>(다른 명령문을 사용하여 Shader 동작을 조건부로 설정)</h4>



<p>You can also use the following HLSL statements to create conditional code:<br>(다음 HLSL 명령문을 사용하여 조건부 코드를 만들 수 있습니다:)</p>



<ul class="wp-block-list">
<li>&#8211; <a href="https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-appendix-pre-if" target="_blank" rel="noreferrer noopener"><code>#if, #elif, #else and #endif</code></a>.
<ul class="wp-block-list">
<li>&#8211; <a href="https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-appendix-pre-ifdef" target="_blank" rel="noreferrer noopener"><code>#ifdef and #ifndef</code></a>.</li>
</ul>
</li>
</ul>



<p>Using these instead of&nbsp;<code>if</code>&nbsp;makes it more difficult to change the&nbsp;<code>#pragma</code>&nbsp;keyword directive later.<br>(이 명령문들을 <code>if</code> 대신 사용하는 것은 나중에 <code>#pragma</code> 키워드 지시어를 변경하기 어렵게 만듭니다.)</p>



<p>For example, if you need to reduce the number of shader variants, it’s more difficult to change&nbsp;<code>multi_compile</code>&nbsp;to&nbsp;<code>shader_feature</code>.<br>(예를 들어, shader 변형의 수를 줄여야 할 경우 <code>multi_compile</code>을 <code>shader_feature</code>로 변경하기가 더 어려워집니다.)</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">Make keywords local (키워드를 로컬로 만들기)</h4>



<p>Keywords are global by default.<br>(키워드는 기본적으로 전역입니다.)</p>



<p>Add&nbsp;<code>_local</code>&nbsp;to the shader directive to make the keywords local. <br>(키워드를 로컬로 만들려면 쉐이더 지시어에 <code>_local</code>을 추가하십시오.)</p>



<p>If you enable or disable a global keyword, you don’t affect the state of local keywords with the same name.<br>(전역 키워드를 활성화하거나 비활성화해도 동일한 이름을 가진 로컬 키워드의 상태에 영향을 미치지 않습니다.)</p>



<p>For example:<br>(예를 들어:)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#pragma shader_feature_local QUALITY_LOW QUALITY_MED QUALITY_HIGH</pre>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">Restrict keywords to shader stages (키워드를 쉐이더 단계로 제한)</h4>



<p>When you declare a keyword, Unity assumes all stages of the shader contain conditional code for that keyword.<br>(키워드를 선언할 때 Unity는 쉐이더의 모든 단계에 대해 해당 키워드에 대한 조건부 코드가 포함된 것으로 간주합니다.)</p>



<p>You can add the following suffixes to indicate that only certain stages contain conditional code for a keyword. <br>(다음 접미사를 추가하여 특정 단계에만 조건부 코드가 포함되어 있음을 나타낼 수 있습니다.)</p>



<p>This helps Unity strip unneeded shader variants.<br>(이는 Unity가 불필요한 쉐이더 변형을 제거하는 데 도움이 됩니다.)</p>



<ul class="wp-block-list">
<li><code>_vertex</code></li>



<li><code>_fragment</code></li>



<li><code>_hull</code></li>



<li><code>_domain</code></li>



<li><code>_geometry</code></li>



<li><code>_raytracing</code></li>
</ul>



<p>For example, use&nbsp;<code>#pragma shader_feature_fragment RED GREEN BLUE</code>&nbsp;to indicate that you use the 3 keywords to create conditional code in the fragment stage only.<br>(예를 들어, <code>#pragma shader_feature_fragment RED GREEN BLUE</code>를 사용하여 세 가지 키워드를 사용해 fragment 단계에서만 조건부 코드를 생성함을 나타냅니다.)</p>



<p>You can’t add these suffixes to&nbsp;<code>#pragma dynamic_branch</code>&nbsp;because&nbsp;<code>dynamic_branch</code>&nbsp;doesn’t create variants.<br>(<code>dynamic_branch</code>는 변형을 생성하지 않기 때문에 이 접미사를 추가할 수 없습니다.)</p>



<p>These suffixes may behave differently or have no effect depending on the&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/ScriptReference/Rendering.GraphicsDeviceType.html">graphics API</a>:<br>(이 접미사는 <a href="https://docs.unity3d.com/2023.2/Documentation/ScriptReference/Rendering.GraphicsDeviceType.html" target="_blank" rel="noreferrer noopener">그래픽 API</a>에 따라 다르게 작동하거나 아무런 효과가 없을 수 있습니다:)</p>



<ul class="wp-block-list">
<li>&#8211; The suffixes have no effect on OpenGL, OpenGL ES or Vulkan.<br>(이 접미사는 OpenGL, OpenGL ES 또는 Vulkan에서는 효과가 없습니다.)</li>



<li>&#8211; The&nbsp;<code>_geometry</code>&nbsp;and&nbsp;<code>_raytracing</code>&nbsp;suffixes have no effect on Metal, and Metal treats&nbsp;<code>_vertex</code>,&nbsp;<code>_hull</code>&nbsp;and&nbsp;<code>_domain</code>&nbsp;as a single stage.<br>(<code>_geometry</code> 및 <code>_raytracing</code> 접미사는 Metal에서는 효과가 없으며, Metal은 <code>_vertex</code>, <code>_hull</code>, <code>_domain</code>을 하나의 단계로 처리합니다.)</li>
</ul>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">Restrict keywords to shader models and GPU features<br>(키워드를 shader 모델과 GPU 기능으로 제한)</h4>



<p>You can add keywords to&nbsp;<code>#pragma require</code>&nbsp;and&nbsp;<code>#pragma target</code>&nbsp;directives, so conditional code only runs if the current hardware uses a particular shader model or GPU feature.<br>(<code>#pragma require</code> 및 <code>#pragma target</code> 지시어에 키워드를 추가하여 현재 하드웨어가 특정 쉐이더 모델 또는 GPU 기능을 사용하는 경우에만 조건부 코드가 실행되도록 할 수 있습니다.)</p>



<p>For more information, see&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderCompileTargets.html" target="_blank" rel="noreferrer noopener">Targeting shader models and GPU features in HLSL</a>.<br>(자세한 내용은 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderCompileTargets.html" target="_blank" rel="noreferrer noopener">HLSL에서 쉐이더 모델 및 GPU 기능 타겟팅을 참조</a>하십시오.)</p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">Create a shader variant for disabled keywords<br>(비활성화된 키워드에 대한 shader 변형 생성)</h4>



<p>If you use&nbsp;<code>shader_feature</code>&nbsp;to create a single keyword, Unity automatically creates a second variant for when the feature is disabled. <br>(단일 키워드를 생성하기 위해 <code>shader_feature</code>를 사용하는 경우, Unity는 해당 기능이 비활성화될 때 두 번째 변형을 자동으로 생성합니다.)</p>



<p>This helps reduce the number of keywords you need to enable and disable. <br>(이는 활성화 및 비활성화해야 하는 키워드 수를 줄이는 데 도움이 됩니다.)</p>



<p>For example, the following code creates 2 variants:<br>(예를 들어, 다음 코드는 2개의 변형을 생성합니다:)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#pragma shader_feature EXAMPLE_ON</pre>



<p>If you use&nbsp;<code>multi_compile</code>, or you use&nbsp;<code>shader_feature</code>&nbsp;to create a set of two or more keywords, you can use&nbsp;<code>_</code>&nbsp;when you declare a keyword set. <br>(<code>multi_compile</code>을 사용하거나 <code>shader_feature</code>를 사용하여 두 개 이상의 키워드 집합을 생성하는 경우, 키워드 집합을 선언할 때 <code>_</code>를 사용할 수 있습니다.)</p>



<p>Unity creates a shader variant for situations when all keywords in that set are disabled.<br>(Unity는 해당 집합의 모든 키워드가 비활성화된 상황에 대한 shader변형을 생성합니다.)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#pragma multi_compile _ EXAMPLE_ON
#pragma shader_feature _ RED GREEN BLUE WHITE</pre>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">Use shortcuts to create keyword sets<br>(단축어를 사용하여 키워드 집합 생성)</h4>



<p>You can use Unity shader directive shortcuts to create sets of shader variants.<br>(Unity shader 지시어 단축어를 사용하여 shader 변형 집합을 생성할 수 있습니다.)</p>



<p>The following example explains how to add&nbsp;<code>SHADOWS_DEPTH</code>&nbsp;and&nbsp;<code>SHADOWS_CUBE</code>&nbsp;variants:<br>(다음 예는 <code>SHADOWS_DEPTH</code> 및 <code>SHADOWS_CUBE</code> 변형을 추가하는 방법을 설명합니다:)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#pragma multi_compile_shadowcaster</pre>



<p>You can remove keywords you don’t need using&nbsp;<code>skip_variants</code>. <br>(<code>skip_variants</code>를 사용하여 필요하지 않은 키워드를 제거할 수 있습니다.)</p>



<p>For example, use the following to remove&nbsp;<code>POINT</code>&nbsp;and&nbsp;<code>POINT_COOKIES</code>&nbsp;variants when Unity generates variants from&nbsp;<code>multi_compile_fwdadd</code>.<br>(예를 들어, Unity가 <code>multi_compile_fwdadd</code>에서 변형을 생성할 때 <code>POINT</code> 및 <code>POINT_COOKIES</code> 변형을 제거하려면 다음을 사용하십시오:)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#pragma multi_compile_fwdadd
#pragma skip_variants POINT POINT_COOKIE</pre>



<p>The following shortcuts relate to light, shadow and lightmapping in the Built-in&nbsp;<strong>Render Pipeline</strong> :<br>(다음 단축어는 내장 렌더 파이프라인의 조명, 그림자 및 라이트매핑과 관련이 있습니다:)</p>



<ul class="wp-block-list">
<li><code>- multi_compile_fwdbase</code>&nbsp;adds this set of keywords:<br>(multi_compile_fwdbase는 다음과 같은 키워드 집합을 추가합니다:)<br>DIRECTIONAL LIGHTMAP_ON DIRLIGHTMAP_COMBINED DYNAMICLIGHTMAP_ON SHADOWS_SCREEN SHADOWS_SHADOWMASK LIGHTMAP_SHADOW_MIXING LIGHTPROBE_SH. <br>These variants are needed by&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/ScriptReference/Rendering.PassType.ForwardBase.html" target="_blank" rel="noreferrer noopener">PassType.ForwardBase</a>.<br>이 변형들은 <code><a href="https://docs.unity3d.com/2023.2/Documentation/ScriptReference/Rendering.PassType.ForwardBase.html" target="_blank" rel="noreferrer noopener">PassType.ForwardBase</a></code>에 필요합니다.</li>



<li><code>- multi_compile_fwdbasealpha</code>&nbsp;adds this set of keywords:<br>(<code>multi_compile_fwdadd</code>는 다음과 같은 키워드 집합을 추가합니다:)<br>DIRECTIONAL LIGHTMAP_ON DIRLIGHTMAP_COMBINED DYNAMICLIGHTMAP_ON LIGHTMAP_SHADOW_MIXING VERTEXLIGHT_ON LIGHTPROBE_SH. <br>These variants are needed by&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/ScriptReference/Rendering.PassType.ForwardBase.html">PassType.ForwardBase</a>.<br>이 변형들은 <code><a href="https://docs.unity3d.com/2023.2/Documentation/ScriptReference/Rendering.PassType.ForwardBase.html" target="_blank" rel="noreferrer noopener">PassType.ForwardBase</a></code>에 필요합니다.</li>



<li>&#8211; <code>multi_compile_fwdadd</code>&nbsp;adds this set of keywords: <br>(multi_compile_fwdadd_fullshadows는 다음과 같은 키워드 집합을 추가합니다:)<br>POINT DIRECTIONAL SPOT POINT_COOKIE DIRECTIONAL_COOKIE. <br>These variants are needed by&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/ScriptReference/Rendering.PassType.ForwardAdd.html">PassType.ForwardAdd</a>.<br>(이 변형들은 <code><a href="https://docs.unity3d.com/2023.2/Documentation/ScriptReference/Rendering.PassType.ForwardBase.html" target="_blank" rel="noreferrer noopener">PassType.ForwardBase</a></code>에 필요합니다.)</li>



<li>&#8211; <code>multi_compile_fwdadd_fullshadows</code>&nbsp;adds this set of keywords:<br>(<code>multi_compile_lightpass</code>는 다음과 같은 키워드 집합을 추가합니다:)<br>POINT DIRECTIONAL SPOT POINT_COOKIE DIRECTIONAL_COOKIE SHADOWS_DEPTH SHADOWS_SCREEN SHADOWS_CUBE SHADOWS_SOFT SHADOWS_SHADOWMASK LIGHTMAP_SHADOW_MIXING. <br>This is the same as&nbsp;<code>multi_compile_fwdadd</code>, but this adds the ability for the lights to have real-time shadows.<br>(이것은 <code>multi_compile_fwdadd</code>와 동일하지만, 실제 그림자를 위한 기능이 추가됩니다.)</li>



<li>&#8211; <code>multi_compile_lightpass</code>&nbsp;adds this set of keywords:<br>(<code>multi_compile_shadowcaster</code>는 다음과 같은 키워드 집합을 추가합니다:)<br>POINT DIRECTIONAL SPOT POINT_COOKIE DIRECTIONAL_COOKIE SHADOWS_DEPTH SHADOWS_SCREEN SHADOWS_CUBE SHADOWS_SOFT SHADOWS_SHADOWMASK LIGHTMAP_SHADOW_MIXING. <br>This is effectively a catch-all shortcut for all functionality related to real-time light and shadows, other than&nbsp;<strong>Light Probes</strong>.<br>(이것은 실시간 빛과 그림자에 관련된 모든 기능을 포함하는 단축어로, 라이트 프로브를 제외한 모든 것에 해당됩니다.)</li>



<li>&#8211; <code>multi_compile_shadowcaster</code>&nbsp;adds this set of keywords: <br>SHADOWS_DEPTH SHADOWS_CUBE. <br>These variants are needed by&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/ScriptReference/Rendering.PassType.ShadowCaster.html" target="_blank" rel="noreferrer noopener">PassType.ShadowCaster</a>.<br>(이 변형들은 <code><a href="https://docs.unity3d.com/2023.2/Documentation/ScriptReference/Rendering.PassType.ShadowCaster.html" target="_blank" rel="noreferrer noopener">PassType.ShadowCaster</a></code>에 필요합니다.)</li>



<li>&#8211; <code>multi_compile_shadowcollector</code>&nbsp;adds this set of keywords: <br>SHADOWS_SPLIT_SPHERES SHADOWS_SINGLE_CASCADE. <br>It also compiles variants without any of these keywords. These variants are needed for screen-space shadows.<br>(또한 이러한 키워드 없이 변형들을 컴파일합니다. 이 변형들은 화면 공간 그림자에 필요합니다.)</li>



<li><code>- multi_compile_prepassfinal</code>&nbsp;adds this set of keywords: <br>LIGHTMAP_ON DIRLIGHTMAP_COMBINED DYNAMICLIGHTMAP_ON UNITY_HDR_ON SHADOWS_SHADOWMASK LIGHTPROBE_SH. <br>It also compiles variants without any of these keywords. These variants are needed by&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/ScriptReference/Rendering.PassType.Deferred.html" target="_blank" rel="noreferrer noopener">PassType.Deferred</a>.<br>(또한 이러한 키워드 없이 변형들을 컴파일합니다. 이 변형들은 <code><a href="https://docs.unity3d.com/2023.2/Documentation/ScriptReference/Rendering.PassType.Deferred.html" target="_blank" rel="noreferrer noopener">PassType.Deferred</a></code>에 필요합니다.)</li>
</ul>



<p>The following shortcuts relate to other settings:<br>(<strong>다음 단축어들은 다른 설정과 관련됩니다</strong>: )</p>



<ul class="wp-block-list">
<li>&#8211; <code>multi_compile_particles</code>&nbsp;adds this keyword relating to the Built-in&nbsp;<strong>particle system</strong> : SOFTPARTICLES_ON. <br>(<code>multi_compile_particles</code>는 기본 제공 파티클 시스템과 관련된 SOFTPARTICLES_ON 키워드를 추가합니다.)<br>It also compiles variants without this keyword. For more information, see&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/Built-inParticleSystem.html" target="_blank" rel="noreferrer noopener">Built-in Particle System</a>.<br>(또한 이 키워드 없이 변형들을 컴파일합니다. 더 자세한 내용은 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/Built-inParticleSystem.html" target="_blank" rel="noreferrer noopener">Built-in Particle System</a>을 참조하십시오.)</li>



<li>&#8211; <code>multi_compile_fog</code>&nbsp;adds this set of keywords relating to fog: FOG_LINEAR, FOG_EXP, FOG_EXP2. <br>(<code>multi_compile_fog</code>는 안개와 관련된 다음과 같은 키워드 집합을 추가합니다: FOG_LINEAR, FOG_EXP, FOG_EXP2.)<br>It also compiles variants without any of these keywords. You can control this behavior in the&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/class-GraphicsSettings.html" target="_blank" rel="noreferrer noopener">Graphics settings</a>&nbsp;window.<br>(또한 이러한 키워드 없이 변형들을 컴파일합니다. 이 동작은 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/class-GraphicsSettings.html" target="_blank" rel="noreferrer noopener">그래픽 설정</a>창에서 제어할 수 있습니다.)</li>



<li>&#8211; <code>multi_compile_instancing</code>&nbsp;adds keywords relating to instancing. <br>(<code>multi_compile_instancing</code>은 인스턴싱과 관련된 키워드를 추가합니다.)<br>If the shader uses procedural instancing, it adds this set of keywords: INSTANCING_ON PROCEDURAL_ON. <br>(shader가 procedural 인스턴싱을 사용하는 경우, INSTANCING_ON과 PROCEDURAL_ON 키워드 집합을 추가합니다.)<br>Otherwise, it adds this keyword: INSTANCING_ON. It also compiles variants without any of these keywords. <br>(그렇지 않으면 INSTANCING_ON 키워드만 추가됩니다. 또한 이러한 키워드 없이 변형들을 컴파일합니다.)<br>You can control this behavior in the&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/class-GraphicsSettings.html" target="_blank" rel="noreferrer noopener">Graphics settings</a>&nbsp;window.<br>(이 동작은 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/class-GraphicsSettings.html" target="_blank" rel="noreferrer noopener">그래픽 설정</a> 창에서 제어할 수 있습니다.)</li>
</ul>



<p></p>
</div>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide" style="margin-top:var(--wp--preset--spacing--80);margin-bottom:var(--wp--preset--spacing--80)"/>



<h2 class="wp-block-heading">Shader semantics (쉐이더 의미론)</h2>



<p>When writing HLSL&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderPrograms.html" target="_blank" rel="noreferrer noopener">shader programs</a>, input and output variables need to have their “intent” indicated via&nbsp;<strong>semantics</strong>. <br>(HLSL <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderPrograms.html" target="_blank" rel="noreferrer noopener">shader programs</a>을 작성할 때, 입력 및 출력 변수는 그 <strong>“의도”</strong>를 의미론을 통해 나타내야 합니다)</p>



<p>This is a standard concept in HLSL shader language; see the&nbsp;<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/bb509647.aspx" target="_blank" rel="noreferrer noopener">Semantics documentation on MSDN</a>&nbsp;for more details.<br>(이는 HLSL 쉐이더 언어의 표준 개념으로, 자세한 내용은 <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/bb509647.aspx" target="_blank" rel="noreferrer noopener">MSDN의 의미론 문서</a>를 참조하십시오.)</p>



<h3 class="wp-block-heading">Vertex shader input semantics (정점 쉐이더 입력 의미론)</h3>



<p>The main vertex&nbsp;<strong>shader</strong>&nbsp;function (indicated by the&nbsp;<code>#pragma vertex</code>&nbsp;directive) needs to have semantics on all the input parameters.<br>(주요 정점 쉐이더 함수( <code>#pragma vertex</code> 지시어로 표시됨)에는 모든 입력 매개변수에 대한 의미론이 필요합니다.)</p>



<p>These correspond to individual&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/class-Mesh.html" target="_blank" rel="noreferrer noopener">Mesh</a> data elements, like vertex position, normal mesh, and texture coordinates.<br>(이러한 의미론은 정점 위치, 정점 법선, 텍스처 좌표와 같은 개별 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/class-Mesh.html" target="_blank" rel="noreferrer noopener">메시</a> 데이터 요소에 해당합니다.)</p>



<p>See&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-VertexProgramInputs.html" target="_blank" rel="noreferrer noopener">vertex program inputs</a>&nbsp;for more details.<br>(더 자세한 내용은 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-VertexProgramInputs.html" target="_blank" rel="noreferrer noopener">정점 프로그램 입력</a>을 참조하십시오.)</p>



<p>Here’s an example of a simple&nbsp;<strong>vertex shader</strong> that takes vertex position and a texture coordinate as an input.<br>(다음은 정점 위치와 텍스처 좌표를 입력으로 받는 간단한 <strong>정점 shader</strong>의 예입니다.)</p>



<p> The&nbsp;<strong>pixel</strong> shader visualizes the texture coordinate as a color.<br>(<strong>픽셀 </strong>shader는 텍스처 좌표를 색상으로 시각화합니다.)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Shader "Unlit/Show UVs"
{
    SubShader
    {
        Pass
        {
            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag

            struct v2f {
                float2 uv : TEXCOORD0;
                float4 pos : SV_POSITION;
            };

            v2f vert (
                float4 vertex : POSITION, // vertex position input
                float2 uv : TEXCOORD0 // first texture coordinate input
                )
            {
                v2f o;
                o.pos = UnityObjectToClipPos(vertex);
                o.uv = uv;
                return o;
            }

            fixed4 frag (v2f i) : SV_Target
            {
                return fixed4(i.uv, 0, 0);
            }
            ENDCG
        }
    }
}</pre>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-image size-full"><img decoding="async" width="396" height="295" src="https://lycos7560.com/wp-content/uploads/2024/09/image.png" alt="" class="wp-image-38239" srcset="https://lycos7560.com/wp-content/uploads/2024/09/image.png 396w, https://lycos7560.com/wp-content/uploads/2024/09/image-300x223.png 300w" sizes="(max-width: 396px) 100vw, 396px" /></figure>



<p>Instead of spelling out all individual inputs one by one, it’s also possible to declare a structure of them, and indicate semantics on each individual member variable of the struct.<br>(개별 입력을 하나씩 나열하는 대신, 입력들을 구조체로 선언하고 구조체의 각 멤버 변수에 의미론을 지정할 수도 있습니다.)</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">Fragment shader output semantics (프래그먼트(픽셀) 쉐이더 출력 의미론)</h3>



<p>Most often a fragment (pixel) shader outputs a color, and has an&nbsp;<code>SV_Target</code>&nbsp;semantic. The fragment shader in the example above does exactly that:<br>(대부분의 경우, 프래그먼트(픽셀) 쉐이더는 색상을 출력하며, <code>SV_Target</code> 의미론을 가집니다. 위의 예제에서 프래그먼트 쉐이더는 정확히 이 작업을 수행합니다.)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">struct fragOutput {
    fixed4 color : SV_Target;
};
fragOutput frag (v2f i)
{
    fragOutput o;
    o.color = fixed4(i.uv, 0, 0);
    return o;
}</pre>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p>Returning structures from the fragment shader is mostly useful for shaders that don’t just return a single color. <br>(fragment shader에서 구조체를 반환하는 것은 단일 색상 외에 여러 값을 반환해야 하는 shader에 유용합니다.)</p>



<p>Additional semantics supported by the fragment shader outputs are as follows.<br>(fragment shader 출력에서 지원하는 추가 의미론은 다음과 같습니다.)</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">SV_TargetN: Multiple render targets</h4>



<p><code>SV_Target1</code>,&nbsp;<code>SV_Target2</code>, etc.: These are additional colors written by the shader. <br>(<code>SV_Target1</code>, <code>SV_Target2</code> 등은 쉐이더가 추가로 작성하는 색상 값입니다.)</p>



<p>This is used when rendering into more than one render target at once (known as the Multiple Render Targets rendering technique, or MRT).&nbsp;<code>SV_Target0</code>&nbsp;is the same as&nbsp;<code>SV_Target</code>.<br>(이는 한 번에 여러 렌더 타겟에 렌더링할 때 사용됩니다(MRT, Multiple Render Targets 렌더링 기술). <code>SV_Target0</code>은 <code>SV_Target</code>과 동일합니다.)</p>



<h4 class="wp-block-heading">SV_Depth: Pixel shader depth output</h4>



<p>Usually the fragment shader doesn’t override the Z buffer value, and a default value is used from the regular triangle&nbsp;<strong>rasterization</strong><br><strong><a href="https://docs.unity3d.com/2023.2/Documentation/Manual/Glossary.html#Rasterization"></a></strong>. <br>(일반적으로 프래그먼트 shader는 Z 버퍼 값을 덮어쓰지 않으며, 기본 값은 일반적인 삼각형 래스터화에서 사용됩니다.)</p>



<p>However, for some effects it’s useful to output custom Z buffer depth values per pixel.<br>(그러나 일부 효과에서는 픽셀별로 사용자 정의 Z 버퍼 깊이 값을 출력하는 것이 유용할 수 있습니다.)</p>



<p>Note that on many GPUs this turns off some&nbsp;<strong>depth buffer</strong> optimizations, so don’t override Z buffer value without a good reason.<br>많은 GPU에서 이 작업을 수행하면 <strong>depth buffer</strong> 최적화가 비활성화될 수 있으므로, 특별한 이유 없이 Z 버퍼 값을 덮어쓰지 않는 것이 좋습니다.</p>



<p>The cost incurred by&nbsp;<code>SV_Depth</code>&nbsp;varies depending on the GPU architecture, but overall it’s fairly similar to the cost of alpha testing (using the built-in&nbsp;<code>clip()</code>&nbsp;function in HLSL).<br>(<code>SV_Depth</code>로 인한 비용은 GPU 아키텍처에 따라 다르지만, 대체로 알파 테스트(내장된 <code>clip()</code> 함수 사용)와 비슷한 비용을 가집니다.)</p>



<p>Render shaders that modify depth after all regular opaque shaders (for example, by using the&nbsp;<code>AlphaTest</code>&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-SubShaderTags.html" target="_blank" rel="noreferrer noopener">rendering queue</a>.<br>(모든 일반 불투명 쉐이더 후에 깊이를 수정하는 렌더 쉐이더(예: <code>AlphaTest</code> <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-SubShaderTags.html" target="_blank" rel="noreferrer noopener">렌더링 큐</a>를 사용하는 경우)에서 사용됩니다.)</p>



<p>The depth output value needs to be a single&nbsp;<code>float</code>.<br>(깊이 출력 값은 단일 <code>float</code> 값이어야 합니다.)</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">Vertex shader outputs and fragment shader inputs<br>(Vertex shader 출력과 fragment shader 입력)</h3>



<p>A vertex shader needs to output the final clip space position of a vertex, so that the GPU knows where on the screen to rasterize it, and at what depth. <br>(vertex shader는 꼭지점의 최종 클립 공간 위치를 출력해야 하며, 그래야 GPU가 화면 어디에 그리며 어느 깊이에서 rasterize해야 할지 알 수 있습니다.)</p>



<p>This output needs to have the&nbsp;<code>SV_POSITION</code>&nbsp;semantic, and be of a&nbsp;<code>float4</code>&nbsp;type.<br>(이 출력 값은 SV_POSITION 의미론을 가져야 하며, float4 타입이어야 합니다.)</p>



<p>Any other outputs (“interpolators” or “varyings”) produced by the vertex shader are whatever your particular shader needs.<br>(vertex shader 생성되는 다른 출력들(“보간자” 또는 “변화값”)은 shader에서 필요한 값들입니다. )</p>



<p>The values output from the vertex shader will be interpolated across the face of the rendered triangles, and the values at each pixel will be passed as inputs to the fragment shader.<br>(vertex shader에서 출력된 값들은 렌더링된 삼각형 면 전체에 걸쳐 보간되며, 각 픽셀의 값들은 fragment shader로 입력됩니다.)</p>



<p>Many modern GPUs don’t really care what semantics these variables have; however some old systems (most notably, shader model 2 GPUs) did have special rules about the semantics:<br>(대부분의 최신 GPU는 이 변수들이 어떤 의미론을 가지는지 신경 쓰지 않습니다. 그러나 일부 구형 시스템(특히 shader 모델 2 GPU)은 의미론에 대한 특별한 규칙이 있었습니다.)</p>



<ul class="wp-block-list">
<li>&#8211; <code>TEXCOORD0</code>,&nbsp;<code>TEXCOORD1</code>&nbsp;etc are used to indicate arbitrary high precision data such as texture coordinates and positions.<br>(TEXCOORD0, TEXCOORD1 등은 텍스처 좌표나 위치와 같은 임의의 고정밀 데이터를 나타내는 데 사용됩니다.)</li>



<li>&#8211; <code>COLOR0</code>&nbsp;and&nbsp;<code>COLOR1</code>&nbsp;semantics on vertex outputs and fragment inputs are for low-precision, 0–1 range data (like simple color values).<br>(vertex 출력과 fragment 입력에서 COLOR0과 COLOR1 의미론은 저정밀도, 0–1 범위의 데이터를 나타내며, 간단한 색상 값과 같은 데이터를 다룹니다.)</li>
</ul>



<p>For best cross platform support, label vertex outputs and fragment inputs as&nbsp;<code>TEXCOORDn</code>&nbsp;semantics.<br>(최적의 플랫폼 호환성을 위해 버텍스 출력과 프래그먼트 입력은 TEXCOORDn 의미론으로 지정하는 것이 좋습니다.)</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">Interpolator count limits (보간자 개수 제한)</h4>



<p>There are limits to how many interpolator variables can be used in total to pass the information from the vertex into the fragment shader.<br>(vertex에서 fragment shader로 정보를 전달하는 데 사용할 수 있는 보간자 변수의 총 개수에는 제한이 있습니다.)</p>



<p> The limit depends on the platform and GPU, and the general guidelines are:<br>(이 제한은 플랫폼과 GPU에 따라 다르며, 일반적인 가이드는 다음과 같습니다.)</p>



<ul class="wp-block-list">
<li><strong>&#8211; Up to 8 interpolators</strong>: <br>(최대 8개의 보간자: )<br>Direct3D 11 9.x level (Windows Phone) . Since the interpolator count is limited, but each interpolator can be a 4-component vector, some shaders pack things together to stay within limits. For example, you can pass two texture coordinates in one&nbsp;<code>float4</code>&nbsp;variable (.xy for one coordinate, .zw for the second coordinate).<br>(Direct3D 11 9.x 수준 (Windows Phone). 보간자 개수가 제한되어 있지만, 각 보간자는 4개의 구성 요소로 이루어진 벡터일 수 있기 때문에, 일부 쉐이더는 제한 내에서 값을 패킹합니다. 예를 들어, 두 개의 텍스처 좌표를 하나의 float4 변수(.xy는 첫 번째 좌표, .zw는 두 번째 좌표)로 전달할 수 있습니다.)</li>



<li><strong>&#8211; Up to 10 interpolators</strong>: Shader model 3.0 (<code>#pragma target 3.0</code>).<br>(최대 10개의 보간자: 쉐이더 모델 3.0 (#pragma target 3.0).)</li>



<li><strong>&#8211; Up to 16 interpolators</strong>: OpenGL ES 3.0 (Android), Metal (iOS).<br>(최대 16개의 보간자: OpenGL ES 3.0 (Android), Metal (iOS).)</li>



<li><strong>&#8211; Up to 32 interpolators</strong>: Direct3D 10 shader model 4.0 (<code>#pragma target 4.0</code>).<br>(최대 32개의 보간자: Direct3D 10 쉐이더 모델 4.0 (#pragma target 4.0).)</li>
</ul>



<p>Regardless of your particular target hardware, it’s generally a good idea to use as few interpolators as possible for performance reasons.<br>(목표 하드웨어와 관계없이 성능을 위해 보간자를 가능한 적게 사용하는 것이 좋습니다.)</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">Other special semantics (기타 특수 의미론)</h3>



<h4 class="wp-block-heading">Screen space pixel position: VPOS<br>(스크린 공간 픽셀 위치: VPOS)</h4>



<p>A fragment shader can receive position of the pixel being rendered as a special&nbsp;<code>VPOS</code>&nbsp;semantic. <br>(fragment 쉐이더는 렌더링 중인 픽셀의 위치를 VPOS라는 특별한 의미론으로 받을 수 있습니다.)</p>



<p>This feature only exists starting with shader model 3.0, so the shader needs to have the&nbsp;<code>#pragma target 3.0</code>&nbsp;compilation directive.<br>(이 기능은 shader 모델 3.0부터 존재하므로, shader 는 #pragma target 3.0 컴파일 지시어가 필요합니다.)</p>



<p>On different platforms the underlying type of the screen space position input varies, so for maximum portability use the&nbsp;<code>UNITY_VPOS_TYPE</code>&nbsp;type for it, which is&nbsp;<code>float4</code>&nbsp;on most platforms.<br>(다른 플랫폼에서는 스크린 공간 위치 입력의 기본 타입이 다를 수 있으므로, 최대 호환성을 위해 대부분의 플랫폼에서 float4 타입인 UNITY_VPOS_TYPE을 사용하는 것이 좋습니다.)</p>



<p>Additionally, using the pixel position semantic makes it hard to have both the clip space position (SV_POSITION) and VPOS in the same vertex-to-fragment structure. <br>(또한 픽셀 위치 의미론을 사용하면 클립 공간 위치(SV_POSITION)와 VPOS를 동일한 vertex-to-fragmen 구조에서 함께 사용하는 것이 어려워집니다.)</p>



<p>Therefore, the vertex shader should output the clip space position as a separate “out” variable. See the example shader below:<br>(따라서 vertex shader는 클립 공간 위치를 별도의 “출력” 변수로 출력해야 합니다. 아래의 예제 쉐이더를 참조하십시오.)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Shader "Unlit/Screen Position"
{
    Properties
    {
        _MainTex ("Texture", 2D) = "white" {}
    }
    SubShader
    {
        Pass
        {
            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag
            #pragma target 3.0

            // note: no SV_POSITION in this struct
            struct v2f {
                float2 uv : TEXCOORD0;
            };

            v2f vert (
                float4 vertex : POSITION, // vertex position input
                float2 uv : TEXCOORD0, // texture coordinate input
                out float4 outpos : SV_POSITION // clip space position output
                )
            {
                v2f o;
                o.uv = uv;
                outpos = UnityObjectToClipPos(vertex);
                return o;
            }

            sampler2D _MainTex;

            fixed4 frag (v2f i, UNITY_VPOS_TYPE screenPos : VPOS) : SV_Target
            {
                // screenPos.xy will contain pixel integer coordinates.
                // use them to implement a checkerboard pattern that skips rendering
                // 4x4 blocks of pixels

                // checker value will be negative for 4x4 blocks of pixels
                // in a checkerboard pattern
                screenPos.xy = floor(screenPos.xy * 0.25) * 0.5;
                float checker = -frac(screenPos.r + screenPos.g);

                // clip HLSL instruction stops rendering a pixel if value is negative
                clip(checker);

                // for pixels that were kept, read the texture and output it
                fixed4 c = tex2D (_MainTex, i.uv);
                return c;
            }
            ENDCG
        }
    }
}</pre>



<figure class="wp-block-image size-full"><img decoding="async" width="394" height="292" src="https://lycos7560.com/wp-content/uploads/2024/09/image-1.png" alt="" class="wp-image-38240" srcset="https://lycos7560.com/wp-content/uploads/2024/09/image-1.png 394w, https://lycos7560.com/wp-content/uploads/2024/09/image-1-300x222.png 300w" sizes="(max-width: 394px) 100vw, 394px" /></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">Face orientation: VFACE (면 방향: VFACE)</h4>



<p>A fragment shader can receive a variable that indicates whether the rendered surface is facing the&nbsp;<strong>camera</strong>, or facing away from the camera.<br>(fragment shader는 렌더링된 표면이 카메라를 향하고 있는지, 아니면 카메라에서 멀어지고 있는지를 나타내는 변수를 받을 수 있습니다.) </p>



<p>This is useful when rendering geometry that should be visible from both sides – often used on leaves and similar thin objects.<br>(이는 잎사귀와 같은 얇은 객체에서 양면이 모두 보이게 렌더링해야 할 때 유용합니다.)</p>



<p>The&nbsp;<code>VFACE</code>&nbsp;semantic input variable will contain a positive value for front-facing triangles, and a negative value for back-facing ones.<br>(VFACE 의미론 입력 변수는 앞면을 향하는 삼각형에는 양의 값을, 뒷면을 향하는 삼각형에는 음의 값을 포함합니다.)</p>



<p>This feature only exists from shader model 3.0 onwards, so the shader needs to have the&nbsp;<code>#pragma target 3.0</code>&nbsp;compilation directive.<br>(이 기능은 쉐이더 모델 3.0부터 존재하므로, 쉐이더는 #pragma target 3.0 컴파일 지시어가 필요합니다.)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Shader "Unlit/Face Orientation"
{
    Properties
    {
        _ColorFront ("Front Color", Color) = (1,0.7,0.7,1)
        _ColorBack ("Back Color", Color) = (0.7,1,0.7,1)
    }
    SubShader
    {
        Pass
        {
            Cull Off // turn off backface culling

            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag
            #pragma target 3.0

            float4 vert (float4 vertex : POSITION) : SV_POSITION
            {
                return UnityObjectToClipPos(vertex);
            }

            fixed4 _ColorFront;
            fixed4 _ColorBack;

            fixed4 frag (fixed facing : VFACE) : SV_Target
            {
                // VFACE input positive for frontbaces,
                // negative for backfaces. Output one
                // of the two colors depending on that.
                return facing > 0 ? _ColorFront : _ColorBack;
            }
            ENDCG
        }
    }
}</pre>



<div style="height:10px" aria-hidden="true" class="wp-block-spacer"></div>



<p>The shader above uses the&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-Cull.html">Cull</a>&nbsp;state to disable back-face culling (by default back-facing triangles aren’t rendered at all). <br>(위의 shader 는 Cull 상태를 사용하여 후면 컬링을 비활성화합니다. 기본적으로 후면 삼각형은 전혀 렌더링되지 않습니다.)</p>



<p>Here is the shader applied to a bunch of&nbsp;<strong>Quad</strong>&nbsp;meshes, rotated at different orientations:<br>(다양한 방향으로 회전된 여러 개의 쿼드 메시들에 적용된 쉐이더는 다음과 같습니다:)</p>



<figure class="wp-block-image size-full"><img decoding="async" width="393" height="293" src="https://lycos7560.com/wp-content/uploads/2024/09/image-2.png" alt="" class="wp-image-38241" srcset="https://lycos7560.com/wp-content/uploads/2024/09/image-2.png 393w, https://lycos7560.com/wp-content/uploads/2024/09/image-2-300x224.png 300w" sizes="(max-width: 393px) 100vw, 393px" /></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">Vertex ID: SV_VertexID (Vertex ID: SV_VertexID)</h4>



<p>A vertex shader can receive a variable that has the “vertex number” as an unsigned integer. <br>(정점 쉐이더는 &#8216;정점 번호&#8217;를 부호 없는 정수로 받을 수 있습니다.)</p>



<p>This is mostly useful when you want to fetch additional per-vertex data from textures or&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/class-ComputeShader.html" target="_blank" rel="noreferrer noopener">ComputeBuffers</a>.<br>(이는 주로 텍스처나 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/class-ComputeShader.html" target="_blank" rel="noreferrer noopener">ComputeBuffers</a>에서 추가적인 per-vertex data를 가져올 때 유용합니다.)</p>



<p>This feature only exists from DX10 (shader model 4.0) and GLCore / OpenGL ES 3, so the shader needs to have the&nbsp;<code>#pragma target 3.5</code>&nbsp;compilation directive.<br>(이 기능은 DX10(쉐이더 모델 4.0)과 GLCore/OpenGL ES 3부터 존재하므로, 쉐이더는 #pragma target 3.5 컴파일 지시어를 포함해야 합니다.)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Shader "Unlit/VertexID"
{
    SubShader
    {
        Pass
        {
            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag
            #pragma target 3.5

            struct v2f {
                fixed4 color : TEXCOORD0;
                float4 pos : SV_POSITION;
            };

            v2f vert (
                float4 vertex : POSITION, // vertex position input
                uint vid : SV_VertexID // vertex ID, needs to be uint
                )
            {
                v2f o;
                o.pos = UnityObjectToClipPos(vertex);
                // output funky colors based on vertex ID
                float f = (float)vid;
                o.color = half4(sin(f/10),sin(f/100),sin(f/1000),0) * 0.5 + 0.5;
                return o;
            }

            fixed4 frag (v2f i) : SV_Target
            {
                return i.color;
            }
            ENDCG
        }
    }
}</pre>



<figure class="wp-block-image size-full"><img decoding="async" width="397" height="295" src="https://lycos7560.com/wp-content/uploads/2024/09/image-3.png" alt="" class="wp-image-38242" srcset="https://lycos7560.com/wp-content/uploads/2024/09/image-3.png 397w, https://lycos7560.com/wp-content/uploads/2024/09/image-3-300x223.png 300w" sizes="(max-width: 397px) 100vw, 397px" /></figure>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">Accessing shader properties in Cg/HLSL<br>(Cg/HLSL에서 셰이더 속성 접근)</h2>



<p>Shader declares Material properties in a&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-Properties.html" target="_blank" rel="noreferrer noopener">Properties</a>&nbsp;block. <br>(Shader는 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-Properties.html" target="_blank" rel="noreferrer noopener">Properties</a>&nbsp;블록에서 머티리얼 속성을 선언합니다. )</p>



<p>If you want to access some of those properties in a&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderPrograms.html" target="_blank" rel="noreferrer noopener">shader program</a>, you need to declare a Cg/HLSL variable with the same name and a matching type.|<br>(shader program에서 해당 속성 중 일부에 접근하려면, 동일한 이름과 일치하는 타입을 가진 Cg/HLSL 변수를 선언해야 합니다. )</p>



<p>For example these&nbsp;<strong>shader</strong> properties:<br>(예를 들어, 이러한 <strong>shader</strong> 속성들 : )</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">_MyColor ("Some Color", Color) = (1,1,1,1) 
_MyVector ("Some Vector", Vector) = (0,0,0,0) 
_MyFloat ("My float", Float) = 0.5 
_MyTexture ("Texture", 2D) = "white" {} 
_MyCubemap ("Cubemap", CUBE) = "" {} </pre>



<div style="height:10px" aria-hidden="true" class="wp-block-spacer"></div>



<p>would be declared for access in Cg/HLSL code as:<br>(Cg/HLSL 코드에서 다음과 같이 선언됩니다: )</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">fixed4 _MyColor; // low precision type is usually enough for colors (색상에는 일반적으로 낮은 정밀도의 타입이 충분)
float4 _MyVector;
float _MyFloat; 
sampler2D _MyTexture;
samplerCUBE _MyCubemap;</pre>



<div style="height:10px" aria-hidden="true" class="wp-block-spacer"></div>



<p>Cg/HLSL can also accept&nbsp;<strong>uniform</strong>&nbsp;keyword, but it is not necessary:<br>(Cg/HLSL에서는 uniform 키워드를 사용할 수 있지만, 반드시 필요한 것은 아닙니다: )</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">uniform float4 _MyColor;</pre>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p>Property types in&nbsp;<strong>ShaderLab</strong> map to Cg/HLSL variable types this way:</p>



<ul class="wp-block-list">
<li>&#8211; Color and Vector properties map to&nbsp;<strong>float4</strong>,&nbsp;<strong>half4</strong>&nbsp;or&nbsp;<strong>fixed4</strong>&nbsp;variables.<br>(Color와 Vector 속성은 float4, half4 또는 fixed4 변수에 매핑됩니다. )</li>



<li>&#8211; Range and Float properties map to&nbsp;<strong>float</strong>,&nbsp;<strong>half</strong>&nbsp;or&nbsp;<strong>fixed</strong>&nbsp;variables.<br>(Range와 Float 속성은 float, half 또는 fixed 변수에 매핑됩니다.)</li>



<li>&#8211; Texture properties map to&nbsp;<strong>sampler2D</strong>&nbsp;variables for regular (2D) textures;&nbsp;<strong>Cubemaps</strong> map to&nbsp;<strong>samplerCUBE</strong>; and 3D textures map to&nbsp;<strong>sampler3D</strong>.<br>(텍스처 속성은 일반 (2D) textures의 경우 <strong>sampler2D</strong>&nbsp;변수에, <strong>Cubemaps</strong>의 경우 <strong>samplerCUBE</strong>, 3D 텍스처는 <strong>sampler3D</strong>에 매핑됩니다. )</li>
</ul>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">How property values are provided to shaders (속성 값이 shader에 제공되는 방법)</h3>



<p>Shader property values are found and provided to shaders from these places:<br>(셰이더 속성 값은 다음과 같은 경로로 셰이더에 전달됩니다: )</p>



<ul class="wp-block-list">
<li>&#8211; Per-Renderer values set in&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/ScriptReference/MaterialPropertyBlock.html" target="_blank" rel="noreferrer noopener">MaterialPropertyBlock</a>. This is typically “per-instance” data (e.g. customized tint color for a lot of objects that all share the same material).<br><a href="https://docs.unity3d.com/2023.2/Documentation/ScriptReference/MaterialPropertyBlock.html" target="_blank" rel="noreferrer noopener">MaterialPropertyBlock</a>에 설정된 렌더러별 값. 이는 일반적으로 “인스턴스별” 데이터입니다 (예: 동일한 머티리얼을 공유하는 여러 객체에 대한 맞춤형 색상).</li>



<li>&#8211; Values set in the&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/class-Material.html">Material</a> that’s used on the rendered object.<br>(렌더링된 객체에 사용된 머티리얼에 설정된 값. )</li>



<li>&#8211; Global shader properties, set either by Unity rendering code itself (see&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-UnityShaderVariables.html">built-in shader variables</a>), or from your own&nbsp;<strong>scripts</strong> (e.g.&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/ScriptReference/Shader.SetGlobalTexture.html" target="_blank" rel="noreferrer noopener">Shader.SetGlobalTexture</a>).<br>전역 셰이더 속성은 Unity의 렌더링 코드에서 설정되거나(내장 셰이더 변수 참조), 스크립트에서 직접 설정됩니다(예: <a href="https://docs.unity3d.com/2023.2/Documentation/ScriptReference/Shader.SetGlobalTexture.html" target="_blank" rel="noreferrer noopener">Shader.SetGlobalTexture</a>).</li>
</ul>



<p>The order of precedence is like above: per-instance data overrides everything; then Material data is used; and finally if shader property does not exist in these two places then global property value is used. <br>(우선순위는 위와 같습니다: 인스턴스별 데이터가 모든 것을 덮어쓰며, 그다음으로 머티리얼 데이터가 사용됩니다. 이 두 곳에 shader 속성이 없으면 전역 속성 값이 사용됩니다.)</p>



<p>Finally, if there’s no shader property value defined anywhere, then “default” (zero for floats, black for colors, empty white texture for textures) value will be provided.<br>(마지막으로, 어느 곳에도 shader 속성이 정의되어 있지 않으면 “기본값”(float의 경우 0, 색상의 경우 검정, 텍스처의 경우 빈 흰색 텍스처)이 제공됩니다. )</p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">Serialized and Runtime Material properties <br>(직렬화된 머티리얼 속성과 런타임 머티리얼 속성)</h3>



<p><a href="https://docs.unity3d.com/2023.2/Documentation/Manual/class-Material.html" target="_blank" rel="noreferrer noopener">Materials</a>&nbsp;can contain both serialized and runtime-set property values.<br>(<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/class-Material.html" target="_blank" rel="noreferrer noopener">Materials</a>은 직렬화된 값과 런타임에서 설정된 속성 값을 모두 포함할 수 있습니다. )</p>



<p>Serialized data is all the properties defined in shader’s&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-Properties.html" target="_blank" rel="noreferrer noopener">Properties</a>&nbsp;block.<br>(직렬화된 데이터는 셰이더의 Properties 블록에 정의된 모든 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-Properties.html" target="_blank" rel="noreferrer noopener">Properties</a>입니다.)</p>



<p>Typically these are values that need to be stored in the material, and are tweakable by the user in Material&nbsp;<strong>Inspector</strong>.<br>(일반적으로 이러한 값들은 material에 저장되어야 하며, Material <strong>Inspector</strong>에서 사용자가 조정할 수 있습니다.)</p>



<p>A material can also have some properties that are used by the shader, but not declared in shader’s&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-Properties.html" target="_blank" rel="noreferrer noopener">Properties</a>&nbsp;block.<br>material 에는 shader에서 사용되지만 shader의 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-Properties.html" target="_blank" rel="noreferrer noopener">Properties</a> 블록에 선언되지 않은 속성도 있을 수 있습니다.</p>



<p>Typically this is for properties that are set from script code at runtime, e.g. via&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/ScriptReference/Material.SetColor.html" target="_blank" rel="noreferrer noopener">Material.SetColor</a>.<br>(이러한 속성은 일반적으로 런타임에서 스크립트 코드로 설정됩니다(예: &nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/ScriptReference/Material.SetColor.html" target="_blank" rel="noreferrer noopener">Material.SetColor</a>를 통해).)</p>



<p>Note that matrices and arrays can only exist as non-serialized runtime properties (since there’s no way to define them in Properties block).<br>(행렬과 배열은 Properties 블록에서 정의할 수 없기 때문에 <strong>직렬화되지 않은 런타임 속성으로만 존재</strong>할 수 있다는 점에 유의해야 합니다.)</p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">Special Texture properties (특수 텍스처 속성)</h3>



<p>For each texture that is setup as a shader/material property, Unity also sets up some extra information in additional vector properties.<br>(shader/material 속성으로 설정된 각 텍스처에 대해 Unity는 추가 벡터 속성에 추가 정보를 설정합니다.)</p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">Texture tiling &amp; offset (텍스처 타일링 및 오프셋)</h4>



<p><a href="https://docs.unity3d.com/2023.2/Documentation/Manual/class-Material.html" target="_blank" rel="noreferrer noopener">Materials</a>&nbsp;often have Tiling and Offset fields for their texture properties.<br>(<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/class-Material.html" target="_blank" rel="noreferrer noopener">Materials</a>은 종종 텍스처 속성에 대해 타일링 및 오프셋 필드를 가집니다.)</p>



<p>This information is passed into shaders in a float4&nbsp;<em>{TextureName}</em><code>_ST</code>&nbsp;property:<br>(이 정보는 float4 {TextureName}_ST 속성으로 shaders에 전달됩니다.)</p>



<ul class="wp-block-list">
<li>&#8211; <code>x</code>&nbsp;contains X tiling value (x는 X 타일링 값을 포함합니다)</li>



<li>&#8211; <code>y</code>&nbsp;contains Y tiling value (y는 Y 타일링 값을 포함합니다)</li>



<li>&#8211; <code>z</code>&nbsp;contains X offset value (z는 X 오프셋 값을 포함합니다)</li>



<li>&#8211; <code>w</code>&nbsp;contains Y offset value (w는 Y 오프셋 값을 포함합니다)</li>
</ul>



<p>For example, if a shader contains texture named&nbsp;<code>_MainTex</code>, the tiling information will be in a&nbsp;<code>_MainTex_ST</code>&nbsp;vector.<br>(예를 들어, shader에 _MainTex라는 텍스처가 있을 경우, 타일링 정보는 _MainTex_ST 벡터에 포함됩니다.)</p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">Texture size (텍스처 크기)</h4>



<p><em>{TextureName}</em><code>_TexelSize</code>&nbsp;&#8211; a float4 property contains texture size information:<br>({TextureName}_TexelSize &#8211; float4 속성은 텍스처 크기 정보를 포함합니다 : )</p>



<ul class="wp-block-list">
<li>&#8211; <code>x</code>&nbsp;contains 1.0/width (x는 1.0/너비 값을 포함합니다)</li>



<li>&#8211; <code>y</code>&nbsp;contains 1.0/height (y는 1.0/높이 값을 포함합니다)</li>



<li>&#8211; <code>z</code>&nbsp;contains width (z는 너비를 포함합니다)</li>



<li>&#8211; <code>w</code>&nbsp;contains height (w는 높이를 포함합니다)</li>
</ul>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">Texture HDR parameters (Texture HDR 매개변수)</h4>



<p><em>{TextureName}</em><code>_HDR</code>&nbsp;&#8211; a float4 property with information on how to decode a potentially&nbsp;<strong>HDR</strong> (e.g. RGBM-encoded) texture depending on the&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/LinearLighting.html">color space</a>&nbsp;used.<br>({TextureName}_HDR &#8211; 사용된 색 공간에 따라 HDR (예: RGBM 인코딩된) 텍스처를 디코딩하는 방법에 대한 정보를 포함하는 float4 속성입니다.)</p>



<p>See&nbsp;<code>DecodeHDR</code>&nbsp;function in&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-BuiltinIncludes.html" target="_blank" rel="noreferrer noopener">UnityCG.cginc</a>&nbsp;shader include file.<br>(자세한 내용은<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-BuiltinIncludes.html" target="_blank" rel="noreferrer noopener">UnityCG.cginc</a>&nbsp;shader 포함 파일의 DecodeHDR 함수를 참조하세요.)</p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">Color spaces and color/vector shader data (색 공간 및 색상/벡터 shader 데이터)</h4>



<p>When using&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/LinearLighting.html" target="_blank" rel="noreferrer noopener">Linear color space</a>, all material color properties are supplied as sRGB colors, but are converted into linear values when passed into shaders.<br>(&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/LinearLighting.html" target="_blank" rel="noreferrer noopener">Linear color space</a>을 사용할 때, 모든 Material 색상 속성은 sRGB 색상으로 제공되며, shader로 전달될 때 선형 값으로 변환됩니다.)</p>



<p>For example, if your&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-Properties.html">Properties</a>&nbsp;shader block contains a&nbsp;<code>Color</code>&nbsp;property called “<em>MyColor“, then the corresponding ”</em>MyColor” HLSL variable will get the linear color value.<br>(예를 들어, Properties 셰이더 블록에 “MyColor”라는 Color 속성이 있으면, 해당 “MyColor” HLSL 변수는 선형 색상 값을 받게 됩니다.)</p>



<p>For properties that are marked as&nbsp;<code>Float</code>&nbsp;or&nbsp;<code>Vector</code>&nbsp;type, no color space conversions are done by default; it is assumed that they contain non-color data.<br>(Float 또는 Vector 타입으로 표시된 속성의 경우 기본적으로 색 공간 변환이 수행되지 않으며, 이들은 색상 데이터가 아닌 것으로 간주됩니다.)</p>



<p>It is possible to add&nbsp;<code>[Gamma]</code>&nbsp;attribute for float/vector properties to indicate that they are specified in sRGB space, just like colors (see&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-Properties.html" target="_blank" rel="noreferrer noopener">Properties</a>).<br>(색상과 마찬가지로 float/vector 속성이 sRGB 공간에서 지정된다는 것을 나타내기 위해 [Gamma] 속성을 추가할 수 있습니다 (<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-Properties.html" target="_blank" rel="noreferrer noopener">Properties</a> 참조).)</p>



<h4 class="wp-block-heading">See Also (참고)</h4>



<ul class="wp-block-list">
<li><a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-Properties.html" target="_blank" rel="noreferrer noopener">ShaderLab Properties block</a>. (<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-Properties.html" target="_blank" rel="noreferrer noopener">ShaderLab Properties 블록</a>.)</li>



<li><a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderPrograms.html" target="_blank" rel="noreferrer noopener">Writing Shader Programs</a>. (<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderPrograms.html" target="_blank" rel="noreferrer noopener">셰이더 프로그램 작성하기</a>.)</li>
</ul>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">Providing vertex data to vertex programs (버텍스 프로그램에 버텍스 데이터 제공)</h2>



<p><a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-VertexProgramInputs.html" target="_blank" rel="noreferrer noopener">https://docs.unity3d.com/2023.2/Documentation/Manual/SL-VertexProgramInputs.html</a></p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p>For Cg/HLSL&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderPrograms.html" target="_blank" rel="noreferrer noopener">vertex program</a><a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderPrograms.html">s</a>, the&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/class-Mesh.html" target="_blank" rel="noreferrer noopener">Mesh</a> vertex data is passed as inputs to the vertex shader function.<br>Cg/HLSL <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderPrograms.html" target="_blank" rel="noreferrer noopener">vertex programs</a>에서는 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/class-Mesh.html" target="_blank" rel="noreferrer noopener">Mesh</a> 버텍스 데이터가  vertex shader 함수의 입력으로 전달됩니다.</p>



<p>Each input needs to have a&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderSemantics.html">semantic</a>&nbsp;specified for it: for example,&nbsp;<code>POSITION</code>&nbsp;input is the vertex position, and&nbsp;<code>NORMAL</code>&nbsp;is the vertex normal.<br>(각 입력에는 의미(<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderSemantics.html">semantic</a>)가 지정되어야 합니다. 예를 들어, POSITION 입력은 vertex 위치이고, NORMAL은 vertex 노멀입니다.)</p>



<p>Often, vertex data inputs are declared in a structure, instead of listing them one by one.<br>(종종 vertex 데이터 입력은 하나씩 나열하는 대신 구조체로 선언됩니다.)</p>



<p>Several commonly used vertex structures are defined in&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-BuiltinIncludes.html" target="_blank" rel="noreferrer noopener">UnityCG.cginc include file</a>, and in most cases it’s enough just to use those. The structures are:<br>(<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-BuiltinIncludes.html" target="_blank" rel="noreferrer noopener">UnityCG.cginc include file</a>에 여러 가지 일반적으로 사용되는 버텍스 구조체가 정의되어 있으며, 대부분의 경우 이를 사용하는 것 만으로충분합니다. 이 구조체들은 다음과 같습니다 : )</p>



<ul class="wp-block-list">
<li>&#8211; <code>appdata_base</code>: position, normal and one texture coordinate. (위치, 노멀 및 하나의 텍스처 좌표.)</li>



<li>&#8211; <code>appdata_tan</code>: position, tangent, normal and one texture coordinate. (위치, 탄젠트, 노멀 및 하나의 텍스처 좌표.)</li>



<li>&#8211; <code>appdata_full</code>: position, tangent, normal, four texture coordinates and color. (위치, 탄젠트, 노멀, 네 개의 텍스처 좌표 및 색상.)</li>
</ul>



<p><strong>Example:</strong>&nbsp;This&nbsp;<strong>shader</strong> colors the mesh based on its normals, and uses&nbsp;<code>appdata_base</code>&nbsp;as vertex program input:<br>(<strong>예시</strong>: 이 <strong>shader</strong>는 노멀에 기반하여 메시에 색상을 입히며, appdata_base를 버텍스 프로그램 입력으로 사용합니다 : )</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Shader "VertexInputSimple" {
    SubShader {
        Pass {
            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag
            #include "UnityCG.cginc"
         
            struct v2f {
                float4 pos : SV_POSITION;
                fixed4 color : COLOR;
            };
            
            v2f vert (appdata_base v)
            {
                v2f o;
                o.pos = UnityObjectToClipPos(v.vertex);
                o.color.xyz = v.normal * 0.5 + 0.5;
                o.color.w = 1.0;
                return o;
            }

            fixed4 frag (v2f i) : SV_Target { return i.color; }
            ENDCG
        }
    } 
}</pre>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p>To access different vertex data, you need to declare the vertex structure yourself, or add input parameters to the vertex shader. <br>(다른 버텍스 데이터에 접근하려면, 직접 버텍스 구조체를 선언하거나 버텍스 shader에 입력 파라미터를 추가해야 합니다.)</p>



<p>Vertex data is identified by Cg/HLSL&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderSemantics.html" target="_blank" rel="noreferrer noopener">semantics</a>, and must be from the following list:<br>(버텍스 데이터는 Cg/HLSL 의미(<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderSemantics.html">semantics</a>)에 의해 식별되며, 다음 목록 중 하나여야 합니다 : )</p>



<ul class="wp-block-list">
<li>&#8211; <code>POSITION</code>&nbsp;is the vertex position, typically a&nbsp;<code>float3</code>&nbsp;or&nbsp;<code>float4</code>. (POSITION은 버텍스 위치로, 일반적으로 float3 또는 float4입니다.)</li>



<li>&#8211; <code>NORMAL</code>&nbsp;is the vertex normal, typically a&nbsp;<code>float3</code>. (NORMAL은 버텍스 노멀로, 일반적으로 float3입니다.)</li>



<li>&#8211; <code>TEXCOORD0</code>&nbsp;is the first UV coordinate, typically&nbsp;<code>float2</code>,&nbsp;<code>float3</code>&nbsp;or&nbsp;<code>float4</code>. (TEXCOORD0은 첫 번째 UV 좌표로, 일반적으로 float2, float3 또는 float4입니다.)</li>



<li>&#8211; <code>TEXCOORD1</code>,&nbsp;<code>TEXCOORD2</code>&nbsp;and&nbsp;<code>TEXCOORD3</code>&nbsp;are the 2nd, 3rd and 4th UV coordinates, respectively. (TEXCOORD1, TEXCOORD2 및 TEXCOORD3는 각각 두 번째, 세 번째, 네 번째 UV 좌표입니다.)</li>



<li>&#8211; <code>TANGENT</code>&nbsp;is the tangent vector (used for normal mapping), typically a&nbsp;<code>float4</code>. (TANGENT는 탄젠트 벡터(노멀 맵핑에 사용되며), 일반적으로 float4입니다.)</li>



<li>&#8211; <code>COLOR</code>&nbsp;is the per-vertex color, typically a&nbsp;<code>float4</code>. (COLOR는 버텍스당 색상으로, 일반적으로 float4입니다.)</li>
</ul>



<p>When the mesh data contains fewer components than are needed by the vertex shader input, the rest are filled with zeroes, except for the&nbsp;<code>.w</code>&nbsp;component which defaults to 1. <br>(메시 데이터가 vertex shader 입력에서 요구하는 구성 요소보다 적은 경우, 나머지는 0으로 채워지며,  .w 구성 요소는 기본적으로 1이 됩니다.)</p>



<p>For example, mesh texture coordinates are often 2D vectors with just x and y components. <br>(예를 들어, 메시의 텍스처 좌표는 종종 x와 y 구성 요소만 있는 2D 벡터입니다.)</p>



<p>If a vertex shader declares a&nbsp;<code>float4</code>&nbsp;input with&nbsp;<code>TEXCOORD0</code>&nbsp;semantic, the value received by the&nbsp;<strong>vertex shader</strong> will contain (x,y,0,1).<br>(만약 <strong>vertex shader</strong>가 TEXCOORD0 의미로 float4 입력을 선언하면, <strong>vertex shader</strong>가 받는 값은 (x, y, 0, 1)이 됩니다.)</p>



<p>For examples of using these techniques to visualize vertex data in the Built-in&nbsp;<strong>Render Pipeline</strong>, see&nbsp;<a href="https://docs.unity3d.com/2023.2/Documentation/Manual/built-in-shader-examples-vertex-data.html" target="_blank" rel="noreferrer noopener">Visualizing vertex data</a>.<br>(이 기술을 사용하여 기본 렌더 파이프라인에서 버텍스 데이터를 시각화하는 예시는 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/built-in-shader-examples-vertex-data.html" target="_blank" rel="noreferrer noopener">Visualizing vertex data</a>&#8220;를 참조하십시오.)</p>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading">Built-in shader include files </h2>



<p><a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-BuiltinIncludes.html" target="_blank" rel="noreferrer noopener">https://docs.unity3d.com/2023.2/Documentation/Manual/SL-BuiltinIncludes.html</a></p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p>Unity contains several files that can be used by your <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderPrograms.html" target="_blank" rel="noreferrer noopener">shader programs</a> to bring in predefined variables and helper functions. <br>(Unity에는 미리 정의된 변수와 헬퍼 함수들을 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-ShaderPrograms.html" target="_blank" rel="noreferrer noopener">shader programs</a>에서 사용할 수 있도록 하는 여러 파일이 포함되어 있습니다.)</p>



<p>This is done by the standard <code>#include</code> directive, e.g.:<br>(이는 표준 #include 지시어를 사용하여 실행됩니다. 예를 들어 : )</p>



<pre class="EnlighterJSRAW" data-enlighter-language="cpp" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">CGPROGRAM
// ...
#include "UnityCG.cginc"
// ...
ENDCG
</pre>



<p>Shader include files in Unity are with <code>.cginc</code> extension, and the built-in ones are:<br>(Unity의 셰이더 인클루드 파일은 .cginc 확장자를 가지며, 내장된 파일들은 다음과 같습니다:)</p>



<ul class="wp-block-list">
<li>&#8211; <code>HLSLSupport.cginc</code> &#8211; <em>(automatically included)</em> Helper macros and definitions for cross-platform <strong>shader</strong> compilation.<br>(자동으로 포함) 크로스 플랫폼 shader 컴파일을 위한 헬퍼 매크로 및 정의.)</li>



<li>&#8211; <code>UnityShaderVariables.cginc</code> &#8211; <em>(automatically included)</em> Commonly used global variables.<br>((자동으로 포함) 일반적으로 사용되는 전역 변수.)</li>



<li>&#8211; <code>UnityCG.cginc</code> &#8211; commonly used <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-BuiltinFunctions.html" target="_blank" rel="noreferrer noopener">helper functions</a>.<br>(일반적으로 사용되는 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-BuiltinFunctions.html" target="_blank" rel="noreferrer noopener">helper functions</a>.)</li>



<li>&#8211; <code>AutoLight.cginc</code> &#8211; lighting &amp; shadowing functionality, e.g. <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-SurfaceShaders.html">surface shaders</a> use this file internally.<br>(조명 및 그림자 기능, 예를 들어 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-SurfaceShaders.html">surface shaders</a>는 이 파일을 내부적으로 사용합니다.)</li>



<li>&#8211; <code>Lighting.cginc</code> &#8211; standard <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-SurfaceShaders.html" target="_blank" rel="noreferrer noopener">surfa</a><a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-SurfaceShaders.html">ce shader</a> lighting models; automatically included when you’re writing surface shaders.<br>(표준 서피스 셰이더 조명 모델; <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-SurfaceShaders.html" target="_blank" rel="noreferrer noopener">surfa</a><a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-SurfaceShaders.html">ce shader</a>를 작성할 때 자동으로 포함됩니다.)</li>



<li>&#8211; <code>TerrainEngine.cginc</code> &#8211; helper functions for <strong>Terrain</strong> &amp; Vegetation shaders.<br>(지형 및 식물 shader 헬퍼 함수.)</li>
</ul>



<p>These files are found inside Unity application (<strong>{unity install path}/Data/CGIncludes/UnityCG.cginc</strong> on Windows, <strong>/Applications/Unity/Unity.app/Contents/CGIncludes/UnityCG.cginc</strong> on Mac), if you want to take a look at what exactly is done in any of the helper code.<br>(이 파일들은 Unity 애플리케이션 내부에서 찾을 수 있습니다 ({유니티 설치 경로}/Data/CGIncludes/UnityCG.cginc, Windows의 경우 /Applications/Unity/Unity.app/Contents/CGIncludes/UnityCG.cginc, Mac의 경우). 필요한 경우 헬퍼 코드에서 실제로 수행되는 작업을 확인할 수 있습니다.)</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">HLSLSupport.cginc</h3>



<p>This file is automatically included when compiling CGPROGRAM shaders (but not included for HLSLPROGRAM ones). <br>(이 파일은 CGPROGRAM 셰이더를 컴파일할 때 자동으로 포함되며, HLSLPROGRAM에는 포함되지 않습니다.)</p>



<p>It declares various <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-BuiltinMacros.html" target="_blank" rel="noreferrer noopener">preprocessor macros</a> to aid in multi-platform shader development.<br>(멀티 플랫폼 shader 개발을 돕기 위한 여러 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-BuiltinMacros.html" target="_blank" rel="noreferrer noopener">preprocessor macros</a>을 선언합니다.)</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">UnityShaderVariables.cginc</h3>



<p>This file is automatically included when compiling CGPROGRAM shaders (but not included for HLSLPROGRAM ones). <br>(이 파일은 CGPROGRAM shader를 컴파일할 때 자동으로 포함되며, HLSLPROGRAM에는 포함되지 않습니다.)</p>



<p>It declares various <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-UnityShaderVariables.html">built-in global variables</a> that are commonly used in shaders.<br>(shader에서 일반적으로 사용되는 다양한 내장 전역 변수를 선언합니다.)</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading">UnityCG.cginc</h3>



<p>This file is often included in <strong>Shader objects</strong>. <br>(이 파일은 <strong>Shader objects</strong>에 자주 포함됩니다.)</p>



<p>It declares many <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-BuiltinFunctions.html" target="_blank" rel="noreferrer noopener">built-in helper functions</a> and data structures.<br>(많은 <a href="https://docs.unity3d.com/2023.2/Documentation/Manual/SL-BuiltinFunctions.html" target="_blank" rel="noreferrer noopener">built-in helper functions</a>와 데이터 구조를 선언합니다.)</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<h4 class="wp-block-heading">Data structures in UnityCG.cginc (UnityCG.cginc의 데이터 구조)</h4>



<ul class="wp-block-list">
<li>struct <code>appdata_base</code>: <strong>vertex shader</strong> input with position, normal, one texture coordinate. (위치, 법선, 하나의 텍스처 좌표를 가진 버텍스 셰이더 입력..)</li>



<li>struct <code>appdata_tan</code>: vertex shader input with position, normal, tangent, one texture coordinate. (위치, 법선, 탄젠트, 하나의 텍스처 좌표를 가진 버텍스 셰이더 입력.)</li>



<li>struct <code>appdata_full</code>: vertex shader input with position, normal, tangent, vertex color and two texture coordinates. (위치, 법선, 탄젠트, 버텍스 색상 및 두 개의 텍스처 좌표를 가진 버텍스 셰이더 입력.)</li>



<li>struct <code>appdata_img</code>: vertex shader input with position and one texture coordinate. (위치와 하나의 텍스처 좌표를 가진 버텍스 셰이더 입력.)</li>
</ul>



<p></p>



<p></p>



<p></p>



<p></p>



<p></p>



<p></p>



<p></p>



<p></p>



<p></p>



<p></p>
<p>The post <a href="https://lycos7560.com/unity/write-hlsl-shader-in-unity-urp_qwer/38216/">Write HLSL Shader in Unity (URP)</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lycos7560.com/unity/write-hlsl-shader-in-unity-urp_qwer/38216/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>RGB 가산 혼합</title>
		<link>https://lycos7560.com/unity/rgb-%ea%b0%80%ec%82%b0-%ed%98%bc%ed%95%a9/38101/</link>
					<comments>https://lycos7560.com/unity/rgb-%ea%b0%80%ec%82%b0-%ed%98%bc%ed%95%a9/38101/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Sat, 30 Mar 2024 15:33:41 +0000</pubDate>
				<category><![CDATA[Unity]]></category>
		<category><![CDATA[UnityShader]]></category>
		<guid isPermaLink="false">https://lycos7560.com/?p=38101</guid>

					<description><![CDATA[<p>RGB 가산 혼합 가산 : 더하여 셈하는 것 RGB 색 모형은 빛의 삼원색을 이용하여&#160;색을 표현하는 방식이다.&#160; 빨강(RED),&#160;초록(GREEN),&#160;파랑(BLUE) 세 종류의 광원(光源)을 이용하여 색을 혼합하며 색을 섞을수록 밝아지기 때문에 &#8216;가산 혼합&#8217;이라고 한다. RGB의 덧셈과 곱셈 RGB의 덧셈과 곱셈은 R은 R, G는 G, B는 B와 계산한다.</p>
<p>The post <a href="https://lycos7560.com/unity/rgb-%ea%b0%80%ec%82%b0-%ed%98%bc%ed%95%a9/38101/">RGB 가산 혼합</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></description>
										<content:encoded><![CDATA[				<div class="wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-fc52cde9      "
					data-scroll= "1"
					data-offset= "30"
					style=""
				>
				<div class="uagb-toc__wrap">
						<div class="uagb-toc__title">
							INDEX						</div>
																						<div class="uagb-toc__list-wrap ">
						<ol class="uagb-toc__list"><li class="uagb-toc__list"><a href="#rgb-가산-혼합" class="uagb-toc-link__trigger">RGB 가산 혼합</a><ul class="uagb-toc__list"><li class="uagb-toc__list"><a href="#rgb의-덧셈과-곱셈" class="uagb-toc-link__trigger">RGB의 덧셈과 곱셈</a></ul></ol>					</div>
									</div>
				</div>
			


<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<h1 class="wp-block-heading">RGB 가산 혼합</h1>
<cite>가산 : 더하여 셈하는 것</cite></blockquote>



<p>RGB 색 모형은 빛의 삼원색을 이용하여&nbsp;색을 표현하는 방식이다.&nbsp;</p>



<p>빨강(RED),&nbsp;초록(GREEN),&nbsp;파랑(BLUE) 세 종류의 광원(光源)을 이용하여 <strong>색을 혼합하며 색을 섞을수록 밝아지기 때문에 &#8216;가산 혼합&#8217;이라고 한다.</strong></p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img decoding="async" width="1920" height="1762" src="https://lycos7560.com/wp-content/uploads/2024/03/RGBCube_b.png" alt="" class="wp-image-38103" srcset="https://lycos7560.com/wp-content/uploads/2024/03/RGBCube_b.png 1920w, https://lycos7560.com/wp-content/uploads/2024/03/RGBCube_b-300x275.png 300w, https://lycos7560.com/wp-content/uploads/2024/03/RGBCube_b-768x705.png 768w, https://lycos7560.com/wp-content/uploads/2024/03/RGBCube_b-1536x1410.png 1536w" sizes="(max-width: 1920px) 100vw, 1920px" /><figcaption class="wp-element-caption"><a href="https://ko.wikipedia.org/wiki/RGB" target="_blank" rel="noreferrer noopener">https://ko.wikipedia.org/wiki/RGB</a></figcaption></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img decoding="async" width="994" height="525" src="https://lycos7560.com/wp-content/uploads/2024/03/image-59.png" alt="" class="wp-image-38102" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-59.png 994w, https://lycos7560.com/wp-content/uploads/2024/03/image-59-300x158.png 300w, https://lycos7560.com/wp-content/uploads/2024/03/image-59-768x406.png 768w" sizes="(max-width: 994px) 100vw, 994px" /></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img decoding="async" width="1560" height="1170" src="https://lycos7560.com/wp-content/uploads/2024/03/Tricolour_television_close_up.jpg" alt="" class="wp-image-38105" srcset="https://lycos7560.com/wp-content/uploads/2024/03/Tricolour_television_close_up.jpg 1560w, https://lycos7560.com/wp-content/uploads/2024/03/Tricolour_television_close_up-300x225.jpg 300w, https://lycos7560.com/wp-content/uploads/2024/03/Tricolour_television_close_up-768x576.jpg 768w, https://lycos7560.com/wp-content/uploads/2024/03/Tricolour_television_close_up-1536x1152.jpg 1536w" sizes="(max-width: 1560px) 100vw, 1560px" /><figcaption class="wp-element-caption"><a href="https://ko.wikipedia.org/wiki/RGB" target="_blank" rel="noreferrer noopener">https://ko.wikipedia.org/wiki/RGB</a></figcaption></figure>
</div>
</div>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-video"><video height="904" style="aspect-ratio: 1720 / 904;" width="1720" controls src="https://lycos7560.com/wp-content/uploads/2024/03/RainbowColorPicker-1.mp4"></video></figure>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<h2 class="wp-block-heading">RGB의 덧셈과 곱셈</h2>
</blockquote>



<p>RGB의 덧셈과 곱셈은 R은 R, G는 G, B는 B와 계산한다.</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img decoding="async" width="1218" height="709" src="https://lycos7560.com/wp-content/uploads/2024/03/image-60.png" alt="" class="wp-image-38114" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-60.png 1218w, https://lycos7560.com/wp-content/uploads/2024/03/image-60-300x175.png 300w, https://lycos7560.com/wp-content/uploads/2024/03/image-60-768x447.png 768w" sizes="(max-width: 1218px) 100vw, 1218px" /><figcaption class="wp-element-caption">RED (255, 0, 0) + GREEN (0, 255, 0) + BLUE (0, 0, 255) = White (255, 255, 255)</figcaption></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img decoding="async" width="1213" height="683" src="https://lycos7560.com/wp-content/uploads/2024/03/image-61.png" alt="" class="wp-image-38115" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-61.png 1213w, https://lycos7560.com/wp-content/uploads/2024/03/image-61-300x169.png 300w, https://lycos7560.com/wp-content/uploads/2024/03/image-61-768x432.png 768w" sizes="(max-width: 1213px) 100vw, 1213px" /><figcaption class="wp-element-caption">RED (255, 0, 0) + BLUE (0, 0, 255) =  MAGENTA (255, 0, 255)</figcaption></figure>
</div>
</div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img decoding="async" width="1221" height="688" src="https://lycos7560.com/wp-content/uploads/2024/03/image-62.png" alt="" class="wp-image-38116" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-62.png 1221w, https://lycos7560.com/wp-content/uploads/2024/03/image-62-300x169.png 300w, https://lycos7560.com/wp-content/uploads/2024/03/image-62-768x433.png 768w" sizes="(max-width: 1221px) 100vw, 1221px" /><figcaption class="wp-element-caption">RED (255, 0, 0) + GREEN (0, 255, 0) = YELLOW (255, 255, 0)</figcaption></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img decoding="async" width="1208" height="689" src="https://lycos7560.com/wp-content/uploads/2024/03/image-63.png" alt="" class="wp-image-38117" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-63.png 1208w, https://lycos7560.com/wp-content/uploads/2024/03/image-63-300x171.png 300w, https://lycos7560.com/wp-content/uploads/2024/03/image-63-768x438.png 768w" sizes="(max-width: 1208px) 100vw, 1208px" /><figcaption class="wp-element-caption">GREEN (0, 255, 0) + BLUE (0, 0, 255) = CYAN (0, 255, 255)</figcaption></figure>
</div>
</div>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img decoding="async" width="1217" height="684" src="https://lycos7560.com/wp-content/uploads/2024/03/image-64.png" alt="" class="wp-image-38118" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-64.png 1217w, https://lycos7560.com/wp-content/uploads/2024/03/image-64-300x169.png 300w, https://lycos7560.com/wp-content/uploads/2024/03/image-64-768x432.png 768w" sizes="(max-width: 1217px) 100vw, 1217px" /><figcaption class="wp-element-caption">RED (255, 0, 0) * GREEN (0, 255, 0) * BLUE (0, 0, 255) = BLACK (0, 0, 0)</figcaption></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow"></div>
</div>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
<p>The post <a href="https://lycos7560.com/unity/rgb-%ea%b0%80%ec%82%b0-%ed%98%bc%ed%95%a9/38101/">RGB 가산 혼합</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lycos7560.com/unity/rgb-%ea%b0%80%ec%82%b0-%ed%98%bc%ed%95%a9/38101/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		<enclosure url="https://lycos7560.com/wp-content/uploads/2024/03/RainbowColorPicker-1.mp4" length="3374575" type="video/mp4" />

			</item>
		<item>
		<title>HSV(= HSB) Color 정리</title>
		<link>https://lycos7560.com/unity/hsv-hsb-color-%ec%a0%95%eb%a6%ac/38087/</link>
					<comments>https://lycos7560.com/unity/hsv-hsb-color-%ec%a0%95%eb%a6%ac/38087/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Fri, 29 Mar 2024 15:36:43 +0000</pubDate>
				<category><![CDATA[Unity]]></category>
		<category><![CDATA[UnityShader]]></category>
		<category><![CDATA[Brightness]]></category>
		<category><![CDATA[Color]]></category>
		<category><![CDATA[HSB]]></category>
		<category><![CDATA[HSB Color]]></category>
		<category><![CDATA[HSV]]></category>
		<category><![CDATA[HSV Color]]></category>
		<category><![CDATA[Hue]]></category>
		<category><![CDATA[Saturation]]></category>
		<category><![CDATA[Value]]></category>
		<category><![CDATA[명도]]></category>
		<category><![CDATA[밝기]]></category>
		<category><![CDATA[색]]></category>
		<category><![CDATA[색상]]></category>
		<category><![CDATA[채도]]></category>
		<guid isPermaLink="false">https://lycos7560.com/?p=38087</guid>

					<description><![CDATA[<p>This article summarizes the basic concepts of HSV (=HSB) Color.</p>
<p>The post <a href="https://lycos7560.com/unity/hsv-hsb-color-%ec%a0%95%eb%a6%ac/38087/">HSV(= HSB) Color 정리</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></description>
										<content:encoded><![CDATA[				<div class="wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-2b6ed13e      "
					data-scroll= "1"
					data-offset= "30"
					style=""
				>
				<div class="uagb-toc__wrap">
						<div class="uagb-toc__title">
							Index						</div>
																						<div class="uagb-toc__list-wrap ">
						<ol class="uagb-toc__list"><li class="uagb-toc__list"><a href="#hsvhsb-color" class="uagb-toc-link__trigger">HSV(= HSB) Color</a><ul class="uagb-toc__list"><li class="uagb-toc__list"><a href="#hue-색상" class="uagb-toc-link__trigger">Hue 색상</a><li class="uagb-toc__list"><li class="uagb-toc__list"><a href="#saturation-채도" class="uagb-toc-link__trigger">Saturation 채도</a><li class="uagb-toc__list"><li class="uagb-toc__list"><a href="#value-명도-brightness-밝기" class="uagb-toc-link__trigger">Value 명도 (= Brightness 밝기)</a></ul></ol>					</div>
									</div>
				</div>
			


<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<h1 class="wp-block-heading">HSV(=&nbsp;HSB) Color</h1>
<cite>색상을 설명하는 모델</cite></blockquote>



<p>HSV(색조, 채도, 명도) 또는 HSB(색조, 채도, 밝기)는 색상을 설명하는 컬러 모델 중 하나로 아티스트 혹은 일러스트레이터들에게 매우 친숙한 컬러 모델입니다.</p>



<p>색상(Hue), 채도(Saturation), 명도(Value) or 밝기 (Brightness)</p>



<p>RGB(Red, Green, Blue) 모델과 함께 가장 널리 사용되는 컬러 모델 중 하나입니다. </p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img decoding="async" width="523" height="388" src="https://lycos7560.com/wp-content/uploads/2024/03/image-57.png" alt="" class="wp-image-38096" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-57.png 523w, https://lycos7560.com/wp-content/uploads/2024/03/image-57-300x223.png 300w" sizes="(max-width: 523px) 100vw, 523px" /><figcaption class="wp-element-caption"><a href="https://en.wikipedia.org/wiki/HSL_and_HSV" target="_blank" rel="noreferrer noopener">https://en.wikipedia.org/wiki/HSL_and_HSV</a></figcaption></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img decoding="async" width="695" height="605" src="https://lycos7560.com/wp-content/uploads/2024/03/image-58.png" alt="" class="wp-image-38097" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-58.png 695w, https://lycos7560.com/wp-content/uploads/2024/03/image-58-300x261.png 300w" sizes="(max-width: 695px) 100vw, 695px" /><figcaption class="wp-element-caption"><a href="https://en.wikipedia.org/wiki/HSL_and_HSV" target="_blank" rel="noreferrer noopener">https://en.wikipedia.org/wiki/HSL_and_HSV</a></figcaption></figure>
</div>
</div>



<figure class="wp-block-video"><video height="904" style="aspect-ratio: 1720 / 904;" width="1720" controls src="https://lycos7560.com/wp-content/uploads/2024/03/RainbowColorPicker-1.mp4"></video></figure>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<h2 class="wp-block-heading">Hue 색상</h2>



<p>360도 무지개 색상</p>
</blockquote>



<p>색을 표현하는 요소 중 하나로 일반적으로 0에서 360도 사이의 각도를 나타냅니다</p>



<p>0도와 360도는 동일한 색상인 <mark style="background-color:rgba(0, 0, 0, 0);color:#ff0000" class="has-inline-color"><strong>빨간색</strong></mark>을, 120도는<strong> <mark style="background-color:rgba(0, 0, 0, 0);color:#0eff00" class="has-inline-color">녹색</mark></strong>을, 240도는 <mark style="background-color:rgba(0, 0, 0, 0);color:#2000ff" class="has-inline-color"><strong>파란색</strong></mark>을 나타냅니다.</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img decoding="async" width="194" height="436" src="https://lycos7560.com/wp-content/uploads/2024/03/HSVColor.gif" alt="" class="wp-image-38088"/><figcaption class="wp-element-caption">Unity Color Picker (HSV)</figcaption></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img decoding="async" width="415" height="412" src="https://lycos7560.com/wp-content/uploads/2024/03/image-56.png" alt="" class="wp-image-38090" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-56.png 415w, https://lycos7560.com/wp-content/uploads/2024/03/image-56-300x298.png 300w, https://lycos7560.com/wp-content/uploads/2024/03/image-56-150x150.png 150w" sizes="(max-width: 415px) 100vw, 415px" /><figcaption class="wp-element-caption"><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/hue" target="_blank" rel="noreferrer noopener">https://developer.mozilla.org/en-US/docs/Web/CSS/hue</a></figcaption></figure>
</div>
</div>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<h2 class="wp-block-heading">Saturation 채도</h2>



<p>풍부함(richness)과 선명함(vividness)</p>
</blockquote>



<p>색의 순도 또는 강도를 나타내는 색상 속성입니다. </p>



<p>높은 채도는 순수한 색에 가깝고, 낮은 채도는 회색조에 가까운 색을 의미합니다.</p>



<p>채도는 일반적으로 0부터 100 또는 0부터 1 사이의 값으로 표현됩니다. </p>



<p>0% 채도는 해당 색상이 회색조에 가깝다는 것을 의미하며, 100% 채도는 해당 색상이 순수한 색상임을 나타냅니다.</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img decoding="async" width="262" height="570" src="https://lycos7560.com/wp-content/uploads/2024/03/HSVColor_2.gif" alt="" class="wp-image-38094"/><figcaption class="wp-element-caption">Unity Color Picker (HSV)</figcaption></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow"></div>
</div>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<h2 class="wp-block-heading">Value 명도 (= Brightness 밝기)</h2>



<p>색의 밝기</p>
</blockquote>



<p>명도는 색의 밝기를 나타냅니다. </p>



<p>명도는 일반적으로 0부터 100 사이의 숫자로 나타내며 높을수록 색은 더 밝게 나타납니다. </p>



<p>명도가 0에 가까울수록 해당 색상은 검은색에 가깝고, 명도가 최대가 되면 해당 색상은 가장 밝은 상태가 됩니다.</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img decoding="async" width="176" height="382" src="https://lycos7560.com/wp-content/uploads/2024/03/HSVColor_3.gif" alt="" class="wp-image-38095"/><figcaption class="wp-element-caption">Unity Color Picker (HSV)</figcaption></figure>
</div>
</div>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>
<p>The post <a href="https://lycos7560.com/unity/hsv-hsb-color-%ec%a0%95%eb%a6%ac/38087/">HSV(= HSB) Color 정리</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lycos7560.com/unity/hsv-hsb-color-%ec%a0%95%eb%a6%ac/38087/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		<enclosure url="https://lycos7560.com/wp-content/uploads/2024/03/RainbowColorPicker-1.mp4" length="3374575" type="video/mp4" />

			</item>
		<item>
		<title>Getting started with Shader Graph &#8211; Master Stack / Sticky Notes</title>
		<link>https://lycos7560.com/unity/getting-started-with-shader-graph-master-stack-sticky-notes/38028/</link>
					<comments>https://lycos7560.com/unity/getting-started-with-shader-graph-master-stack-sticky-notes/38028/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Tue, 19 Mar 2024 16:07:33 +0000</pubDate>
				<category><![CDATA[Unity]]></category>
		<category><![CDATA[UnityShader]]></category>
		<category><![CDATA[Context]]></category>
		<category><![CDATA[Description]]></category>
		<category><![CDATA[Fragment]]></category>
		<category><![CDATA[Getting started with Shader Graph]]></category>
		<category><![CDATA[Graph]]></category>
		<category><![CDATA[Manual]]></category>
		<category><![CDATA[Master]]></category>
		<category><![CDATA[Master Stack]]></category>
		<category><![CDATA[Shader]]></category>
		<category><![CDATA[Shader Graph]]></category>
		<category><![CDATA[Sticky Notes]]></category>
		<category><![CDATA[study]]></category>
		<category><![CDATA[Unity Shader]]></category>
		<category><![CDATA[URP]]></category>
		<category><![CDATA[Vertex]]></category>
		<category><![CDATA[기초]]></category>
		<guid isPermaLink="false">https://lycos7560.com/?p=38028</guid>

					<description><![CDATA[<p>https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Master-Stack.html Master Stack Description Master Stack은 셰이더의 최종 표면 모습을 정의하는 Shader Graph의 끝점입니다.The Master Stack is the end point of a Shader Graph that defines the final surface appearance of a shader. Shader Graph에는 항상 하나의 마스터 스택만 포함되어야 합니다.Your Shader Graph should always contain only one Master Stack. 마스터 스택의 내용은 선택한 Graph [&#8230;]</p>
<p>The post <a href="https://lycos7560.com/unity/getting-started-with-shader-graph-master-stack-sticky-notes/38028/">Getting started with Shader Graph &#8211; Master Stack / Sticky Notes</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p><a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Master-Stack.html" target="_blank" rel="noreferrer noopener">https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Master-Stack.html</a></p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>


				<div class="wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-12711d18      "
					data-scroll= "1"
					data-offset= "30"
					style=""
				>
				<div class="uagb-toc__wrap">
						<div class="uagb-toc__title">
							Getting started with Shader Graph						</div>
																						<div class="uagb-toc__list-wrap ">
						<ol class="uagb-toc__list"><li class="uagb-toc__list"><a href="#master-stack" class="uagb-toc-link__trigger">Master Stack</a><ul class="uagb-toc__list"><li class="uagb-toc__list"><a href="#contexts" class="uagb-toc-link__trigger">Contexts</a></li></ul></li><li class="uagb-toc__list"><a href="#sticky-notes" class="uagb-toc-link__trigger">Sticky Notes</a><ul class="uagb-toc__list"><li class="uagb-toc__list"><a href="#using-sticky-notes" class="uagb-toc-link__trigger">Using Sticky Notes</a><li class="uagb-toc__list"><li class="uagb-toc__list"><a href="#editing-text" class="uagb-toc-link__trigger">Editing text</a><li class="uagb-toc__list"><li class="uagb-toc__list"><a href="#moving-and-resizing" class="uagb-toc-link__trigger">Moving and resizing</a><li class="uagb-toc__list"><li class="uagb-toc__list"><a href="#duplicating" class="uagb-toc-link__trigger">Duplicating</a><li class="uagb-toc__list"><li class="uagb-toc__list"><a href="#context-menu" class="uagb-toc-link__trigger">Context menu</a></ul></ul></ol>					</div>
									</div>
				</div>
			


<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-uagb-advanced-heading uagb-block-5260c951"><h2 class="uagb-heading-text">Master Stack</h2></div>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide" style="margin-top:var(--wp--preset--spacing--60);margin-bottom:var(--wp--preset--spacing--60)"/>



<p class="has-medium-font-size"><strong>Description</strong></p>



<p>Master Stack은 셰이더의 최종 표면 모습을 정의하는 Shader Graph의 끝점입니다.<br>The Master Stack is the end point of a Shader Graph that defines the final surface appearance of a shader. </p>



<p>Shader Graph에는 항상 하나의 마스터 스택만 포함되어야 합니다.<br>Your Shader Graph should always contain only one Master Stack.</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<figure data-wp-context="{&quot;imageId&quot;:&quot;69cf95dd083e1&quot;}" data-wp-interactive="core/image" data-wp-key="69cf95dd083e1" class="wp-block-image size-full wp-lightbox-container"><img decoding="async" width="502" height="780" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://lycos7560.com/wp-content/uploads/2024/03/image-39.png" alt="" class="wp-image-38029" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-39.png 502w, https://lycos7560.com/wp-content/uploads/2024/03/image-39-193x300.png 193w" sizes="(max-width: 502px) 100vw, 502px" /><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			aria-label="확대하기"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.imageButtonRight"
			data-wp-style--top="state.imageButtonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button><figcaption class="wp-element-caption">Master Stack</figcaption></figure>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p>마스터 스택의 내용은 선택한 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Graph-Settings-Tab.html" target="_blank" rel="noreferrer noopener">Graph Settings</a>에 따라 변경될 수 있습니다.<br>The content of the Master Stack might change depending on the <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Graph-Settings-Tab.html" target="_blank" rel="noreferrer noopener">Graph Settings</a> you select. </p>



<p>마스터 스택은 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Block-Node.html" target="_blank" rel="noreferrer noopener">Block nodes</a>를 포함하는 컨텍스트로 구성됩니다.<br>The Master Stack is made up of Contexts, which contain <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Block-Node.html" target="_blank" rel="noreferrer noopener">Block nodes</a>.</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure data-wp-context="{&quot;imageId&quot;:&quot;69cf95dd08891&quot;}" data-wp-interactive="core/image" data-wp-key="69cf95dd08891" class="wp-block-image size-full wp-lightbox-container"><img decoding="async" width="760" height="650" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://lycos7560.com/wp-content/uploads/2024/03/image-40.png" alt="" class="wp-image-38030" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-40.png 760w, https://lycos7560.com/wp-content/uploads/2024/03/image-40-300x257.png 300w" sizes="(max-width: 760px) 100vw, 760px" /><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			aria-label="확대하기"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.imageButtonRight"
			data-wp-style--top="state.imageButtonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button><figcaption class="wp-element-caption">Lit</figcaption></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure data-wp-context="{&quot;imageId&quot;:&quot;69cf95dd08c74&quot;}" data-wp-interactive="core/image" data-wp-key="69cf95dd08c74" class="wp-block-image size-full wp-lightbox-container"><img decoding="async" width="769" height="567" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://lycos7560.com/wp-content/uploads/2024/03/image-41.png" alt="" class="wp-image-38031" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-41.png 769w, https://lycos7560.com/wp-content/uploads/2024/03/image-41-300x221.png 300w" sizes="(max-width: 769px) 100vw, 769px" /><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			aria-label="확대하기"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.imageButtonRight"
			data-wp-style--top="state.imageButtonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button><figcaption class="wp-element-caption">Unlit</figcaption></figure>
</div>
</div>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-uagb-advanced-heading uagb-block-0d77379d"><h3 class="uagb-heading-text">Contexts</h3></div>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<figure data-wp-context="{&quot;imageId&quot;:&quot;69cf95dd09118&quot;}" data-wp-interactive="core/image" data-wp-key="69cf95dd09118" class="wp-block-image size-full wp-lightbox-container"><img decoding="async" width="382" height="436" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://lycos7560.com/wp-content/uploads/2024/03/image-42.png" alt="" class="wp-image-38032" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-42.png 382w, https://lycos7560.com/wp-content/uploads/2024/03/image-42-263x300.png 263w" sizes="(max-width: 382px) 100vw, 382px" /><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			aria-label="확대하기"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.imageButtonRight"
			data-wp-style--top="state.imageButtonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button></figure>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p>마스터 스택에는 두 개의 컨텍스트인<strong> Vertex</strong>와 <strong>Fragment</strong>가 포함되어 있습니다.<br>The Master Stack contains two Contexts: <strong>Vertex</strong> and <strong>Fragment</strong>. </p>



<p>이들은 shader의 두 단계를 나타냅니다.<br>These represent the two stages of a shader.</p>



<p>Vertex Context의 Block에 연결하는 노드는 최종<strong> shader의  Vertex function의 일부가 됩니다.</strong><br>Nodes that you connect to Blocks in the Vertex Context become part of the final shader&#8217;s vertex function.</p>



<p>Fragment Context의 블록에 연결하는 Node는 최종<strong> shader의 Fragment(또는 픽셀) function의 일부</strong>가 됩니다.<br>Nodes that you connect to Blocks in the Fragment Context become part of the final shader&#8217;s fragment (or pixel) function. </p>



<p>두 컨텍스트에 모두 노드를 연결하면 해당 node가 <strong>Vertex function에서 한 번 실행되고 Fragment function에서 다시 한 번 실행</strong>됩니다.<br>If you connect any nodes to both Contexts, they are executed twice, once in the vertex function and then again in the fragment function.</p>



<p>컨텍스트를 잘라내거나 복사하거나 붙여넣을 수 없습니다.<br>You can&#8217;t cut, copy, or paste Contexts.</p>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<p><a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Sticky-Notes.html" target="_blank" rel="noreferrer noopener">https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Sticky-Notes.html</a></p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading" id="sticky-notes">Sticky Notes</h2>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide" style="margin-top:var(--wp--preset--spacing--60);margin-bottom:var(--wp--preset--spacing--60)"/>



<p>Sticky Note는 그래프 보기에서 작성할 수 있는 객체로, <strong>코드의 주석과 유사</strong>합니다. <strong>제목</strong>(title)과 <strong>본문</strong>(body)으로 구성되어 있습니다.<br>Sticky Notes are objects in a graph view that you can write in. They are the graph view equivalent of a comment in code, and consist of a title and body. </p>



<p>그래프에서 원하는 만큼 만들 수 있으며 다음과 같은 다양한 용도로 사용할 수 있습니다:<br>You can create as many as you want in the graph, and use them for a variety of purposes, for example:</p>



<ul class="wp-block-list">
<li>그래프의 섹션 작동 방식을 설명하는 데 사용할 수 있습니다.<br>To describe how a section of your graph works.</li>



<li>유니티 프로젝트에서 공동 작업하는 사용자 또는 다른 사용자에게 메모를 남깁니다.<br>To leave notes for yourself or others collaborating in your Unity Project.</li>



<li>나중에 완료할 작업을 포함하는 할 일 목록으로 사용할 수 있습니다.<br>As a to-do list that includes tasks to complete at a later date.</li>
</ul>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading" id="using-sticky-notes">Using Sticky Notes</h3>



<p>Sticky Note를 만들려면 그래프 보기에서 빈 공간을 마우스 오른쪽 단추로 클릭하고 컨텍스트 메뉴에서 <strong>Create Sticky Note</strong>를 클릭합니다.<br>To create a Sticky Note, right-click an empty space in the graph view and, in the context menu, click <strong>Create Sticky Note</strong>. </p>



<p>그런 다음 새 Sticky Note에 내용을 사용자 정의하고 추가할 수 있습니다. <br>You can then customize and add content to the new Sticky Note. </p>



<p>다음에 쓸 수 있는 텍스트 영역은 두 가지입니다:<br>There are two text areas that you can write in:</p>



<ul class="wp-block-list">
<li><strong>제목</strong> : Sticky Note 상단에 있는 텍스트 영역이 제목입니다. 이를 사용하여 Sticky Note에 어떤 정보가 포함되어 있는지 간결하게 설명할 수 있습니다.<br><strong>Title</strong>: The text area at the top of the Sticky Note is the title. You can use it to concisely describe what information the Sticky Note contains.</li>



<li><strong>본문</strong>: 제목 영역 아래에 있는 더 큰 텍스트 영역은 본문입니다. 여기에 메모의 전체 내용을 작성하시면 됩니다.<br><strong>Body</strong>: The larger text area below the title area is the body. You can write the full contents of the note here.</li>
</ul>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:50%">
<figure class="wp-block-image size-full"><img decoding="async" width="311" height="279" src="https://lycos7560.com/wp-content/uploads/2024/03/image-43.png" alt="" class="wp-image-38033" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-43.png 311w, https://lycos7560.com/wp-content/uploads/2024/03/image-43-300x269.png 300w" sizes="(max-width: 311px) 100vw, 311px" /></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:50%">
<figure class="wp-block-image size-full"><img decoding="async" width="273" height="202" src="https://lycos7560.com/wp-content/uploads/2024/03/image-44.png" alt="" class="wp-image-38034"/></figure>
</div>
</div>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading" id="editing-text">Editing text</h3>



<p>Sticky Note에서 텍스트를 편집하려면 텍스트 영역을 <strong>두 번 클릭</strong>합니다.<br>To edit text on a Sticky Note, <strong>double-click</strong> on a text area.</p>



<p>또한 전체 텍스트 영역을 선택하므로 텍스트를 편집하기 전에 커서를 이동해야 합니다.<br>This also selects the entire text area, so be sure to move the cursor before you edit the text.</p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading" id="moving-and-resizing">Moving and resizing</h3>



<p>그래프의 아무 곳이나 스티커 메모를 이동할 수 있습니다.<br>You can move Sticky Notes anywhere on the graph. </p>



<p>클릭한 후 드래그하여 Sticky Note의 크기를 수동으로 조정하거나 Sticky Note가 내용에 맞게 자동으로 크기를 조정하도록 할 수도 있습니다.<br>You can also click and drag to manually resize Sticky Notes, or have a Sticky Note automatically resize itself to fit the content. </p>



<p> Sticky Note 크기를 직접 조정하는 방법에 대한 자세한 내용은 아래 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Sticky-Notes.html#context-menu" target="_blank" rel="noreferrer noopener">Context menu</a> 섹션의 <strong>Fit To Text</strong>를 참조하십시오.<br>For information on how to make the Sticky Note resize itself, see <strong>Fit To Text</strong> in the <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Sticky-Notes.html#context-menu" target="_blank" rel="noreferrer noopener">Context menu</a> section below.</p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading" id="duplicating">Duplicating</h3>



<p>다음 키보드 바로 가기를 사용하여 Sticky Note를 자르고, 복사하고, 붙여넣고, 복제합니다.<br>Use the following keyboard shortcuts to cut, copy, paste, and duplicate Sticky Notes.</p>



<ul class="wp-block-list">
<li><strong>Copy</strong>: Ctrl+C</li>



<li><strong>Cut</strong>: Ctrl+X</li>



<li><strong>Paste</strong>: Ctrl+V</li>



<li><strong>Duplicate</strong>: Ctrl+D</li>
</ul>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<h3 class="wp-block-heading" id="context-menu">Context menu</h3>



<p>Sticky Note의 컨텍스트 메뉴를 열려면 해당 메뉴의 아무 곳이나 마우스 오른쪽 단추로 클릭합니다.<br>To open the context menu for a Sticky Note, right-click anywhere on it. </p>



<p>컨텍스트 메뉴의 옵션은 다음과 같습니다.<br>The options in the context menu are as follows.</p>



<figure class="wp-block-table"><table><thead><tr><th><strong>Option</strong></th><th><strong>Description</strong></th></tr></thead><tbody><tr><td><strong>Dark Theme/Light Theme</strong></td><td>Sticky Note의 색상 테마를 <strong>밝은 테마</strong>와 <strong>어두운 테마</strong> 사이에서 전환합니다.<br>Toggles the color theme of the Sticky Note between light theme and dark theme.</td></tr><tr><td><strong>Text Size</strong></td><td>각 텍스트 영역의 폰트 크기를 다음과 같은 포인트 값으로 조정합니다.<br>Resizes the font in the text areas to the following point values.</td></tr><tr><td>Small</td><td>Title: 20, Body: 11</td></tr><tr><td>Medium</td><td>Title: 40, Body: 24</td></tr><tr><td>Large</td><td>Title: 60, Body: 36</td></tr><tr><td>Huge</td><td>Title: 80, Body: 56</td></tr><tr><td><strong>Fit To Text</strong></td><td>Sticky Note의 크기를 텍스트 영역에 정확히 맞게 조정합니다. <br>Resizes the Sticky Note so that it precisely fits the text areas. <br>제목이 한 줄을 초과하는 경우 Unity는 제목 텍스트가 한 줄에 맞게 Sticky Note의 크기를 조정합니다.<br>If your title exceeds a single line, Unity resizes the Sticky Note such that title text fits on a single line.</td></tr><tr><td><strong>Delete</strong></td><td>선택한 Sticky Note를 삭제합니다.<br>Deletes the Sticky Note you selected.</td></tr><tr><td><strong>Group Selection</strong></td><td>선택한 Sticky Note를 그룹에 배치합니다.<br>Places any Sticky Notes you select in a group.</td></tr><tr><td><strong>Ungroup Selection</strong></td><td>그룹에서 선택한 모든 Sticky Notes를 제거합니다.<br>Removes any Sticky Notes you select from the group.</td></tr></tbody></table></figure>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:50%">
<figure class="wp-block-image size-full"><img decoding="async" width="416" height="390" src="https://lycos7560.com/wp-content/uploads/2024/03/image-45.png" alt="" class="wp-image-38035" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-45.png 416w, https://lycos7560.com/wp-content/uploads/2024/03/image-45-300x281.png 300w" sizes="(max-width: 416px) 100vw, 416px" /></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:50%">
<figure class="wp-block-image size-full"><img decoding="async" width="245" height="214" src="https://lycos7560.com/wp-content/uploads/2024/03/image-46.png" alt="" class="wp-image-38036"/><figcaption class="wp-element-caption"><strong>Group Selection</strong></figcaption></figure>
</div>
</div>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p></p>
<p>The post <a href="https://lycos7560.com/unity/getting-started-with-shader-graph-master-stack-sticky-notes/38028/">Getting started with Shader Graph &#8211; Master Stack / Sticky Notes</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lycos7560.com/unity/getting-started-with-shader-graph-master-stack-sticky-notes/38028/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Getting started with Shader Graph &#8211; Create Node Menu</title>
		<link>https://lycos7560.com/unity/getting-started-with-shader-graph-create-node-menu/38017/</link>
					<comments>https://lycos7560.com/unity/getting-started-with-shader-graph-create-node-menu/38017/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Tue, 19 Mar 2024 15:06:33 +0000</pubDate>
				<category><![CDATA[Unity]]></category>
		<category><![CDATA[UnityShader]]></category>
		<category><![CDATA[Block Node]]></category>
		<category><![CDATA[Contextual]]></category>
		<category><![CDATA[Contextual Create Node Menu]]></category>
		<category><![CDATA[Create]]></category>
		<category><![CDATA[Create Node]]></category>
		<category><![CDATA[Create Node Menu]]></category>
		<category><![CDATA[Getting started with Shader Graph]]></category>
		<category><![CDATA[Manual]]></category>
		<category><![CDATA[Master Stack]]></category>
		<category><![CDATA[Master Stack Create Node Menu]]></category>
		<category><![CDATA[Node Menu]]></category>
		<category><![CDATA[Shader Graph]]></category>
		<category><![CDATA[Unity Shader]]></category>
		<category><![CDATA[URP]]></category>
		<category><![CDATA[노드]]></category>
		<category><![CDATA[노드 생성]]></category>
		<category><![CDATA[생성]]></category>
		<category><![CDATA[유니티]]></category>
		<guid isPermaLink="false">https://lycos7560.com/?p=38017</guid>

					<description><![CDATA[<p>https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Create-Node-Menu.html Create Node Menu Description Shader Graph에서 nodes를 생성하기 위해 Create Node Menu를 사용합니다.Use the Create Node Menu to create nodes in Shader Graph. 노드 생성 메뉴를 열려면 Shader Graph 창의 작업 공간을 마우스 오른쪽 버튼으로 클릭하고 &#8220;Create Node&#8221;을 선택하거나, 스페이스바를 누릅니다.To open the Create Node Menu, either right-click on the workspace in the Shader Graph Window and select Create Node, or press [&#8230;]</p>
<p>The post <a href="https://lycos7560.com/unity/getting-started-with-shader-graph-create-node-menu/38017/">Getting started with Shader Graph &#8211; Create Node Menu</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<p><a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Create-Node-Menu.html" target="_blank" rel="noreferrer noopener">https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Create-Node-Menu.html</a></p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>


				<div class="wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-12711d18      "
					data-scroll= "1"
					data-offset= "30"
					style=""
				>
				<div class="uagb-toc__wrap">
						<div class="uagb-toc__title">
							Getting started with Shader Graph						</div>
																						<div class="uagb-toc__list-wrap ">
						<ol class="uagb-toc__list"><li class="uagb-toc__list"><a href="#create-node-menu" class="uagb-toc-link__trigger">Create Node Menu</a><li class="uagb-toc__list"><a href="#contextual-create-node-menu" class="uagb-toc-link__trigger">Contextual Create Node Menu</a><li class="uagb-toc__list"><a href="#master-stack-create-node-menu" class="uagb-toc-link__trigger">Master Stack Create Node Menu</a></ol>					</div>
									</div>
				</div>
			


<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-uagb-advanced-heading uagb-block-5260c951"><h2 class="uagb-heading-text">Create Node Menu</h2></div>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide" style="margin-top:var(--wp--preset--spacing--60);margin-bottom:var(--wp--preset--spacing--60)"/>



<p class="has-medium-font-size"><strong>Description</strong></p>



<p>Shader Graph에서 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">nodes</a>를 생성하기 위해 <strong>Create Node Menu</strong>를 사용합니다.<br>Use the <strong>Create Node Menu</strong> to create <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">nodes</a> in Shader Graph. </p>



<p>노드 생성 메뉴를 열려면 Shader Graph 창의 작업 공간을 <strong>마우스 오른쪽 버튼으로 클릭하고 &#8220;Create Node&#8221;을 선택하거나, 스페이스바를 누릅니다.</strong><br>To open the <strong>Create Node Menu</strong>, either right-click on the workspace in the <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Shader-Graph-Window.html" target="_blank" rel="noreferrer noopener">Shader Graph Window</a> and select <strong>Create Node</strong>, or press the spacebar.</p>



<p><strong>Create Node Menu</strong>의 맨 위에는 검색 창이 있습니다.<br>At the top of the <strong>Create Node Menu</strong> is a search bar. </p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure data-wp-context="{&quot;imageId&quot;:&quot;69cf95dd0ff26&quot;}" data-wp-interactive="core/image" data-wp-key="69cf95dd0ff26" class="wp-block-image size-full wp-lightbox-container"><img decoding="async" width="267" height="297" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://lycos7560.com/wp-content/uploads/2024/03/image-34.png" alt="" class="wp-image-38019"/><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			aria-label="확대하기"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.imageButtonRight"
			data-wp-style--top="state.imageButtonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button><figcaption class="wp-element-caption">마우스 우클릭 후 <strong>Create Node</strong> 선택</figcaption></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure data-wp-context="{&quot;imageId&quot;:&quot;69cf95dd102e9&quot;}" data-wp-interactive="core/image" data-wp-key="69cf95dd102e9" class="wp-block-image size-full wp-lightbox-container"><img decoding="async" width="333" height="318" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://lycos7560.com/wp-content/uploads/2024/03/image-35.png" alt="" class="wp-image-38020" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-35.png 333w, https://lycos7560.com/wp-content/uploads/2024/03/image-35-300x286.png 300w" sizes="(max-width: 333px) 100vw, 333px" /><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			aria-label="확대하기"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.imageButtonRight"
			data-wp-style--top="state.imageButtonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button><figcaption class="wp-element-caption"><strong>SpaceBar</strong></figcaption></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure data-wp-context="{&quot;imageId&quot;:&quot;69cf95dd1067c&quot;}" data-wp-interactive="core/image" data-wp-key="69cf95dd1067c" class="wp-block-image size-full wp-lightbox-container"><img decoding="async" width="346" height="327" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://lycos7560.com/wp-content/uploads/2024/03/image-36.png" alt="" class="wp-image-38021" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-36.png 346w, https://lycos7560.com/wp-content/uploads/2024/03/image-36-300x284.png 300w" sizes="(max-width: 346px) 100vw, 346px" /><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			aria-label="확대하기"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.imageButtonRight"
			data-wp-style--top="state.imageButtonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button><figcaption class="wp-element-caption"><strong>Tab</strong>을 이용하여 예측 텍스트 수락</figcaption></figure>
</div>
</div>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p>node를 검색하려면 검색 필드에 이름의 일부를 입력하십시오.<br>To search for a node, type any part of its name in the search field. </p>



<p>검색 상자는 자동 완성 옵션을 제공하며, 예측 텍스트를 수락하려면 <strong>Tab을 누르십시오.</strong><br>The search box gives you autocomplete options, and you can press Tab to accept the predictive text.</p>



<p>일치하는 텍스트를 노란색으로 강조합니다.<br>It highlights matching text in yellow.</p>



<p><strong>Create Node Menu</strong> lists에는 기능별로 분류된 Shader Graph에서 사용 가능한 모든 노드가 나열됩니다.<br>The <strong>Create Node Menu</strong> lists all nodes that are available in Shader Graph, categorized by their function.</p>



<p>사용자가 작성한 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Sub-graph.html" target="_blank" rel="noreferrer noopener">Sub Graphs</a>는 서브 그래프 에셋 하위의 <strong>Create Node Menu</strong>에서 사용할 수 있으며, <strong>Sub Graph Assets</strong>에서 정의한 사용자 지정 카테고리에도 사용할 수 있습니다.<br>User-created <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Sub-graph.html" target="_blank" rel="noreferrer noopener">Sub Graphs</a> are also available in the <strong>Create Node Menu</strong> under <strong>Sub Graph Assets</strong>, or in a custom category that you define in the Sub Graph Asset.</p>



<p>작업 공간에 노드를 추가하려면 <strong>Create Node Menu</strong>에서 해당 노드를 두 번 클릭하십시오.<br>To add a node to the workspace, double-click it in the <strong>Create Node Menu</strong>.</p>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading" id="contextual-create-node-menu">Contextual Create Node Menu</h2>



<p>컨텍스트에 맞는 <strong>Create Node Menu</strong>는 사용 가능한 노드를 필터링하고 선택한 엣지의 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Data-Types.html" target="_blank" rel="noreferrer noopener">Data Type</a>을 사용하는 노드만 표시합니다.<br>A contextual <strong>Create Node Menu</strong> filters the available nodes, and only shows those that use the <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Data-Types.html" target="_blank" rel="noreferrer noopener">Data Type</a> of a selected edge. </p>



<p>해당 Data Type과 일치하는 노드의 모든 사용 가능한 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Port.html" target="_blank" rel="noreferrer noopener">Port</a>를 나열합니다.<br>It lists every available <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Port.html" target="_blank" rel="noreferrer noopener">Port</a> on nodes that match that Data Type.</p>



<p>컨텍스트에 맞는  <strong>Create Node Menu</strong>를 열려면 포트에서 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Edge.html" target="_blank" rel="noreferrer noopener">Edge</a>를 클릭하고 드래그한 다음 작업 공간의 빈 영역에 놓으면 됩니다.<br>To open a contextual <strong>Create Node Menu</strong>, click and drag an <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Edge.html" target="_blank" rel="noreferrer noopener">Edge</a> from a Port, and then release it in an empty area of the workspace.</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<figure data-wp-context="{&quot;imageId&quot;:&quot;69cf95dd10d1f&quot;}" data-wp-interactive="core/image" data-wp-key="69cf95dd10d1f" class="wp-block-image size-full wp-lightbox-container"><img decoding="async" width="905" height="389" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://lycos7560.com/wp-content/uploads/2024/03/image-37.png" alt="" class="wp-image-38022" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-37.png 905w, https://lycos7560.com/wp-content/uploads/2024/03/image-37-300x129.png 300w, https://lycos7560.com/wp-content/uploads/2024/03/image-37-768x330.png 768w" sizes="(max-width: 905px) 100vw, 905px" /><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			aria-label="확대하기"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.imageButtonRight"
			data-wp-style--top="state.imageButtonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button><figcaption class="wp-element-caption">정점(Edge)을 클릭하고 드래그하여 생성<br>선택한 정점(Edge)의 DataType을 기반으로 사용 가능한 node를 필터링하여 특정 컨텍스트에서 사용자에게 적합한 노드를 제안하는 메뉴</figcaption></figure>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<h2 class="wp-block-heading" id="master-stack-create-node-menu">Master Stack Create Node Menu</h2>



<p>새로운 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Create-Node-Menu.html" target="_blank" rel="noreferrer noopener">Block Node</a>를 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Create-Node-Menu.html">Master Stack</a>에 추가하려면 마우스 오른쪽 버튼을 클릭하고 &#8220;<strong>Create Node</strong>&#8220;을 선택하거나 스택을 선택한 상태에서 스페이스바를 누르세요.<br>To add a new <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Create-Node-Menu.html" target="_blank" rel="noreferrer noopener">Block Node</a> to the <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Create-Node-Menu.html" target="_blank" rel="noreferrer noopener">Master Stack</a>, either right click and select <strong>Create Node</strong> or press spacebar with the stack selected.</p>



<p>&#8220;<strong>Create Node Menu</strong>&#8220;는 <strong>프로젝트의 렌더 파이프라인을 기반으로 마스터 스택에 사용 가능한 모든 블록을 표시</strong>합니다.<br>The <strong>Create Node Menu</strong> will display all available blocks for the master stack based on the render pipelines in your project.</p>



<p>&#8220;<strong>Create Node Menu</strong>&#8220;를 통해 마스터 스택에 어떤 블록이든 추가할 수 있습니다.<br>Any block can be added to the master stack via the <strong>Create Node Menu</strong>.</p>



<p>추가된 block이 현재 Graph settings과 호환되지 않는 경우, 해당 block은 설정이 지원될 때까지 <strong>비활성화</strong>됩니다.<br>If the block added is not compatible with the current Graph settings, the block will be disabled until the settings are configured to support it.</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<figure data-wp-context="{&quot;imageId&quot;:&quot;69cf95dd111c1&quot;}" data-wp-interactive="core/image" data-wp-key="69cf95dd111c1" class="wp-block-image size-full wp-lightbox-container"><img decoding="async" width="1164" height="713" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://lycos7560.com/wp-content/uploads/2024/03/image-38.png" alt="" class="wp-image-38023" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-38.png 1164w, https://lycos7560.com/wp-content/uploads/2024/03/image-38-300x184.png 300w, https://lycos7560.com/wp-content/uploads/2024/03/image-38-768x470.png 768w" sizes="(max-width: 1164px) 100vw, 1164px" /><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			aria-label="확대하기"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.imageButtonRight"
			data-wp-style--top="state.imageButtonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button><figcaption class="wp-element-caption">MasterStack에 블록추가 / 호환되지 않는 경우에는 해당 block은 설정이 지원될 때까지 <strong>비활성화</strong></figcaption></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>
<p>The post <a href="https://lycos7560.com/unity/getting-started-with-shader-graph-create-node-menu/38017/">Getting started with Shader Graph &#8211; Create Node Menu</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lycos7560.com/unity/getting-started-with-shader-graph-create-node-menu/38017/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Getting started with Shader Graph &#8211; Shader Graph Window</title>
		<link>https://lycos7560.com/unity/shader-graph-window/37987/</link>
					<comments>https://lycos7560.com/unity/shader-graph-window/37987/#respond</comments>
		
		<dc:creator><![CDATA[lycos7560]]></dc:creator>
		<pubDate>Sun, 17 Mar 2024 15:49:57 +0000</pubDate>
				<category><![CDATA[Unity]]></category>
		<category><![CDATA[UnityShader]]></category>
		<category><![CDATA[Graph]]></category>
		<category><![CDATA[Shader]]></category>
		<category><![CDATA[Shader Graph Window]]></category>
		<category><![CDATA[URP]]></category>
		<guid isPermaLink="false">https://lycos7560.com/?p=37987</guid>

					<description><![CDATA[<p>https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Shader-Graph-Window.html Shader Graph Window Description Shader Graph Window에는Shader Graph 시스템을 사용하여 셰이더를 생성하는 작업 공간이 포함되어 있습니다. The&#160;Shader Graph Window&#160;contains the workspace for creating shaders using the&#160;Shader Graph&#160;system. Shader Graph Window을 열려면 먼저 Shader Graph Asset을 생성해야 합니다. 자세한 정보는 시작하기 섹션을 참조하십시오.To open the&#160;Shader Graph Window&#160;you must first create a&#160;Shader Graph Asset. For more [&#8230;]</p>
<p>The post <a href="https://lycos7560.com/unity/shader-graph-window/37987/">Getting started with Shader Graph &#8211; Shader Graph Window</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<p><a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Shader-Graph-Window.html" target="_blank" rel="noreferrer noopener">https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Shader-Graph-Window.html</a></p>



<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>


				<div class="wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-12711d18      "
					data-scroll= "1"
					data-offset= "30"
					style=""
				>
				<div class="uagb-toc__wrap">
						<div class="uagb-toc__title">
							Getting started with Shader Graph &#8211; Shader Graph Window						</div>
																						<div class="uagb-toc__list-wrap ">
						<ol class="uagb-toc__list"><li class="uagb-toc__list"><a href="#shader-graph-window" class="uagb-toc-link__trigger">Shader Graph Window</a><ul class="uagb-toc__list"><li class="uagb-toc__list"><a href="#blackboard" class="uagb-toc-link__trigger">Blackboard</a><li class="uagb-toc__list"><li class="uagb-toc__list"><a href="#main-preview" class="uagb-toc-link__trigger">Main Preview</a><li class="uagb-toc__list"><li class="uagb-toc__list"><a href="#graph-inspector" class="uagb-toc-link__trigger">Graph Inspector</a></ul></ol>					</div>
									</div>
				</div>
			


<div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-uagb-advanced-heading uagb-block-03d17943"><h1 class="uagb-heading-text">Shader Graph Window</h1></div>



<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide" style="margin-top:var(--wp--preset--spacing--60);margin-bottom:var(--wp--preset--spacing--60)"/>



<figure data-wp-context="{&quot;imageId&quot;:&quot;69cf95dd153de&quot;}" data-wp-interactive="core/image" data-wp-key="69cf95dd153de" class="wp-block-image size-full wp-lightbox-container"><img decoding="async" width="1600" height="949" data-wp-class--hide="state.isContentHidden" data-wp-class--show="state.isContentVisible" data-wp-init="callbacks.setButtonStyles" data-wp-on--click="actions.showLightbox" data-wp-on--load="callbacks.setButtonStyles" data-wp-on-window--resize="callbacks.setButtonStyles" src="https://lycos7560.com/wp-content/uploads/2024/03/image-10-1.jpg" alt="" class="wp-image-37988" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-10-1.jpg 1600w, https://lycos7560.com/wp-content/uploads/2024/03/image-10-1-300x178.jpg 300w, https://lycos7560.com/wp-content/uploads/2024/03/image-10-1-768x456.jpg 768w, https://lycos7560.com/wp-content/uploads/2024/03/image-10-1-1536x911.jpg 1536w" sizes="(max-width: 1600px) 100vw, 1600px" /><button
			class="lightbox-trigger"
			type="button"
			aria-haspopup="dialog"
			aria-label="확대하기"
			data-wp-init="callbacks.initTriggerButton"
			data-wp-on--click="actions.showLightbox"
			data-wp-style--right="state.imageButtonRight"
			data-wp-style--top="state.imageButtonTop"
		>
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z" />
			</svg>
		</button></figure>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><strong>Description</strong></p>



<p><strong>Shader Graph Window</strong>에는<strong>Shader Graph</strong> 시스템을 사용하여 셰이더를 생성하는 작업 공간이 포함되어 있습니다. <br>The&nbsp;<strong>Shader Graph Window</strong>&nbsp;contains the workspace for creating shaders using the&nbsp;<strong>Shader Graph</strong>&nbsp;system.</p>



<p><strong>Shader Graph Window</strong>을 열려면 먼저 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/index.html" target="_blank" rel="noreferrer noopener">Shader Graph Asset</a>을 생성해야 합니다. 자세한 정보는 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Getting-Started.html" target="_blank" rel="noreferrer noopener">시작하기 섹션을 참조</a>하십시오.<br>To open the&nbsp;<strong>Shader Graph Window</strong>&nbsp;you must first create a&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/index.html" target="_blank" rel="noreferrer noopener">Shader Graph Asset</a>. For more information see the&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Getting-Started.html" target="_blank" rel="noreferrer noopener">Getting Started</a>&nbsp;section.</p>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><strong>Title Bar</strong></p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p>Title Bar는 <strong>Shader Graph Window</strong> 상단에 위치하며<strong> <strong>Graph</strong></strong>에 수행할 수 있는 작업을 포함하고 있습니다.<br>The title bar at the top of the&nbsp;<strong>Shader Graph Window</strong>&nbsp;contains actions that can be performed on the&nbsp;<strong>Graph</strong>.</p>



<figure class="wp-block-table"><table><thead><tr><th>Item</th><th>Description</th></tr></thead><tbody><tr><td>Save Asset</td><td><a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/index.html" target="_blank" rel="noreferrer noopener">Shader Graph Asset</a>을 업데이트하기 위해 그래프를 저장합니다.<br>Saves the graph to update the&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/index.html" target="_blank" rel="noreferrer noopener">Shader Graph Asset</a></td></tr><tr><td>Save As</td><td>새 이름으로 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/index.html" target="_blank" rel="noreferrer noopener">Shader Graph Asset</a>을 저장할 수 있는 파일 대화 상자를 엽니다.<br>Opens a file dialog that allows the user to save out the&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/index.html" target="_blank" rel="noreferrer noopener">Shader Graph Asset</a>&nbsp;under a new name.</td></tr><tr><td>Show In Project</td><td><a href="https://docs.unity3d.com/Manual/ProjectView.html" target="_blank" rel="noreferrer noopener">Project Window</a>에서 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/index.html" target="_blank" rel="noreferrer noopener">Shader Graph Asset</a>을 강조 표시합니다.<br>Highlights the&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/index.html" target="_blank" rel="noreferrer noopener">Shader Graph Asset</a>&nbsp;in the&nbsp;<a href="https://docs.unity3d.com/Manual/ProjectView.html" target="_blank" rel="noreferrer noopener">Project Window</a><br><img decoding="async" width="250" height="47" class="wp-image-37989" style="width: 250px;" src="https://lycos7560.com/wp-content/uploads/2024/03/image-10.png" alt=""></td></tr><tr><td>Check Out</td><td>버전 관리가 활성화된 경우, 소스 제어 공급자로부터 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/index.html" target="_blank" rel="noreferrer noopener">Shader Graph Asset</a>을 체크아웃합니다.<br>If version control is enabled, this will check out the&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/index.html" target="_blank" rel="noreferrer noopener">Shader Graph Asset</a>&nbsp;from the source control provider.</td></tr><tr><td>Color Mode</td><td>그래프의 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Color-Modes.html" target="_blank" rel="noreferrer noopener">Color Mode</a>를 선택할 수 있는 드롭다운 메뉴를 제공합니다.<br>Provides the drop down menu to select a&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Color-Modes.html" target="_blank" rel="noreferrer noopener">Color Mode</a>&nbsp;for the graph.</td></tr><tr><td>Blackboard</td><td><a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Blackboard.html" target="_blank" rel="noreferrer noopener">Blackboard</a>의 가시성을 전환합니다.<br>Toggles visibility of the&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Blackboard.html" target="_blank" rel="noreferrer noopener">Blackboard</a>.</td></tr><tr><td>Graph Inspector</td><td><a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Internal-Inspector.html" target="_blank" rel="noreferrer noopener">Graph Inspector</a>의 가시성을 전환합니다.<br>Toggles visibility of the&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Internal-Inspector.html" target="_blank" rel="noreferrer noopener">Graph Inspector</a>.</td></tr><tr><td>Main Preview</td><td><a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Main-Preview.html" target="_blank" rel="noreferrer noopener">Main Preview</a>의 가시성을 전환합니다.<br>Toggles visbility of the&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Main-Preview.html" target="_blank" rel="noreferrer noopener">Main Preview</a>.</td></tr></tbody></table></figure>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><strong>Workspace</strong></p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p>Workspace는 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">Node</a>&nbsp;networks를 생성하는 곳입니다.<br>The workspace is where you create&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html">Node</a>&nbsp;networks.</p>



<p>Alt 키를 누른 채로 왼쪽 마우스 버튼을 눌러서 마우스 스크롤 휠로 패닝 및 줌할 수 있습니다.<br>You can navigate the workspace by holding Alt and left mouse button to pan and zoom with the scroll wheel.</p>



<p>마우스 왼쪽 버튼을 누른 채로 드래그하여 마르키를 사용하여 여러 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">Nodes</a>를 선택할 수 있습니다.<br>You can hold left mouse button and drag to select multiple&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">Nodes</a>&nbsp;with a marquee. <br>(&#8220;마르키(marquee)&#8221;는 그래픽 사용자 인터페이스에서 여러 항목을 선택하는 방법을 설명하는 용어)</p>



<p>더 나은 워크플로를 위해 다양한 바로 가기 키도 사용할 수 있습니다.<br>There are also various shortcut keys to use for better workflow.</p>



<figure class="wp-block-table"><table><thead><tr><th>Hotkey</th><th>Windows</th><th>OSX</th><th>Description</th></tr></thead><tbody><tr><td>Cut</td><td>Ctrl + X</td><td>Command + X</td><td>선택한 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html">Node</a><a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">s</a>를 클립보드로 잘라냅니다.<br>Cuts selected&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">Nodes</a>&nbsp;to the clipboard</td></tr><tr><td>Copy</td><td>Ctrl + C</td><td>Command + C</td><td>선택한<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">Nodes</a>를 클립보드로 복사합니다.<br>Copies selected&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">Nodes</a>&nbsp;to the clipboard</td></tr><tr><td>Paste</td><td>Ctrl + V</td><td>Command + V</td><td>클립보드에 있는 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">Nodes</a>를 붙여넣습니다.<br>Pastes&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">Nodes</a>&nbsp;in the clipboard</td></tr><tr><td>Focus</td><td>F</td><td>F</td><td>모든 또는 선택한 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html">Nodes</a>에 대해 작업 공간에 포커스를 맞춥니다.<br>Focus the workspace on all or selected&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">Nodes</a></td></tr><tr><td>Create Node</td><td>Spacebar</td><td>Spacebar</td><td><a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Create-Node-Menu.html" target="_blank" rel="noreferrer noopener">Create Node Menu</a>를 엽니다.<br>Opens the&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Create-Node-Menu.html" target="_blank" rel="noreferrer noopener">Create Node Menu</a></td></tr></tbody></table></figure>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><strong>Context Menu</strong></p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p>작업 공간 내에서 마우스 오른쪽 버튼을 클릭하면 컨텍스트 메뉴가 열립니다.<br>Right clicking within the workspace will open a context menu. </p>



<p>작업 공간 내의 항목(예: <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html">Nod</a><a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">e</a>)을 마우스 오른쪽 버튼으로 클릭하면 해당 항목의 컨텍스트 메뉴가 열리며 작업 공간의 메뉴가 열리지 않음에 유의하세요.<br>Note that right clicking on an item within the workspace, such as a&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html">Nod</a><a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">e</a>, will open the context menu for that item and not the workspace.</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img decoding="async" width="528" height="331" src="https://lycos7560.com/wp-content/uploads/2024/03/image-11.png" alt="" class="wp-image-37991" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-11.png 528w, https://lycos7560.com/wp-content/uploads/2024/03/image-11-300x188.png 300w" sizes="(max-width: 528px) 100vw, 528px" /></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img decoding="async" width="402" height="532" src="https://lycos7560.com/wp-content/uploads/2024/03/image-12.png" alt="" class="wp-image-37992" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-12.png 402w, https://lycos7560.com/wp-content/uploads/2024/03/image-12-227x300.png 227w" sizes="(max-width: 402px) 100vw, 402px" /></figure>
</div>
</div>



<figure class="wp-block-image size-full"><img decoding="async" width="1429" height="824" src="https://lycos7560.com/wp-content/uploads/2024/03/image-17.png" alt="" class="wp-image-37997" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-17.png 1429w, https://lycos7560.com/wp-content/uploads/2024/03/image-17-300x173.png 300w, https://lycos7560.com/wp-content/uploads/2024/03/image-17-768x443.png 768w" sizes="(max-width: 1429px) 100vw, 1429px" /></figure>



<figure class="wp-block-image size-full"><img decoding="async" width="382" height="197" src="https://lycos7560.com/wp-content/uploads/2024/03/image-14.png" alt="" class="wp-image-37994" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-14.png 382w, https://lycos7560.com/wp-content/uploads/2024/03/image-14-300x155.png 300w" sizes="(max-width: 382px) 100vw, 382px" /></figure>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<figure class="wp-block-table"><table><thead><tr><th>Item</th><th>Description</th></tr></thead><tbody><tr><td>Create Node</td><td><a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Create-Node-Menu.html" target="_blank" rel="noreferrer noopener">Create Node Menu</a>를 엽니다.<br>Opens the&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Create-Node-Menu.html" target="_blank" rel="noreferrer noopener">Create Node Menu</a>.</td></tr><tr><td>Create Sticky Note</td><td>생성 그래프에 새로운 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Sticky-Notes.html" target="_blank" rel="noreferrer noopener">Sticky Note</a>를 생성합니다.<br>Creates a new&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Sticky-Notes.html" target="_blank" rel="noreferrer noopener">Sticky Note</a>&nbsp;on the Graph.</td></tr><tr><td>Collapse All Previews</td><td>축소 모든 &nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">Nodes</a>의 미리보기를 축소합니다.<br>Collapses previews on all&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">Nodes</a></td></tr><tr><td>Cut</td><td>선택한 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">Nodes</a>를 클립보드로 잘라냅니다.<br>Cuts selected&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">Nodes</a>&nbsp;to the clipboard</td></tr><tr><td>Copy</td><td>선택한 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">Nodes</a>를 클립보드로 복사합니다.<br>Copies selected&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">Nodes</a>&nbsp;to the clipboard</td></tr><tr><td>Paste</td><td>클립보드에 있는<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">Nodes</a>를 붙여넣습니다.<br>Pastes&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">Nodes</a>&nbsp;in the clipboard</td></tr><tr><td>Delete</td><td>선택한 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">Nodes</a>를 삭제합니다.<br>Deletes selected&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">Nodes</a></td></tr><tr><td>Duplicate</td><td>선택한 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">Nodes</a>를 복제합니다.<br>Duplicates selected&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">Nodes</a></td></tr><tr><td>Select / Unused Nodes</td><td>마스터 스택에서 최종 셰이더 출력에 기여하지 않는 그래프의 모든 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html">Nod</a><a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">es</a>를 선택합니다.<br>Selects all nodes on the graph that are not contributing to the final shader output from the Master Stack.</td></tr><tr><td>View / Collapse Ports</td><td>축소 선택한 모든 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">Nodes</a>의 사용되지 않은 포트를 축소합니다.<br>Collapses unused ports on all selected&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">Nodes</a> </td></tr><tr><td>View / Expand Ports</td><td>확장 선택한 모든 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">Nodes</a>의 사용되지 않은 포트를 확장합니다.<br>Expands unused ports on all selected&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">Nodes</a></td></tr><tr><td>View / Collapse Previews</td><td>축소 선택한 모든 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">Nodes</a>의 미리보기를 축소합니다.<br>Collapses previews on all selected&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">Nodes</a></td></tr><tr><td>View / Expand Previews</td><td>확장 선택한 모든 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html">Nod</a><a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">es</a>의 미리보기를 확장합니다.<br>Expands previews on all selected&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html">Nod</a><a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">es</a></td></tr><tr><td>Precision / Inherit</td><td>선택한 모든 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html">Nod</a><a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">es</a>의 정밀도를 상속으로 설정합니다.<br>Sets precision of all selected Nodes to Inherit.</td></tr><tr><td>Precision / Float</td><td>선택한 모든 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html">Nod</a><a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">es</a>의 정밀도를 부동 소수점으로 설정합니다.<br>Sets precision on all selected nodes to Float.</td></tr><tr><td>Precision / Half</td><td>선택한 모든 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html">Nod</a><a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Node.html" target="_blank" rel="noreferrer noopener">es</a>의 정밀도를 반정밀 부동 소수점으로 설정합니다.<br>Sets precision on all selected nodes to Half.</td></tr></tbody></table></figure>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-uagb-advanced-heading uagb-block-01c4fe3f"><h3 class="uagb-heading-text">Blackboard</h3></div>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p><a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Blackboard.html" target="_blank" rel="noreferrer noopener">https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Blackboard.html</a></p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><strong>Description</strong></p>



<p>Blackboard를 사용하여 그래프의 &nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Property-Types.html" target="_blank" rel="noreferrer noopener">Properties</a> 및 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Keywords.html" target="_blank" rel="noreferrer noopener">Keywords</a>를 정의, 정렬 및 분류할 수 있습니다.<br>You can use the Blackboard to define, order, and categorize the&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Property-Types.html" target="_blank" rel="noreferrer noopener">Properties</a>&nbsp;and&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Keywords.html" target="_blank" rel="noreferrer noopener">Keywords</a>&nbsp;in a graph. </p>



<p>Blackboard에서 선택한 Shader Graph 에셋 또는 Sub Graph의 경로도 편집할 수 있습니다.<br>From the Blackboard, you can also edit the path for the selected Shader Graph Asset or Sub Graph.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="409" height="679" src="https://lycos7560.com/wp-content/uploads/2024/03/image-18.png" alt="" class="wp-image-37999" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-18.png 409w, https://lycos7560.com/wp-content/uploads/2024/03/image-18-181x300.png 181w" sizes="(max-width: 409px) 100vw, 409px" /></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><strong>Accessing the Blackboard</strong></p>



<p>Blackboard는 기본적으로 표시되며, 그래프에서 끌어내려서 분실할 수 없습니다.<br>The Blackboard is visible by default, and you cannot drag it off the graph and lose it. </p>



<p>하지만, 블랙보드를 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Shader-Graph-Window.html" target="_blank" rel="noreferrer noopener">Shader Graph Window</a>. 의 어디든 위치시킬 수 있습니다.<br>However, you are able to position it anywhere in the&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Shader-Graph-Window.html" target="_blank" rel="noreferrer noopener">Shader Graph Window</a>. </p>



<p>창 크기를 조정하더라도 블랙보드는 항상 가장 가까운 모퉁이로부터 동일한 거리를 유지합니다.<br>It always maintains the same distance from the nearest corner, even if you resize the window.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><strong>Adding properties and keywords to the Blackboard</strong></p>



<p>새로운 속성 또는 키워드를 생성하려면 블랙보드의 제목 표시줄에 있는 추가 <strong>Add (+)</strong>&nbsp;버튼을 클릭하고 유형을 선택하십시오. <br>To create a new property or keyword, click the&nbsp;<strong>Add (+)</strong>&nbsp;button on the Blackboard&#8217;s title bar and select a type.</p>



<p>속성 유형의 전체 목록은 &#8220;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Property-Types.html" target="_blank" rel="noreferrer noopener">Property Types</a>&#8220;을 참조하십시오.<br>For a full list of property types, see&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Property-Types.html" target="_blank" rel="noreferrer noopener">Property Types</a>.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><strong>Editing properties and keywords</strong></p>



<p>Blackboard 또는 Graph에서 속성 또는 키워드를 선택하여 노드 설정 메뉴에서 설정을 수정합니다.<br>Select a property or keyword in the Blackboard or graph to modify its settings in the Node Settings Menu.</p>



<figure class="wp-block-table"><table><thead><tr><th>Setting</th><th>Description</th></tr></thead><tbody><tr><td>Name</td><td>속성의 표시 이름입니다.<br>The property&#8217;s display name.<br>에디터는 디스플레이 이름에서 따옴표를 제거하고 밑줄로 대체합니다.<br>The Editor strips quotation marks from display names and replaces them with underscores. <br>이름을 변경하려면 Blackboard에서 해당 이름을 두 번 클릭하여 항목을 다시 명명하십시오.<br>Rename an item via the Blackboard by double-clicking on its name.</td></tr><tr><td>Reference</td><td>Shader Graph가이 속성에 대해 내부적으로 사용하는 이름입니다.<br>The name that Shader Graph uses internally for this property.<br>에디터는 기본적으로이 값을 채웁니다. 그러나 이 값을 수정할 수 있습니다. <br>Although the Editor populates this value by default, you can modify it.<br>원래 참조 이름으로 되돌리려면 참조 단어 (입력 필드가 아님)를 마우스 오른쪽 버튼으로 클릭하고<br>To revert to the original reference name, right-click on the word&nbsp;<strong>Reference</strong>&nbsp;(not the entry field)<br>컨텍스트 메뉴에서 <strong>&#8220;참조 재설정&#8221;</strong>을 선택하십시오. <br>and select&nbsp;<strong>Reset Reference</strong>&nbsp;in the context menu. <br>참조 이름에 HLSL이 지원하지 않는 문자가 포함되어 있으면 에디터가 해당 문자를 밑줄( &#8216; _ &#8216; )로 대체합니다.<br> If the Reference Name contains any characters that HLSL does not support, the Editor replaces those characters with underscores ( &#8216; _ &#8216; ).</td></tr><tr><td>Default</td><td>이 Shader Graph를 기반으로 하는 모든 소재에서 이 속성의 기본값입니다.<br>The default value of this property in any Material based on this Shader Graph.<br>예를 들어, 잔디용 Shader Graph를 작성하고 잔디 색상을 속성으로 노출하는 경우 기본값을 녹색으로 설정할 수 있습니다.<br> For example, if you have a Shader Graph for grass and expose the grass color as a property, you might set the default to Green.</td></tr><tr><td>Precision</td><td>Set the precision mode for the property. See&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Precision-Modes.html">Precision Modes</a>.</td></tr><tr><td>Exposed</td><td>Enable this setting to make the property available for you to edit via the C# API. Enabled by default.</td></tr></tbody></table></figure>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-28f84493 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img decoding="async" width="592" height="314" src="https://lycos7560.com/wp-content/uploads/2024/03/image-21.png" alt="" class="wp-image-38003" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-21.png 592w, https://lycos7560.com/wp-content/uploads/2024/03/image-21-300x159.png 300w" sizes="(max-width: 592px) 100vw, 592px" /></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img decoding="async" width="614" height="436" src="https://lycos7560.com/wp-content/uploads/2024/03/image-20.png" alt="" class="wp-image-38002" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-20.png 614w, https://lycos7560.com/wp-content/uploads/2024/03/image-20-300x213.png 300w" sizes="(max-width: 614px) 100vw, 614px" /></figure>
</div>
</div>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><strong>Modifying and selecting keywords and properties</strong></p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<ul class="wp-block-list">
<li>블랙보드에 나열된 항목의 순서를 변경하려면 해당 항목을 끌어다 놓으십시오.<br>To reorder items listed on the Blackboard, drag and drop them.</li>



<li>항목을 삭제하려면 Windows에서는 Delete 키를 누르거나 macOS에서는 Command + Backspace 키를 사용하십시오.<br>To delete items, use the <strong>Delete key</strong> on <strong>Windows or Command + Backspace keys</strong> on macOS.</li>



<li>여러 항목을 선택하려면 선택을 하면서 <strong>Ctrl 키</strong>를 누르십시오. <br>To select multiple items, hold down the <strong>Ctrl key </strong>while making your selections.</li>



<li>하나 또는 여러 항목의 선택을 취소하려면 해당 항목을 클릭하면서 Ctrl 키를 누른 채로 제거하려는 항목을 클릭하십시오.<br>To cancel the selection of one or multiple items, hold down the Ctrl key while clicking on the items you want to remove from the selection.</li>
</ul>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><strong>Using Blackboard categories</strong></p>



<p>셰이더의 속성을 더 쉽게 검색하려면 categories로 구성하십시오.<br>To make the properties in your shader more discoverable, organize them into categories. </p>



<p>범주를 확장하고 축소하여 Blackboard을 더 쉽게 탐색할 수 있습니다.<br>Expand and collapse categories to make the Blackboard easier to navigate.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="604" height="293" src="https://lycos7560.com/wp-content/uploads/2024/03/image-22.png" alt="" class="wp-image-38004" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-22.png 604w, https://lycos7560.com/wp-content/uploads/2024/03/image-22-300x146.png 300w" sizes="(max-width: 604px) 100vw, 604px" /></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><strong>Creating, renaming, moving, and deleting categories</strong></p>



<ul class="wp-block-list">
<li>카테고리를 추가하려면 Blackboard에서 +를 사용하십시오.<br>To add a category, use&nbsp;<strong>+</strong>&nbsp;on the Blackboard.</li>



<li>카테고리 이름을 바꾸려면 카테고리 이름을 두 번 클릭하거나 오른쪽 클릭하여 <strong>Rename</strong>을 선택하십시오.<br>To rename a category, double-click on the category name, or right-click and select&nbsp;<strong>Rename</strong>.</li>



<li>Blackboard 내에서 카테고리를 이동하려면 해당 카테고리를 선택하고 드래그하십시오.<br>To move a category within the Blackboard, select and drag it.</li>



<li>카테고리를 제거하려면 해당 카테고리를 선택한 후 <strong>Delete</strong>를 누르거나 오른쪽 클릭하여 <strong>Delete</strong>를 선택하십시오.<br>To remove a category, select it and press&nbsp;<strong>Delete</strong>, or right-click and select&nbsp;<strong>Delete</strong>.<br>카테고리를 삭제하면 해당 카테고리 내의 속성도 삭제되므로 보관하려는 속성을 옮기십시오.<br>Deleting a category also deletes the properties within it, so move those you wish to keep.</li>
</ul>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><strong>Adding, removing, and reordering properties and keywords</strong></p>



<ul class="wp-block-list">
<li>카테고리에 속성이나 키워드를 추가하려면 펼침 기호 (⌄)로 해당 카테고리를 확장한 다음 속성이나 키워드를 확장된 카테고리로 끌어다 놓으십시오.<br>To add a property or keyword to a category, expand the category with the foldout (⌄) symbol, then drag and drop the property or keyword onto the expanded category.</li>



<li>속성이나 키워드를 제거하려면 해당 항목을 선택하고 <strong>Delete</strong>를 누르거나 오른쪽 클릭하여 <strong>Delete</strong>를 선택하십시오.<br>To remove a property or keyword, select it and press&nbsp;<strong>Delete</strong>, or right-click and select&nbsp;<strong>Delete</strong>.</li>



<li>속성이나 키워드의 순서를 변경하려면 해당 카테고리 내에서 드래그하여 끌어다 놓거나 다른 카테고리로 이동시키십시오.<br>To re-order properties or keywords, drag and drop them within a category or move them into other categories.</li>
</ul>



<figure class="wp-block-image size-full"><img decoding="async" width="411" height="460" src="https://lycos7560.com/wp-content/uploads/2024/03/image-23.png" alt="" class="wp-image-38005" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-23.png 411w, https://lycos7560.com/wp-content/uploads/2024/03/image-23-268x300.png 268w" sizes="(max-width: 411px) 100vw, 411px" /></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><strong>Creating a category for specific properties and keywords</strong></p>



<p>여러 속성 또는 키워드를 선택하고 Blackboard에서 +를 사용하여 선택한 모든 항목을 포함하는 카테고리를 만듭니다.<br>Select multiple properties or keywords and use&nbsp;<strong>+</strong>&nbsp;on the Blackboard to create a category that contains all of the items you have selected.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><strong>Copying and pasting categories, with or without properties</strong></p>



<p><br>빈 카테고리, 모든 속성을 포함한 카테고리 및 일부 속성을 포함한 카테고리를 하나 이상의 그래프로 복사 및 붙여넣기할 수 있습니다.<br>You can paste empty categories, categories with all of their properties, and categories with some of their properties into one or more graphs. </p>



<p>모든 속성을 포함한 카테고리를 복사하려면:<br>To copy a category with all of its properties:</p>



<ol class="wp-block-list">
<li>해당 속성을 선택하십시오.<br>Select the property.</li>



<li><strong>Ctrl+C</strong>를 사용하여 복사하십시오.<br>Copy it with&nbsp;<strong>Ctrl+C</strong>.</li>



<li><strong>Ctrl+V</strong>로 대상 그래프에 붙여넣으십시오.<br>Paste it into your target graph with&nbsp;<strong>Ctrl+V</strong>.</li>
</ol>



<p>특정 속성 집합을 복사하려면:<br>To copy a specific set of properties:</p>



<ol class="wp-block-list">
<li>해당 카테고리를 선택하십시오.<br>Select the category.</li>



<li>Ctrl 키를 누른 상태로 유지하십시오.<br>Hold down the Ctrl key.</li>



<li>포함하지 않을 속성을 클릭하여 선택을 제거하십시오.<br>Click the properties you do not want to include to remove them from the selection.</li>



<li><strong>Ctrl+C</strong>를 사용하여 속성을 복사하십시오.<br>Copy the property with&nbsp;<strong>Ctrl+C</strong>.</li>



<li><strong>Ctrl+V</strong>를 사용하여 대상 그래프에 붙여넣으십시오.<br>Paste it into your target graph with&nbsp;<strong>Ctrl+V</strong>.</li>
</ol>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><strong>Using categories in the Material Inspector</strong></p>



<p>Shader Graph로 만든 재료를 수정하려면 재료 검사기에서 특정 속성 또는 키워드 값을 조정하거나 그래프 자체를 편집할 수 있습니다.<br>To modify a material you have created with a Shader Graph, you can adjust specific property or keyword values in the Material Inspector, or edit the graph itself.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="410" height="579" src="https://lycos7560.com/wp-content/uploads/2024/03/image-24.png" alt="" class="wp-image-38006" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-24.png 410w, https://lycos7560.com/wp-content/uploads/2024/03/image-24-212x300.png 212w" sizes="(max-width: 410px) 100vw, 410px" /></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><strong>Working with Streaming Virtual Textures</strong></p>



<p><a href="https://docs.unity3d.com/Documentation/Manual/svt-use-in-shader-graph.html" target="_blank" rel="noreferrer noopener">Streaming Virtual Texture Properties</a>은 샘플 텍스처 레이어를 나타냅니다.<br><a href="https://docs.unity3d.com/Documentation/Manual/svt-use-in-shader-graph.html" target="_blank" rel="noreferrer noopener">Streaming Virtual Texture Properties</a>&nbsp;sample texture layers.</p>



<p>이러한 레이어에 액세스하려면 머티리얼 인스펙터에서 해당 이름 옆의 ⌄ 기호로 관련 <strong>Virtual Texture</strong>&nbsp;section을 확장하십시오.<br>To access these layers in the Material Inspector, expand the relevant&nbsp;<strong>Virtual Texture</strong>&nbsp;section with the ⌄ symbol next to its name.</p>



<p>인스펙터를 통해 레이어를 추가하거나 제거할 수 있습니다.<br>You can add and remove layers via the Inspector.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><strong>Exposing properties and keywords</strong></p>



<p>Unity는 기본적으로 속성과 키워드를 노출시킵니다.<br>Unity exposes properties and keywords by default.</p>



<p>스크립트에서 쓰기 액세스가 가능하므로 그래프 외에도 C# API를 통해 스크립트를 편집할 수 있습니다.<br>This enables write access from scripts, so that you can edit them via the C# API, in addition to the graph.</p>



<p>노출된 항목은 레이블에 녹색 점이 있습니다.<br>Exposed items have a green dot in their label.</p>



<p>이 기능을 <strong>Node Settings</strong> 메뉴에서 활성화 또는 비활성화할 수 있습니다.<br>Enable or disable this feature in the&nbsp;<strong>Node Settings</strong>&nbsp;menu.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="582" height="288" src="https://lycos7560.com/wp-content/uploads/2024/03/image-25.png" alt="" class="wp-image-38007" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-25.png 582w, https://lycos7560.com/wp-content/uploads/2024/03/image-25-300x148.png 300w" sizes="(max-width: 582px) 100vw, 582px" /></figure>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><strong>Creating nodes</strong></p>



<p>Blackboard에서 속성이나 키워드를 끌어다 그래프에 놓으면 해당 종류의 노드가 생성됩니다.<br>Drag a property or keyword from the Blackboard into the graph to create a node of that kind.</p>



<p>그래프에서 노드의 설정은 Blackboard에서 해당 속성이나 키워드에 대한 설정과 동일합니다.<br>Settings for a node in the graph are identical to those for the related property or keyword in the Blackboard.</p>



<p>이러한 노드를 확장하여 속성 값의 하위 멤버를 사용할 수 있습니다.<br>Expand these nodes to use a sub-member of the property value. </p>



<p>노드 이름에는 노출된 속성인 경우 녹색 점이 포함됩니다.<br>Property node names include a green dot if the property is exposed.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="512" height="437" src="https://lycos7560.com/wp-content/uploads/2024/03/image-26.png" alt="" class="wp-image-38008" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-26.png 512w, https://lycos7560.com/wp-content/uploads/2024/03/image-26-300x256.png 300w" sizes="(max-width: 512px) 100vw, 512px" /></figure>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-uagb-advanced-heading uagb-block-aa5f7aa1"><h3 class="uagb-heading-text">Main Preview</h3></div>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><strong>Description</strong></p>



<p>The&nbsp;<strong>Main Preview</strong>&nbsp;displays a representation of the shader on the active&nbsp;<strong>Render Pipeline</strong>.<br><strong>Main Preview</strong>는 <strong>Render Pipeline</strong>에서 셰이더의 표현을 표시합니다.</p>



<p>It updates in real-time and automatically updates to display any changes you make in the Shader Graph.<br>실시간으로 업데이트되며 Shader Graph에서 만든 변경 사항을 자동으로 업데이트하여 표시합니다.</p>



<p>The title bar of the&nbsp;<strong>Main Preview</strong>&nbsp;displays the name of the current shader.<br><strong>Main Preview</strong>의 제목 표시줄에는 현재 셰이더의 이름이 표시됩니다.</p>



<p>The&nbsp;<strong>Main Preview</strong>&nbsp;can be moved to anywhere in the&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Shader-Graph-Window.html" target="_blank" rel="noreferrer noopener">Shader Graph Window</a>&nbsp;and will automatically move with the nearest corner of that window.<br><strong>Main Preview</strong>는 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Shader-Graph-Window.html" target="_blank" rel="noreferrer noopener">Shader Graph Window</a>에서 어디든지 이동할 수 있으며 해당 창의 가장 가까운 모퉁이로 자동으로 이동합니다.</p>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<div class="wp-block-uagb-advanced-heading uagb-block-d06b00eb"><h3 class="uagb-heading-text">Graph Inspector</h3></div>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><strong>Description</strong></p>



<p><strong>Graph Inspector</strong>를 사용하면 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Shader-Graph-Asset.html" target="_blank" rel="noreferrer noopener">Shader Graph Asset</a>의 선택 가능한 그래프 요소 및 그래프 전역 설정과 상호 작용할 수 있습니다.<br>The&nbsp;<strong>Graph Inspector</strong>&nbsp;makes it possible for you to interact with any selectable graph elements and graph-wide settings for a&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Shader-Graph-Asset.html" target="_blank" rel="noreferrer noopener">Shader Graph Asset</a>.</p>



<p><strong>Graph Inspector</strong>를 사용하여 속성 및 기본값을 편집할 수 있습니다.<br>You can use the&nbsp;<strong>Graph Inspector</strong>&nbsp;to edit attributes and default values.</p>



<p><strong><a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Graph-Settings-Menu.md" target="_blank" rel="noreferrer noopener">Graph Settings</a></strong>를 열 때 <strong>Graph Inspector</strong>는 기본적으로 그래프 설정 탭을 표시합니다.<br>When you open a Shader Graph, the&nbsp;<strong>Graph Inspector</strong>&nbsp;displays the&nbsp;<strong><a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Graph-Settings-Menu.md" target="_blank" rel="noreferrer noopener">Graph Settings</a></strong>&nbsp;tab by default.</p>



<p>해당 Shader Graph에 대한 그래프 전역 설정이 이 탭에 나타납니다.<br>Graph-wide settings for that specific Shader Graph appear in this tab.</p>



<div style="height:40px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><strong>How to use</strong></p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p><strong>Graph Inspector</strong>에서 해당 노드에 사용할 수 있는 설정을 표시하려면 그래프에서 노드를 선택합니다.<br>Select a node in the graph to display settings available for that node in the&nbsp;<strong>Graph Inspector</strong>. </p>



<p>해당 노드에 사용할 수 있는 설정이 Graph Inspector의 Node Settings에 나타납니다.<br>Settings available for that node appear in the Node Settings tab of the Graph Inspector.</p>



<p>예를 들어, 그래프 또는 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Blackboard.html" target="_blank" rel="noreferrer noopener">Blackboard</a>에서 속성 노드를 선택하면 <strong>Node Settings</strong> 탭에 편집할 수 있는 속성의 속성이 표시됩니다.<br>For example, if you select a Property node either in the graph or the&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Blackboard.html" target="_blank" rel="noreferrer noopener">Blackboard</a>, the&nbsp;<strong>Node Settings</strong>&nbsp;tab displays attributes of the Property that you can edit.</p>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p>현재 Graph Inspector와 함께 작동하는 그래프 요소:<br>Graph elements that currently work with the Graph Inspector:</p>



<ul class="wp-block-list">
<li><a href="https://docs.unity3d.com/Manual/SL-Properties.html" target="_blank" rel="noreferrer noopener">Properties</a></li>
</ul>



<figure class="wp-block-image size-full"><img decoding="async" width="480" height="230" src="https://lycos7560.com/wp-content/uploads/2024/03/image-28.png" alt="" class="wp-image-38010" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-28.png 480w, https://lycos7560.com/wp-content/uploads/2024/03/image-28-300x144.png 300w" sizes="(max-width: 480px) 100vw, 480px" /></figure>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<ul class="wp-block-list">
<li><a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Keywords.html" target="_blank" rel="noreferrer noopener">Keywords</a></li>
</ul>



<figure class="wp-block-image size-full"><img decoding="async" width="513" height="417" src="https://lycos7560.com/wp-content/uploads/2024/03/image-29.png" alt="" class="wp-image-38011" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-29.png 513w, https://lycos7560.com/wp-content/uploads/2024/03/image-29-300x244.png 300w" sizes="(max-width: 513px) 100vw, 513px" /></figure>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<ul class="wp-block-list">
<li><a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Custom-Function-Node.html" target="_blank" rel="noreferrer noopener">Custom Function nodes</a></li>
</ul>



<figure class="wp-block-image size-full"><img decoding="async" width="663" height="485" src="https://lycos7560.com/wp-content/uploads/2024/03/image-30.png" alt="" class="wp-image-38012" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-30.png 663w, https://lycos7560.com/wp-content/uploads/2024/03/image-30-300x219.png 300w" sizes="(max-width: 663px) 100vw, 663px" /></figure>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<ul class="wp-block-list">
<li><a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Sub-graph.html" target="_blank" rel="noreferrer noopener">Subgraph Output nodes</a></li>
</ul>



<figure class="wp-block-image size-full"><img decoding="async" width="613" height="404" src="https://lycos7560.com/wp-content/uploads/2024/03/image-31.png" alt="" class="wp-image-38013" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-31.png 613w, https://lycos7560.com/wp-content/uploads/2024/03/image-31-300x198.png 300w" sizes="(max-width: 613px) 100vw, 613px" /></figure>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<ul class="wp-block-list">
<li><a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Precision-Types.md" target="_blank" rel="noreferrer noopener">Per-node precision</a></li>
</ul>



<figure class="wp-block-image size-full"><img decoding="async" width="620" height="433" src="https://lycos7560.com/wp-content/uploads/2024/03/image-32.png" alt="" class="wp-image-38014" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-32.png 620w, https://lycos7560.com/wp-content/uploads/2024/03/image-32-300x210.png 300w" sizes="(max-width: 620px) 100vw, 620px" /></figure>



<div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>



<p>현재 Graph Inspector와 함께 작동하지 않는 그래프 요소:<br>Graph elements that currently do not work with the Graph Inspector:</p>



<ul class="wp-block-list">
<li>Edges</li>



<li><a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/Sticky-Notes.html" target="_blank" rel="noreferrer noopener">Sticky Notes</a></li>



<li>Groups</li>
</ul>



<div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>



<p class="has-medium-font-size"><strong>Material Override</strong></p>



<div style="height:19px" aria-hidden="true" class="wp-block-spacer"></div>



<p>그래프 설정에서 <a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/surface-options.html" target="_blank" rel="noreferrer noopener">Allow Material Override</a> 옵션을 사용하면 재료 검사기를 통해 특정 그래프 속성을 재정의할 수 있습니다.<br>Enabling the&nbsp;<a href="https://docs.unity3d.com/Packages/com.unity.shadergraph@17.0/manual/surface-options.html" target="_blank" rel="noreferrer noopener">Allow Material Override</a>&nbsp;option in the Graph Settings makes it possible for you to override certain graph properties via the Material Inspector.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="640" height="996" src="https://lycos7560.com/wp-content/uploads/2024/03/image-33.png" alt="" class="wp-image-38015" srcset="https://lycos7560.com/wp-content/uploads/2024/03/image-33.png 640w, https://lycos7560.com/wp-content/uploads/2024/03/image-33-193x300.png 193w" sizes="(max-width: 640px) 100vw, 640px" /></figure>
<p>The post <a href="https://lycos7560.com/unity/shader-graph-window/37987/">Getting started with Shader Graph &#8211; Shader Graph Window</a> appeared first on <a href="https://lycos7560.com">어제와 내일의 나 그 사이의 이야기</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lycos7560.com/unity/shader-graph-window/37987/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
