티스토리 뷰

개발/Shader

[HLSL] Smoothness Rectangle Masking

LazySonic 2021. 9. 17. 13:59

float getRectangleMask(float2 uv, float x, float y, float w, float h)
{
	float lineX, lineY;
    lineX = smoothstep(x + w, 1, uv.x) + smoothstep(x - w,0, uv.x);
    lineY = smoothstep(y + h, 1, uv.y) + smoothstep(y - h,0, uv.y);
    float2 norm = float2(lineX, lineY);
    return length(norm);
}

 

 

'개발 > Shader' 카테고리의 다른 글

[UE4/Issue] Using VertexInterpolator in Landscape  (0) 2022.04.21
[Lighting] Volumetric Lighting [자료조사]  (0) 2021.09.22
[HLSL] Edge Detection - Sobel  (0) 2021.09.16
[HLSL] Simple Texture Normal  (0) 2021.09.16
[HLSL] Noise - Voronoi Shader  (0) 2021.09.16
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/07   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
글 보관함