a17d2cad2f1b782a99595a48fa9f3433f728bd6f6b8abd3f6f5aacf9d3



CBUFFER๋„ ์ฑ™๊ฒผ๊ณ , Draw Dynamic์œผ๋กœ ๋  ์ด์œ ๋Š” ์—†๋Š” ๊ฒƒ ๊ฐ™์€๋ฐ Node is not compatible with SRP batcher ์ด๋Ÿฌ๋ฉด์„œ ๋ฐฐ์นญ์ด ์•ˆ ๋ผ;;



์•ˆ ๋  ์ด์œ ๊ฐ€ ์—†์–ด ๋ณด์ด๋Š”๋ฐ... ๋‹ค์Œ์€ ์…ฐ์ด๋” ์ฝ”๋“œ ์ „๋ฌธ์ด์•ผ


Shader "URP/Unlit/NosingMask"
{
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 "URPUnlit"
Tags {"LightMode" = "SRPDefaultUnlit"}

Stencil
{
Ref 1
Comp always
Pass replace
}

HLSLPROGRAM
#pragma target 4.5
#pragma exclude_renderers gles d3d9
#pragma vertex vert
#pragma fragment frag

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


CBUFFER_START(UnityPerMaterial)
float4 _BaseMap_ST;
float4 _BaseColor;
CBUFFER_END

TEXTURE2D(_BaseMap); SAMPLER(sampler_BaseMap);


struct Attributes
{
float4 positionOS : POSITION;
float2 uv : TEXCOORD0;
};

struct Varyings
{
float4 positionCS : SV_POSITION;
float2 uv : TEXCOORD0;
};

Varyings vert(Attributes input)
{
Varyings output = (Varyings)0;

float4 positionOS = input.positionOS;
float3 positionWS = TransformObjectToWorld(positionOS.xyz);
float4 positionCS = TransformWorldToHClip(positionWS);

output.positionCS = positionCS;
output.uv = input.uv;
return output;
}

float4 frag(Varyings input) : SV_Target
{
float2 baseMapUV = input.uv.xy * _BaseMap_ST.xy + _BaseMap_ST.zw;
float4 texColor = SAMPLE_TEXTURE2D(_BaseMap, sampler_BaseMap, baseMapUV);
float4 finalColor = texColor * _BaseColor;
return finalColor;
}
ENDHLSL
}
}
}


๋‹จ์ˆœํ•œ ์ฝ”๋“œ๋ผ์„œ ์ด์œ ๋ฅผ ๋ชจ๋ฅด๊ฒ ๋„ค ์ง„์งœ


์…ฐ์ด๋” ๊ทธ๋ž˜ํ”„ ์“ฐ๋‹ค๊ฐ€ ์Šคํ…์‹ค ์“ฐ๋ ค๋‹ˆ๊นŒ ์ฝ”๋“œ๋กœ๋ฐ–์— ์•ˆ ๋œ๋‹ค๊ณ  ํ•ด์„œ ์ง„์งœ ๊ฐœ๊ณ ์ƒ ์ค‘์ด๋‹ค


๋˜‘๋˜‘ํ•œ ์นœ๊ตฌ ์žˆ์œผ๋ฉด ๋‹ต๋ณ€ ์ข€;;