{"id":4890,"date":"2022-06-07T23:00:08","date_gmt":"2022-06-07T14:00:08","guid":{"rendered":"https:\/\/denasu.com\/blog\/?p=4890"},"modified":"2022-06-07T23:13:42","modified_gmt":"2022-06-07T14:13:42","slug":"%e3%82%b7%e3%82%a7%e3%83%bc%e3%83%80%e3%83%bc","status":"publish","type":"post","link":"https:\/\/denasu.com\/blog\/2022\/06\/diary4890","title":{"rendered":"\u30b7\u30a7\u30fc\u30c0\u30fc"},"content":{"rendered":"\n<p>\u6c17\u5206\u8ee2\u63db\u306b\u30d1\u30cd\u30eb\u8868\u793a\u3092\u3044\u3058\u3063\u3066\u307f\u308b\u3002\u3068\u308a\u3042\u3048\u305a\u534a\u900f\u660e\u306e\u30d1\u30cd\u30eb\u3092\u51fa\u3057\u3066\u3044\u305f\u306e\u3060\u304c\u3001\u3082\u3046\u5c11\u3057\u5de5\u592b\u3057\u305f\u3044\u306e\u3067\u3059\u308a\u30ac\u30e9\u30b9\u51e6\u7406\uff0b\u89d2\u4e38\u56db\u89d2\u5f62\u306b\u3057\u3066\u307f\u305f\u3002<\/p>\n\n\n\n<p>\u4e2d\u8eab\u306e\u30c7\u30b6\u30a4\u30f3\u304c\u4eca\u3072\u3068\u3064\u3060\u3051\u3069\u3001\u3068\u308a\u3042\u3048\u305a\u30d1\u30cd\u30eb\u81ea\u4f53\u306f\u3053\u3093\u306a\u611f\u3058\u304b\u306a\u3002\u3059\u308a\u30ac\u30e9\u30b9\u3082\u89d2\u4e38\u3082\u30b7\u30a7\u30fc\u30c0\u30fc\u3067\u5b9f\u88c5\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/denasu.com\/blog\/wp-content\/uploads\/2022\/06\/2022060701.png\"><img loading=\"lazy\" decoding=\"async\" width=\"645\" height=\"620\" src=\"https:\/\/denasu.com\/blog\/wp-content\/uploads\/2022\/06\/2022060701.png\" alt=\"\" class=\"wp-image-4891\"\/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u3059\u308a\u30ac\u30e9\u30b9<\/h2>\n\n\n\n<p>\u3059\u308a\u30ac\u30e9\u30b9\u306f\u4e00\u822c\u7684\u306b\u306f\u30ac\u30a6\u30b7\u30a2\u30f3\u30d6\u30e9\u30fc\u3092\u4f7f\u3046\u3089\u3057\u3044\u3002\u305f\u3060\u3001\u666e\u901a\u306b5&#215;5\u3068\u304b\u306e\u30ab\u30fc\u30cd\u30eb\u3067\u51e6\u7406\u3059\u308b\u3068\u91cd\u304f\u306a\u308b\u306e\u3067\u3001\u7e265\u3092\u304b\u3051\u305f\u5f8c\u306b\u6a2a5\u3092\u304b\u3051\u308b\u3001\u307f\u305f\u3044\u306b2\u30d1\u30b9\u3067\u3084\u308b\u3089\u3057\u3044\u3002\u691c\u7d22\u3059\u308b\u3068\u305d\u3046\u3044\u3046\u65b9\u91dd\u3067GrabPass(\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3055\u308c\u305f\u753b\u50cf\u3092\u53d6\u5f97\u3059\u308b\u3084\u3064)\u3092\u4f7f\u7528\u3057\u305f\u4f8b\u304c\u305f\u304f\u3055\u3093\u51fa\u3066\u304f\u308b\u3002<\/p>\n\n\n\n<p>\u305f\u3060\u3001Universal Render Pipeline\u3060\u3068GrabPass\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u306a\u304f\u3066\u3001\u540c\u69d8\u306e\u6a5f\u80fd\u3092\u6301\u3064CameraOpaqueTexture\u3092\u4f7f\u3046\u30682\u30d1\u30b9\u304c\u3067\u304d\u306a\u3044(\u3068\u601d\u3046)\u3002\u306a\u306e\u3067\u3001\u30ab\u30fc\u30cd\u30eb\u3092\u7701\u7565\u3057\u3066\u5341\u5b57\u307f\u305f\u3044\u306a\u611f\u3058\u306b\u8fd1\u4f3c\u3057\u3066\u307f\u305f\u3002\u4e0a\u306e\u753b\u50cf\u306e\u901a\u308a\u305d\u308c\u3063\u307d\u304f\u306f\u306a\u308b\u304b\u3089\u3044\u3044\u304b\u306a\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u89d2\u4e38\u56db\u89d2\u5f62<\/h2>\n\n\n\n<p>\u89d2\u4e38\u56db\u89d2\u5f62\u306f\u306a\u304b\u306a\u304b\u96e3\u3057\u3044\u3002\u516c\u5f0f\u7684\u306b\u306f<a href=\"https:\/\/docs.unity3d.com\/ja\/Packages\/com.unity.shadergraph@10.0\/manual\/Rounded-Rectangle-Node.html\">Rounded Rectangle<\/a>\u3063\u307d\u3044\u3093\u3060\u3051\u3069\u305d\u306e\u307e\u307e\u30b3\u30d4\u30da\u3057\u3066\u3082\u3046\u307e\u304f\u3044\u304b\u306a\u3044\u3002\u306a\u306e\u3067\u53c2\u8003\u306b\u3057\u306a\u304c\u3089\u81ea\u529b\u3067\u5b9f\u88c5\u3002<\/p>\n\n\n<pre class=\"brush:csharp\">float RoundedRectangle(float2 uv, float width, float height)\n{\n    \/\/ uv\u306f-width\/2\uff5ewidth\/2\u3001-height\/2\uff5eheight\/2\u306e\u5ea7\u6a19\n\n    \/\/ uv\u304b\u3089\u4e00\u756a\u8fd1\u3044\u77e9\u5f62\u72b6\u306e\u5ea7\u6a19\u3092\u8a08\u7b97\u3059\u308b\n    float2 pt = float2(min(abs(uv.x), width \/ 2 - _Radius), min(abs(uv.y), height \/ 2 - _Radius));\n\n    \/\/ \u8a08\u7b97\u3057\u305f\u77e9\u5f62\u72b6\u306e\u4f4d\u7f6e\u3068uv\u3068\u306e\u5dee\u5206\u30d9\u30af\u30c8\u30eb\u306e\u9577\u3055\u3092\u8a08\u7b97\u3059\u308b\n    float d = length(pt - abs(uv));\n\n    \/\/ \u534a\u5f84\u4ee5\u5185\u306a\u30891\u3001\u534a\u5f84\u3088\u308a\u304a\u304a\u304d\u3051\u308c\u30700\n    return smoothstep(d - _Radius \/ 10, d + _Radius \/ 10, _Radius);\n}\n\nfixed4 frag(v2f i) : SV_Target\n{\n    \/\/ \u89d2\u4e38\u56db\u89d2\u5f62\u5224\u5b9a\u3002\u7bc4\u56f2\u5185\u306b\u3042\u308b\u306a\u3089r=1\u3001\u306a\u3044\u306a\u3089r=0\n    float width = 1 \/ _CameraOpaqueTexture_TexelSize.x;\n    float height = 1 \/ _CameraOpaqueTexture_TexelSize.y;\n    float2 uv = float2((i.uv.x - 0.5) * width, (i.uv.y - 0.5) * height);\n    float r = RoundedRectangle(uv, width, height);\n \n    \/\/ \u89d2\u4e38\u56db\u89d2\u5f62\u5916(r\u304c0\u306b\u8fd1\u3044)\u306f\u63cf\u753b\u3057\u306a\u3044\u3002\n    clip(r - 0.1);\n\n    \u30fb\u30fb\u30fb\n    \u30ac\u30a6\u30b7\u30a2\u30f3\u30d5\u30a3\u30eb\u30bf\u51e6\u7406(\u4ed6\u3067\u305f\u304f\u3055\u3093\u7d39\u4ecb\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u7701\u7565)\n    \u30fb\u30fb\u30fb\n\n    \/\/ \u89d2\u4e38\u306e\u03b1\u5024:r\n    \/\/ \u30aa\u30ea\u30b8\u30ca\u30eb\u306e\u03b1\u5024:\u03b1\n    \/\/ \u30aa\u30ea\u30b8\u30ca\u30eb\u8272:o\n    \/\/ \u30ac\u30a6\u30b7\u30a2\u30f3\u30d5\u30a3\u30eb\u30bf\u3092\u304b\u3051\u305f\u80cc\u666f\u8272:b\n    \/\/ \u3068\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u3067\u8868\u305b\u308b\n    \/\/ r\u03b1*o + (1-r\u03b1)*b\n\n    fixed4 col = r * _Color.a * _Color\n        + (1 - r * _Color.a) * b;\n\n    return col;\n}\n<\/pre>\n<p>\u3053\u3046\u3044\u3046\u3068\u304d\u306b\u6570\u5b66\u304c\u5f79\u7acb\u3064\u3002\u6570\u5b66\u306e\u77e5\u8b58\u304c\u306a\u3044\u5834\u5408\u3001\u3074\u3063\u305f\u308a\u3046\u307e\u304f\u3044\u304f\u30b3\u30fc\u30c9\u3092\u898b\u3064\u3051\u3066\u30b3\u30d4\u30da\u3059\u308b\u304bAsset\u3092\u8cb7\u3046\u3057\u304b\u306a\u3044\u306e\u3067\u4e0d\u5229\u306b\u306a\u308b\u3002<\/p>","protected":false},"excerpt":{"rendered":"<p>\u6c17\u5206\u8ee2\u63db\u306b\u30d1\u30cd\u30eb\u8868\u793a\u3092\u3044\u3058\u3063\u3066\u307f\u308b\u3002\u3068\u308a\u3042\u3048\u305a\u534a\u900f\u660e\u306e\u30d1\u30cd\u30eb\u3092\u51fa\u3057\u3066\u3044\u305f\u306e\u3060\u304c\u3001\u3082\u3046\u5c11\u3057\u5de5\u592b\u3057\u305f\u3044\u306e\u3067\u3059\u308a\u30ac\u30e9\u30b9\u51e6\u7406\uff0b\u89d2\u4e38\u56db\u89d2\u5f62\u306b\u3057\u3066\u307f\u305f\u3002 \u4e2d\u8eab\u306e\u30c7\u30b6\u30a4\u30f3\u304c\u4eca\u3072\u3068\u3064\u3060\u3051\u3069\u3001\u3068\u308a\u3042\u3048\u305a\u30d1\u30cd\u30eb\u81ea\u4f53\u306f\u3053\u3093\u306a\u611f\u3058\u304b\u306a\u3002\u3059\u308a\u30ac\u30e9\u30b9\u3082\u89d2\u4e38\u3082\u30b7\u30a7\u30fc\u30c0\u30fc\u3067\u5b9f\u88c5\u3002 \u3059\u308a\u30ac\u30e9\u30b9 \u3059\u308a\u30ac\u30e9\u30b9\u306f\u4e00\u822c\u7684\u306b\u306f\u30ac\u30a6\u30b7\u30a2\u30f3\u30d6\u30e9\u30fc\u3092\u4f7f\u3046\u3089\u3057\u3044\u3002\u305f\u3060\u3001\u666e\u901a\u306b5&#215;5\u3068\u304b\u306e\u30ab\u30fc\u30cd\u30eb\u3067\u51e6\u7406\u3059\u308b\u3068\u91cd\u304f\u306a\u308b\u306e\u3067\u3001\u7e265\u3092\u304b\u3051\u305f\u5f8c\u306b\u6a2a5\u3092\u304b\u3051\u308b\u3001\u307f\u305f\u3044\u306b2\u30d1\u30b9\u3067\u3084\u308b\u3089\u3057\u3044\u3002\u691c\u7d22\u3059\u308b\u3068\u305d\u3046\u3044\u3046\u65b9\u91dd\u3067GrabPass(\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3055\u308c\u305f\u753b\u50cf\u3092\u53d6\u5f97\u3059\u308b\u3084\u3064)\u3092\u4f7f\u7528\u3057\u305f\u4f8b\u304c\u305f\u304f\u3055\u3093\u51fa\u3066\u304f\u308b\u3002 \u305f\u3060\u3001Universal Render Pipeline\u3060\u3068GrabPass\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u306a\u304f\u3066\u3001\u540c\u69d8\u306e\u6a5f\u80fd\u3092\u6301\u3064CameraOpaqueTexture\u3092\u4f7f\u3046\u30682\u30d1\u30b9\u304c\u3067\u304d\u306a\u3044(\u3068\u601d\u3046)\u3002\u306a\u306e\u3067\u3001\u30ab\u30fc\u30cd\u30eb\u3092\u7701\u7565\u3057\u3066\u5341\u5b57\u307f\u305f\u3044\u306a\u611f\u3058\u306b\u8fd1\u4f3c\u3057\u3066\u307f\u305f\u3002\u4e0a\u306e\u753b\u50cf\u306e\u901a\u308a\u305d\u308c\u3063\u307d\u304f\u306f\u306a\u308b\u304b\u3089\u3044\u3044\u304b\u306a\u3002 \u89d2\u4e38\u56db\u89d2\u5f62 \u89d2\u4e38\u56db\u89d2\u5f62\u306f\u306a\u304b\u306a\u304b\u96e3\u3057\u3044\u3002\u516c\u5f0f\u7684\u306b\u306fRounded Rectangle\u3063\u307d\u3044\u3093\u3060\u3051\u3069\u305d\u306e\u307e\u307e\u30b3\u30d4\u30da\u3057\u3066\u3082\u3046\u307e\u304f\u3044\u304b\u306a\u3044\u3002\u306a\u306e\u3067\u53c2\u8003\u306b\u3057\u306a\u304c\u3089\u81ea\u529b\u3067\u5b9f\u88c5\u3002 float RoundedRectangle(float2 uv, float width, float height) { \/\/ uv\u306f-width\/2\uff5ewidth\/2\u3001-height\/2\uff5eheight\/2\u306e\u5ea7\u6a19 \/\/ uv\u304b\u3089\u4e00\u756a\u8fd1\u3044\u77e9\u5f62\u72b6\u306e\u5ea7\u6a19\u3092\u8a08\u7b97\u3059\u308b float2 pt = float2(min(abs(uv.x), width \/ 2 &#8211; _Radius), min(abs(uv.y), height \/ 2 &#8211; _Radius)); \/\/ \u8a08\u7b97\u3057\u305f\u77e9\u5f62\u72b6\u306e\u4f4d\u7f6e\u3068uv\u3068\u306e\u5dee\u5206\u30d9\u30af\u30c8\u30eb\u306e\u9577\u3055\u3092\u8a08\u7b97\u3059\u308b float d = length(pt &#8211; abs(uv)); \/\/ \u534a\u5f84\u4ee5\u5185\u306a\u30891\u3001\u534a\u5f84\u3088\u308a\u304a\u304a\u304d\u3051\u308c\u30700 return smoothstep(d &#8211; _Radius \/ 10, d + [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2,3],"tags":[57],"class_list":["post-4890","post","type-post","status-publish","format-standard","hentry","category-programming","category-computer","tag-typing-field"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4ZThs-1gS","_links":{"self":[{"href":"https:\/\/denasu.com\/blog\/wp-json\/wp\/v2\/posts\/4890","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/denasu.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/denasu.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/denasu.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/denasu.com\/blog\/wp-json\/wp\/v2\/comments?post=4890"}],"version-history":[{"count":3,"href":"https:\/\/denasu.com\/blog\/wp-json\/wp\/v2\/posts\/4890\/revisions"}],"predecessor-version":[{"id":4895,"href":"https:\/\/denasu.com\/blog\/wp-json\/wp\/v2\/posts\/4890\/revisions\/4895"}],"wp:attachment":[{"href":"https:\/\/denasu.com\/blog\/wp-json\/wp\/v2\/media?parent=4890"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/denasu.com\/blog\/wp-json\/wp\/v2\/categories?post=4890"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/denasu.com\/blog\/wp-json\/wp\/v2\/tags?post=4890"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}