-
Compute Shader에서 Dispatch와 numthreads의 관계게임 개발 2020. 9. 23. 22:02
c# source
shader.Dispatch(kernelID, 4, 4, 1); compute source
#pragma kernel CSMain
Texture2D<float4> Arg;
RWTexture2D<float4> Result;
[numthreads(5,5,1)]
void CSMain (uint3 groupID : SV_GroupID, uint3 id : SV_DispatchThreadID)
{
if (groupID.x == 0 && groupID.y == 0)
{
Result[id.xy] = Arg[id.xy];
}
else
{
Result[id.xy] = Arg[id.xy] - float4(0.3, 0.3, 0.3, 0.0);
}
}'게임 개발' 카테고리의 다른 글
URP 약어 (0) 2021.06.05 MetaHuman to ALS v4 for UE4 #2 (0) 2021.06.01 MetaHuman to ALS v4 for UE4 #1 (0) 2021.05.26 S3, DXT, BC (0) 2021.01.06 previousViewProjectionMatrix 를 가져오고 싶을때 (0) 2020.10.08