{"id":250,"date":"2018-08-25T00:00:54","date_gmt":"2018-08-24T15:00:54","guid":{"rendered":"http:\/\/www.sciement.com\/tech-blog\/?p=250"},"modified":"2018-09-03T20:30:12","modified_gmt":"2018-09-03T11:30:12","slug":"structured_buffer_compute_shader_ue4_part2","status":"publish","type":"post","link":"https:\/\/www.sciement.com\/tech-blog\/c\/structured_buffer_compute_shader_ue4_part2\/","title":{"rendered":"[UE4][ComputeShader][HLSL][C++]Unreal Engine 4\u3067(RW)StructuredBuffer\u3092\u7528\u3044\u305fComputeShader\u3092\u5229\u7528\u3059\u308b\uff08\u305d\u306e\uff12\uff1aC++\u5074\u30b7\u30a7\u30fc\u30c0\u30af\u30e9\u30b9\uff09"},"content":{"rendered":"<p><a href=\"http:\/\/www.sciement.com\/tech-blog\/c\/structured_buffer_compute_shader_ue4_part1\/\" rel=\"noopener\" target=\"_blank\"><strong>\u305d\u306e\uff11\uff1a\u30a4\u30f3\u30c8\u30ed<\/strong><\/a>\u3067\u306f\u6587\u5b57\u901a\u308a\u30a4\u30f3\u30c8\u30ed\uff08\u3068\u611a\u75f4\u2026\uff09\u3060\u3051\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u306e\u3067\u3001\u305d\u306e\uff12\u3067\u306f\u5177\u4f53\u7684\u306a\u5b9f\u88c5\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n<p>1. C++\u7d4c\u7531\u3067\u5909\u6570\u3092HLSL\u5074\u306b\u6e21\u3059<br \/>\n2. C++\u5074\u306e\u5909\u6570\u306b\u306fFVector\u3082\u5165\u308c\u308b<br \/>\n3. StructuredBuffer\u3092\u4f7f\u3046<br \/>\n4. RWStructuredBuffer\u3092\u4f7f\u3046<br \/>\n5. Unreal Engine 4\u304c\u63d0\u4f9b\u3057\u3066\u3044\u308bConstantBuffer\u306b\u8a72\u5f53\u3059\u308bUniform Buffer Struct\u3092\u4f7f\u3046<br \/>\n6. \u305d\u3057\u3066ComputeShader\u3092C++\u5074\u304b\u3089\u547c\u3073\u51fa\u3059<\/p>\n<p>\u3068\u3044\u30466\u3064\u3092\u78ba\u8a8d\u3067\u304d\u308b\u3053\u3068\u3092\u76ee\u6a19\u306b\u4ee5\u4e0b\u306e\u3053\u3068\u3092\u3059\u308bComputeShader\u3092\u4f5c\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002\u5148\u306b\u65ad\u3063\u3066\u304a\u304d\u307e\u3059\u304c\u3001\u898b\u305f\u76ee\u7684\u306b\u306f\u5fae\u5875\u3082\u9762\u767d\u304f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.sciement.com\/tech-blog\/wp-content\/uploads\/2018\/08\/20180821ComputeShaderSample.jpg\" alt=\"\" width=\"2466\" height=\"578\" class=\"alignnone size-full wp-image-251\" srcset=\"https:\/\/www.sciement.com\/tech-blog\/wp-content\/uploads\/2018\/08\/20180821ComputeShaderSample.jpg 2466w, https:\/\/www.sciement.com\/tech-blog\/wp-content\/uploads\/2018\/08\/20180821ComputeShaderSample-300x70.jpg 300w, https:\/\/www.sciement.com\/tech-blog\/wp-content\/uploads\/2018\/08\/20180821ComputeShaderSample-768x180.jpg 768w, https:\/\/www.sciement.com\/tech-blog\/wp-content\/uploads\/2018\/08\/20180821ComputeShaderSample-1024x240.jpg 1024w, https:\/\/www.sciement.com\/tech-blog\/wp-content\/uploads\/2018\/08\/20180821ComputeShaderSample-640x150.jpg 640w\" sizes=\"auto, (max-width: 2466px) 100vw, 2466px\" \/><\/p>\n<p>\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u4e00\u5f0f\u3092GitHub\u306b\u4e0a\u3052\u307e\u3057\u305f\u3002<br \/>\n<a href=\"https:\/\/github.com\/HSeo\/ComputeShaderUE419Test\" rel=\"noopener\" target=\"_blank\"><strong>https:\/\/github.com\/HSeo\/ComputeShaderUE419Test<\/strong><\/a><\/p>\n<p>\u5b9f\u884c\u3057\u3066\u30ad\u30fc\u30dc\u30fc\u30c9\u306e1\u307e\u305f\u306f2\u3092\u62bc\u3059\u3068\u3001Output Log\u306b\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.sciement.com\/tech-blog\/wp-content\/uploads\/2018\/08\/20180821ComputeShaderSampleUE4.jpg\" alt=\"\" width=\"933\" height=\"439\" class=\"alignnone size-full wp-image-252\" srcset=\"https:\/\/www.sciement.com\/tech-blog\/wp-content\/uploads\/2018\/08\/20180821ComputeShaderSampleUE4.jpg 933w, https:\/\/www.sciement.com\/tech-blog\/wp-content\/uploads\/2018\/08\/20180821ComputeShaderSampleUE4-300x141.jpg 300w, https:\/\/www.sciement.com\/tech-blog\/wp-content\/uploads\/2018\/08\/20180821ComputeShaderSampleUE4-768x361.jpg 768w, https:\/\/www.sciement.com\/tech-blog\/wp-content\/uploads\/2018\/08\/20180821ComputeShaderSampleUE4-640x301.jpg 640w\" sizes=\"auto, (max-width: 933px) 100vw, 933px\" \/><\/p>\n<p>\u3053\u308c\u3060\u3051\u3067\u3059\u3002\u3053\u308c\u3060\u3051\u3067\u3059\u304c\u3001\u30d7\u30ed\u30b0\u30e9\u30de\u76ee\u7dda\u3067\u306f\u3053\u308c\u3067\u5341\u5206\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u59cb\u3081\u307e\u3057\u3087\u3046\u3002<br \/>\n\u5b9f\u884c\u74b0\u5883\u306fWindows 10, Visual Studio 2017, Unreal Engine 4.19\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u4ed6\u306eOS\u74b0\u5883\u306a\u3069\u3067\u306e\u9055\u3044\u306f\u308f\u304b\u308a\u307e\u305b\u3093\u3002\u3054\u3081\u3093\u306a\u3055\u3044\u3002<br \/>\nGPU\u975e\u642d\u8f09\u306e\u30de\u30b7\u30f3\u3067\u4f55\u304c\u8d77\u3053\u308b\u304b\u3082\u308f\u304b\u308a\u307e\u305b\u3093\u3002\u3054\u3081\u3093\u306a\u3055\u3044\u3002<\/p>\n<p><strong>1. \u4e0b\u6e96\u5099<\/strong><\/p>\n<p>\u25c6HLSL Tools for Visual Studio\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<br \/>\n<a href=\"https:\/\/medium.com\/@lordned\/unreal-engine-4-rendering-overview-part-1-c47f2da65346\" rel=\"noopener\" target=\"_blank\"><strong>Unreal Engine 4 Rendering Part 1: Introduction<\/strong><\/a>\u306b\u3082\u66f8\u304b\u308c\u3066\u3044\u308b\u901a\u308a\u3067\u3059\u3002<br \/>\n\u7121\u304f\u3066\u3082\u69cb\u3044\u307e\u305b\u3093\u304c\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u304f\u3068\u4fbf\u5229\u3060\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u25c6ConsoleVariables.ini\u306e\u66f8\u304d\u63db\u3048<br \/>\n<a href=\"https:\/\/medium.com\/@lordned\/unreal-engine-4-rendering-overview-part-1-c47f2da65346\" rel=\"noopener\" target=\"_blank\"><strong>Unreal Engine 4 Rendering Part 1: Introduction<\/strong><\/a>\u306b\u3082\u66f8\u304b\u308c\u3066\u3044\u308b\u3088\u3046\u306b\u3001\/Engine\/Config\/\u30d5\u30a9\u30eb\u30c0\u5185\u306b\u3042\u308bConsoleVariables.ini\u3092\u66f8\u304d\u63db\u3048\u307e\u3059\u3002<br \/>\n<strong>r.ShaderDevelopmentMode=1<br \/>\nr.Shaders.Optimize=0<br \/>\nr.Shaders.KeepDebugInfo=1<\/strong><br \/>\n\u306b\u8a2d\u5b9a\u3057\u307e\u3059\uff08\u5148\u982d\u306e&#8221;;&#8221;\u3092\u6d88\u3057\u3066\u975e\u30b3\u30e1\u30f3\u30c8\u5316\u3057\u307e\u3059\uff09\u3002<br \/>\n\u30b3\u30e1\u30f3\u30c8\u306e\u307e\u307e\u306b\u3057\u3066\u304a\u304f\u3068\u3069\u3046\u306a\u308b\u306e\u304b\u306f\u3088\u304f\u308f\u304b\u308a\u307e\u305b\u3093\u3002\u3054\u3081\u3093\u306a\u3055\u3044\u3002\u4f55\u3082\u3057\u306a\u304f\u3066\u3082\u5927\u4e08\u592b\u306a\u306e\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u691c\u8a3c\u3057\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n<p>\u25c6.build.cs\u306b\u30e2\u30b8\u30e5\u30fc\u30eb\u3092\u8ffd\u52a0<br \/>\nPublicDependencyModuleNames\u306b<br \/>\n<strong>&#8220;ShaderCore&#8221;, &#8220;RenderCore&#8221;, &#8220;RHI&#8221;<\/strong><br \/>\n\u306e3\u3064\u3092\u8ffd\u52a0\u3057\u3066\u3001\u4e00\u65e6Visual Studio\u3092\u9589\u3058\u307e\u3059\u3002<\/p>\n<p>\u25c6Shaders\u30d5\u30a9\u30eb\u30c0\u306e\u751f\u6210\uff08UE 4.17\u4ee5\u964d\uff09<br \/>\n\u30b7\u30a7\u30fc\u30c0\u30fc\u3092\u30d7\u30e9\u30b0\u30a4\u30f3\u3068\u3057\u3066\u3067\u306f\u306a\u304f\u7528\u3044\u308b\u5834\u5408\u306b\u306f\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u30d5\u30a9\u30eb\u30c0\u76f4\u4e0b\u306b<strong>Shaders<\/strong>\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u308a\u3001\u3055\u3089\u306b\u305d\u306e\u76f4\u4e0b\u306b<strong>Private<\/strong>\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u308a\u307e\u3059\u3002<br \/>\n\u30b7\u30a7\u30fc\u30c0\u30fc\u30d5\u30a1\u30a4\u30eb\u306f\u3053\u306ePrivate\u30d5\u30a9\u30eb\u30c0\u5185\u306b\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u3068\u3057\u3066\u4f5c\u308b\u5834\u5408\u306fPlugin\u30d5\u30a9\u30eb\u30c0\u5185\u306b\u540c\u69d8\u306bShaders\u2192Private\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u308a\u307e\u3059\u3002<br \/>\n\u8a73\u3057\u304f\u306fEpic Games Japan \u5ca1\u7530\u548c\u4e5f\u3055\u3093\u306e\u30b9\u30e9\u30a4\u30c9\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><iframe loading=\"lazy\" src=\"\/\/www.slideshare.net\/slideshow\/embed_code\/key\/7id4NBCt3Vej0t?startSlide=42\" width=\"595\" height=\"485\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" style=\"border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;\" allowfullscreen> <\/iframe> <\/p>\n<div style=\"margin-bottom:5px\"> <strong> <a href=\"\/\/www.slideshare.net\/EpicGamesJapan\/ue417\" title=\"UE4.17\u3067\u5165\u308b\u65b0\u6a5f\u80fd\u3092\u4e00\u6c17\u306b\u7d39\u4ecb\u30fb\u89e3\u8aac\uff01\" target=\"_blank\">UE4.17\u3067\u5165\u308b\u65b0\u6a5f\u80fd\u3092\u4e00\u6c17\u306b\u7d39\u4ecb\u30fb\u89e3\u8aac\uff01<\/a> <\/strong> from <strong><a href=\"\/\/www.slideshare.net\/EpicGamesJapan\" target=\"_blank\">\u30a8\u30d4\u30c3\u30af\u30fb\u30b2\u30fc\u30e0\u30ba\u30fb\u30b8\u30e3\u30d1\u30f3 Epic Games Japan<\/a><\/strong> <\/div>\n<p>4.16\u4ee5\u524d\u306f\u3001\u30d7\u30e9\u30b0\u30a4\u30f3\u3068\u3057\u3066\u4f5c\u308b\u5834\u5408\u306f\u540c\u69d8\u306bPlugin\u30d5\u30a9\u30eb\u30c0\u4ee5\u4e0b\u306b\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u308c\u3070\u5927\u4e08\u592b\u3067\u3059\u304c\u3001\u5f8c\u8ff0\u3059\u308bC++\u3067\u306e\u8a18\u8ff0\u5185\u5bb9\uff08\u30d1\u30b9\u6307\u5b9a\u65b9\u6cd5\uff09\u304c\u82e5\u5e72\u5909\u308f\u308b\u3088\u3046\u3067\u3059\u3002<br \/>\n\u975e\u30d7\u30e9\u30b0\u30a4\u30f3\u3068\u3057\u3066Shaders\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u3063\u3066\u8a8d\u8b58\u3057\u3066\u304f\u308c\u308b\u306e\u304b\u3069\u3046\u304b\u306f\u3088\u304f\u308f\u304b\u308a\u307e\u305b\u3093\u2026\u3002<\/p>\n<p>\u25c6.uproject\u306e\u66f8\u304d\u63db\u3048<br \/>\n\u6700\u521d\u306e\u30cf\u30de\u308a\u3069\u3053\u308d\u3067\u3059\u3002C++\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u308b\u3068.uproject\u30d5\u30a1\u30a4\u30eb\uff08\u30c6\u30ad\u30b9\u30c8\u30a8\u30c7\u30a3\u30bf\u3067\u958b\u3051\u307e\u3059\uff09\u5185\u306b&#8221;Modules&#8221;\u3068\u3044\u3046\u9805\u76ee\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002<br \/>\n\u3053\u306e\u4e2d\u306e<br \/>\n&#8220;LoadingPhase&#8221;: &#8220;Default&#8221;,<br \/>\n\u3092<br \/>\n&#8220;LoadingPhase&#8221;: &#8220;<strong>PostConfigInit<\/strong>&#8220;,<br \/>\n\u306b\u66f8\u304d\u63db\u3048\u307e\u3059\u3002<br \/>\n\u3053\u3046\u3057\u306a\u3044\u3068\u3001\u30b7\u30a7\u30fc\u30c0\u30fc\u30b3\u30f3\u30d1\u30a4\u30eb\u304c\u901a\u308a\u307e\u305b\u3093\u3002<br \/>\n<a href=\"https:\/\/github.com\/Temaran\/UE4ShaderPluginDemo\" rel=\"noopener\" target=\"_blank\"><strong>https:\/\/github.com\/Temaran\/UE4ShaderPluginDemo<\/strong><\/a><br \/>\n\u306b\u3082&#8221;PostConfigInit&#8221;\u306b\u3057\u3088\u3046\u306d\u3001\u3068\u306f\u66f8\u304b\u308c\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u5177\u4f53\u7684\u306a\u5834\u6240\u304c\u308f\u304b\u3089\u305a\u306b\u6700\u521d\u82e6\u52b4\u3057\u307e\u3057\u305f\u3002<br \/>\nLoadingPhase\u306e\u8a73\u3057\u3044\u89e3\u8aac\u306f<br \/>\n<a href=\"https:\/\/api.unrealengine.com\/INT\/API\/Runtime\/Projects\/ELoadingPhase__Type\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>ELoadingPhase::Type | Unreal Engine<\/strong><\/a><br \/>\n\u3092\u3054\u89a7\u4e0b\u3055\u3044\u3002\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u3069\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u8aad\u307f\u8fbc\u307e\u308c\u308b\u304b\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\uff08\u305f\u3076\u3093\uff09\u3002<\/p>\n<p>\u66f8\u304d\u63db\u3048\u305f\u3089\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u3001solution\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u308a\u76f4\u3057\u307e\u3057\u3087\u3046\u3002.uproject\u3092\u53f3\u30af\u30ea\u30c3\u30af\u3057\u3066&#8221;Generate Visual Studio project files&#8221;\u3092\u9078\u629e\u3002<\/p>\n<p>\u3053\u308c\u3067\u4e0b\u6e96\u5099\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n<p><strong>2. \u30b7\u30a7\u30fc\u30c0\u306e\u8a18\u8ff0\uff08.usf\uff09<\/strong><\/p>\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d\u30d5\u30a9\u30eb\u30c0\uff08or Plugin\u30d5\u30a9\u30eb\u30c0\uff09\u2192Shaders\u2192Private\u30d5\u30a9\u30eb\u30c0\u306b.usf\u3068\u3044\u3046\u62e1\u5f35\u5b50\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u308a\u307e\u3059\u3002<br \/>\n\u30b0\u30ed\u30fc\u30d0\u30eb\u30b7\u30a7\u30fc\u30c0\u3068\u3057\u3066\u8a18\u8ff0\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\nUnreal Engine\u306e\u30b0\u30ed\u30fc\u30d0\u30eb\u30b7\u30a7\u30fc\u30c0\u306f\uff08\u305f\u3076\u3093UE4.17\u304b\u3089\uff09.usf\u3068.ush\u306e2\u7a2e\u985e\u306b\u5206\u3051\u3089\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\n\u30b7\u30a7\u30fc\u30c0\u30fc\u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\u304c\u542b\u307e\u308c\u308b\u5834\u5408\u306f.usf\u3001\u305d\u308c\u4ee5\u5916\u306f.ush\u306b\u306a\u308b\u305d\u3046\u3067\u3059\u3002<\/p>\n<p><iframe loading=\"lazy\" src=\"\/\/www.slideshare.net\/slideshow\/embed_code\/key\/7id4NBCt3Vej0t?startSlide=41\" width=\"595\" height=\"485\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" style=\"border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;\" allowfullscreen> <\/iframe> <\/p>\n<div style=\"margin-bottom:5px\"> <strong> <a href=\"\/\/www.slideshare.net\/EpicGamesJapan\/ue417\" title=\"UE4.17\u3067\u5165\u308b\u65b0\u6a5f\u80fd\u3092\u4e00\u6c17\u306b\u7d39\u4ecb\u30fb\u89e3\u8aac\uff01\" target=\"_blank\">UE4.17\u3067\u5165\u308b\u65b0\u6a5f\u80fd\u3092\u4e00\u6c17\u306b\u7d39\u4ecb\u30fb\u89e3\u8aac\uff01<\/a> <\/strong> from <strong><a href=\"\/\/www.slideshare.net\/EpicGamesJapan\" target=\"_blank\">\u30a8\u30d4\u30c3\u30af\u30fb\u30b2\u30fc\u30e0\u30ba\u30fb\u30b8\u30e3\u30d1\u30f3 Epic Games Japan<\/a><\/strong> <\/div>\n<p>\u305f\u3060\u3001\u3053\u306e\u30b9\u30e9\u30a4\u30c9\u3001MainVS, MainPS\u3092\u6301\u3064\u5834\u5408\u306b.usf\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001ComputeShader\u3060\u3063\u305f\u3089\u3069\u3061\u3089\u3082\u6301\u305f\u306a\u3044\u3051\u3069.usf\u3060\u3088\u306a\u3041\u3001\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n.ush\u3067\u306f\u306a\u304f.usf\u306b\u3057\u3066\u4e0b\u3055\u3044\u3002<\/p>\n<p>.usf\u30d5\u30a1\u30a4\u30eb\u5185\u306e\u30b7\u30a7\u30fc\u30c0\u306e\u8a18\u8ff0\u306f\u3001\u57fa\u672c\u7684\u306b\u306fHLSL\u3068\u540c\u3058\u3060\u3068\u601d\u3044\u307e\u3059\uff08\u2026\u79c1\u306fHLSL\u30b9\u30fc\u30d1\u30fc\u521d\u5fc3\u8005\u3067\u3059\u306e\u3067\u9593\u9055\u3063\u3066\u3044\u305f\u3089\u3054\u3081\u3093\u306a\u3055\u3044\uff09\u3002<\/p>\n<p>\u4eca\u56de\u66f8\u3044\u305f\u3082\u306e\u306f\u3053\u308c\u3067\u3059\u3002<\/p>\n<pre class=\"lang:default mark:33 decode:true \" title=\"compute_shader_test.usf\" >\/\/ Copyright (c) 2018 Hirofumi Seo, M.D. at SCIEMENT, Inc.\r\n\/\/ http:\/\/www.sciement.com\r\n\/\/ http:\/\/www.sciement.com\/tech-blog\/\r\n\r\n#pragma once\r\n\r\n\/\/ Necessary to use UNIFORM_BUFFER_STRUCT\r\n#include \"\/Engine\/Private\/Common.ush\"\r\n\r\n\/\/ UNIFORM_BUFFER_STRUCT is not available outside the fuction of IMPLEMENT_SHADER_TYPE's FunctionName.\r\n\/\/ So, we can't use UNIFORM_BUFFER_STRUCT like global StructuredBuffer&lt;UNIFORM_BUFFER_STRUCT&gt;\r\n\r\n\/*\r\n\/\/TestComputeShader.h\r\nBEGIN_UNIFORM_BUFFER_STRUCT(OffsetYZ, )\r\nDECLARE_UNIFORM_BUFFER_STRUCT_MEMBER(float, y)\r\nDECLARE_UNIFORM_BUFFER_STRUCT_MEMBER(float, z)\r\nEND_UNIFORM_BUFFER_STRUCT(OffsetYZ)\r\n\r\n\/\/TestComputeShader.cpp\r\nIMPLEMENT_UNIFORM_BUFFER_STRUCT(OffsetYZ, TEXT(\"offset_yz\"))\r\n*\/\r\n\r\nStructuredBuffer&lt;float3&gt; test_input_position; \/\/ FVector in cpp\r\nStructuredBuffer&lt;float&gt; test_input_scalar;\r\nRWStructuredBuffer&lt;float3&gt; test_output;\r\n\r\nfloat test_offset_x;\r\nfloat test;\r\n\r\n[numthreads(1, 1, 1)]\r\nvoid CalculateOutput(int3 dispatch_id : SV_DispatchThreadID) {\r\n  test_output[dispatch_id.x] = test_input_position[dispatch_id.x] * test_input_scalar[dispatch_id.x] + float3(test_offset_x, offset_yz.y, offset_yz.z);\r\n}<\/pre>\n<p>\u30b3\u30e1\u30f3\u30c8\u306a\u3069\u3067\u884c\u6570\u304c\u591a\u304f\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u3084\u3063\u3066\u3044\u308b\u3053\u3068\u306f\u5b9f\u8cea33\u884c\u76ee\u306e1\u884c\u3060\u3051\u3067\u3059\u3002\u3053\u308c\u304c\u6700\u521d\u306b\u793a\u3057\u305f\u6570\u5f0f\u3067\u3059\u3002<br \/>\n\u3044\u304f\u3064\u304b\u30dd\u30a4\u30f3\u30c8\u3092\u5217\u6319\u3057\u307e\u3059\u3002<\/p>\n<p>\u25c6Uniform Buffer Struct\u3092\u4f7f\u3044\u305f\u3044\u5834\u5408<br \/>\nUnreal Engine\u304c\u63d0\u4f9b\u3057\u3066\u3044\u308bCommon.ush\u3092include\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u3053\u306eCommon.ush\u306f\u3001\u4f7f\u7528\u3057\u3066\u3044\u308bUnreal Engine\u306eEngine\u2192Shaders\u2192Private\u30d5\u30a9\u30eb\u30c0\u306b\u5165\u3063\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u30d5\u30a9\u30eb\u30c0\u306b\u306f\u4ed6\u306b\u3082Epic Games\u306b\u3088\u308b\u8cb4\u91cd\u306a\u30b7\u30a7\u30fc\u30c0\u30fc\u30d5\u30a1\u30a4\u30eb\u304c\u304e\u3063\u3057\u308a\u8a70\u307e\u3063\u3066\u304a\u308a\u3001\u3053\u3053\u3092\u898b\u308b\u3060\u3051\u3067\u3082\u76f8\u5f53\u52c9\u5f37\u306b\u306a\u308a\u305d\u3046\u3067\u3059\u3002<\/p>\n<p>\u25c6Engine\u2192Shaders\u2192Private\u30d5\u30a9\u30eb\u30c0\u5185\u306e.usf \/ .ush\u3092include\u3059\u308b\u969b\u306e\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9<br \/>\n<strong>\u843d\u3068\u3057\u7a74\u304c1\u3064\u3042\u308a\u307e\u3059<\/strong>\u3002<br \/>\n\/Engine\/Shaders\/Private\/Common.ush<br \/>\n\u304cEngine\u4ee5\u4e0b\u3067\u30d5\u30a1\u30a4\u30eb\u307e\u3067\u306e\u6b63\u3057\u3044\u30d1\u30b9\u306a\u306e\u3067\u3059\u304c\u3001\u30b3\u30fc\u30c9\u4e0a\u3067\u306f <\/p>\n<pre class=\"start-line:8 lang:default decode:true \" title=\"compute_shader_test.usf\" >#include \"\/Engine\/Private\/Common.ush\"<\/pre>\n<p>\u3068\u66f8\u304d\u307e\u3059\u3002<strong>\/Shaders\/\u304c\u3042\u308a\u307e\u305b\u3093<\/strong>\u3002<br \/>\n\u5b9f\u306f\u30b3\u30fc\u30c9\u306e\u30d3\u30eb\u30c9\u6642\u306e\u30ed\u30b0\u3092\u3088\u30fc\u304f\u773a\u3081\u3066\u3044\u308b\u3068<\/p>\n<p><strong>LogShaders: Shader directory mapping \/Engine -> ..\/..\/..\/Engine\/Shaders<\/strong><\/p>\n<p>\u306a\u308b\u30ed\u30b0\u3092\u898b\u3064\u3051\u308b\u3053\u3068\u304c\u51fa\u6765\u308b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\nHLSL\u30b3\u30fc\u30c9\u5185\u3067\u30d1\u30b9\u306b\/Engine\u3068\u66f8\u304f\u3068\u3001\u305d\u308c\u306f\u81ea\u52d5\u7684\u306b\/Engine\/Shaders\u306b\u7f6e\u304d\u63db\u3048\u3089\u308c\u308b\u4ed5\u69d8\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u4f55\u6c17\u306b\u30cf\u30de\u308a\u3084\u3059\u3044\u30dd\u30a4\u30f3\u30c8\u306e1\u3064\u304b\u3068\u601d\u3044\u307e\u3059\u306e\u3067\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u306a\u304a\u3001Visual Studio\u5074\u306f\u3053\u306e\u30d1\u30b9\u3092\u6b63\u3057\u304f\u8a8d\u8b58\u3067\u304d\u307e\u305b\u3093\u306e\u3067\u3001\u3044\u3064\u307e\u3067\u7d4c\u3063\u3066\u3082\u30a8\u30e9\u30fc\u3092\u793a\u3059\u4e0b\u7dda\u304c\u4ed8\u3044\u305f\u307e\u307e\u306b\u306a\u3063\u3066\u3057\u307e\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u25c6Uniform Buffer Struct\u3092\u5b9f\u969b\u306b\u4f7f\u3046<br \/>\nHLSL\u30b3\u30fc\u30c9\u3092\u898b\u3066\u3044\u3066\u3001\u30b3\u30fc\u30c9\u5185\u306b\u5909\u6570\u5b9a\u7fa9\u304c\u7121\u3044\u5909\u6570\u3092\u898b\u3064\u3051\u305f\u3089\u3001Uniform Buffer Struct\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<br \/>\n\u3053\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001<strong>CalculateOutput<\/strong>\u95a2\u6570\u5185\u3067\u3044\u304d\u306a\u308aoffset_yz.y, offset_yz.z\u306a\u308b\u5909\u6570\u304c\u767b\u5834\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u3053\u308c\u306f\u30b3\u30e1\u30f3\u30c8\u3067\u8a18\u8f09\u3057\u305f\u3088\u3046\u306b\u3001Uniform Buffer Struct\u306e\u5b9a\u7fa9\u306f.h \/ .cpp\u5185\u306b\u8a18\u8ff0\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3067\u3059\u3002<br \/>\nVisual Studio\u5185\u3067\u306e\u81ea\u52d5\u88dc\u5b8c\u3082\u51fa\u6765\u305a\u3001\u3053\u3053\u3082\u30a8\u30e9\u30fc\u8868\u793a\u306e\u307e\u307e\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<br \/>\n\u53ef\u8aad\u6027\u306e\u70b9\u304b\u3089\u3082\u3001\u3080\u3084\u307f\u3084\u305f\u3089\u306bUnfirom Buffer Struct\u3092\u4f7f\u3046\u3053\u3068\u306f\u304a\u52e7\u3081\u3057\u307e\u305b\u3093\u3002<\/p>\n<p><a href=\"https:\/\/github.com\/IntelSoftware\/ue4-parallel\" rel=\"noopener\" target=\"_blank\"><strong>https:\/\/github.com\/IntelSoftware\/ue4-parallel<\/strong><\/a>\u306e<a href=\"https:\/\/github.com\/IntelSoftware\/ue4-parallel\/blob\/master\/Plugins\/ShaderFishPlugin\/Source\/ShaderFishPlugin\/Public\/ShaderFishPlugin.h\" rel=\"noopener\" target=\"_blank\"><strong>ShaderFishPlugin.h<\/strong><\/a>\u306e\u3088\u3046\u306b\u3001C++\u5074\u3067\u5927\u91cf\u306e\u5909\u6570\u3092\u307e\u3068\u3081\u3066\u69cb\u9020\u4f53\u3068\u3057\u3066\u6271\u3044\u305f\u3044\u3068\u304d\u3001\u305d\u3057\u3066\u305d\u306e\u69cb\u9020\u4f53\u306e\u4e2d\u8eab\u3092\u4e38\u3054\u3068\u30b7\u30a7\u30fc\u30c0\u30fc\u3067\u3082\u4f7f\u3044\u305f\u3044\u3068\u304d\u306b\u306f\u3068\u3066\u3082\u6709\u7528\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p><strong>3. C++\u5074\u304b\u3089\u30b7\u30a7\u30fc\u30c0\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u306e\u30af\u30e9\u30b9\u306e\u8a18\u8ff0\uff08.h\uff09<\/strong><\/p>\n<p>\u30b7\u30a7\u30fc\u30c0\u3068C++\u3068\u306e\u63a5\u7d9a\u306e\u305f\u3081\u306b\u3001Unreal Engine\u5074\u304c\u7528\u610f\u3057\u3066\u3044\u308b<a href=\"https:\/\/api.unrealengine.com\/INT\/API\/Runtime\/ShaderCore\/FGlobalShader\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>FGlobalShader\u30af\u30e9\u30b9<\/strong><\/a>\u3092\u7d99\u627f\u3057\u305f\u30af\u30e9\u30b9\u3092\u4f5c\u308a\u307e\u3059\u3002<br \/>\n\u30d8\u30c3\u30c0\u30d5\u30a1\u30a4\u30eb\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default mark:12-17,20,25-44,48-56,59-63 decode:true \" title=\"TestComputeShader.h\" >\/\/ Copyright (c) 2018 Hirofumi Seo, M.D. at SCIEMENT, Inc.\r\n\/\/ http:\/\/www.sciement.com\r\n\/\/ http:\/\/www.sciement.com\/tech-blog\/\r\n\r\n#pragma once\r\n\r\n#include \"CoreMinimal.h\"\r\n#include \"GlobalShader.h\" \/\/ShaderCore module\r\n#include \"UniformBuffer.h\" \/\/ RenderCore module\r\n#include \"RHICommandList.h\" \/\/ RHI module\r\n\r\n\/\/ The first \"F\", like \"FStruct\" is not necessary for uniform buffer struct??\r\n\/\/ The struct has to be implemented in .cpp using IMPLEMENT_UNIFORM_BUFFER_STRUCT\r\nBEGIN_UNIFORM_BUFFER_STRUCT(OffsetYZ, )\r\nDECLARE_UNIFORM_BUFFER_STRUCT_MEMBER(float, y)\r\nDECLARE_UNIFORM_BUFFER_STRUCT_MEMBER(float, z)\r\nEND_UNIFORM_BUFFER_STRUCT(OffsetYZ)\r\n\r\nclass \/*COMPUTESHADERTEST419_API*\/ FTestComputeShader : public FGlobalShader {\r\n  DECLARE_EXPORTED_SHADER_TYPE(FTestComputeShader, Global, );\r\n\r\npublic:\r\n  \/* Essential functions *\/\r\n\r\n  FTestComputeShader() {}\r\n  explicit FTestComputeShader(const ShaderMetaType::CompiledShaderInitializerType&amp; initializer);\r\n\r\n  static bool ShouldCache(EShaderPlatform platform) {\r\n    return true;\r\n    \/\/\/\/ Could skip compiling if the platform does not support DirectX Shader Model 4, for example, like the following.\r\n    \/\/return IsFeatureLevelSupported(platform, ERHIFeatureLevel::SM4);\r\n  }\r\n\r\n  static void ModifyCompilationEnvironment(const FGlobalShaderPermutationParameters&amp; PermutationParams, FShaderCompilerEnvironment&amp; OutEnvironment) {\r\n    FGlobalShader::ModifyCompilationEnvironment(PermutationParams, OutEnvironment);\r\n    OutEnvironment.CompilerFlags.Add(CFLAG_StandardOptimization);\r\n  }\r\n\r\n  static bool ShouldCompilePermutation(const FGlobalShaderPermutationParameters&amp; PermutationParams) {\r\n    \/\/ Useful when adding a permutation of a particular shader\r\n    return true;\r\n  }\r\n\r\n  virtual bool Serialize(FArchive&amp; Ar) override;\r\n\r\n  \/* Custom functions *\/\r\n\r\n  void SetOffsetX(FRHICommandList&amp; rhi_command_list, const float offset_x);\r\n  void SetOffsetYZ(FRHICommandList&amp; rhi_command_list, const float offset_y, const float offset_z);\r\n\r\n  \/\/ FShaderResourceViewRHIRef for StructuredBuffer, FUnorderedAccessViewRHIParamRef for RWStructuredBuffer.\r\n  void SetInputPosition(FRHICommandList&amp; rhi_command_list, FShaderResourceViewRHIRef input_position);\r\n  void SetInputScalar(FRHICommandList&amp; rhi_command_list, FShaderResourceViewRHIRef input_scalar);\r\n  void SetOutput(FRHICommandList&amp; rhi_command_list, FUnorderedAccessViewRHIParamRef output);\r\n  void ClearParameters(FRHICommandList&amp; rhi_command_list); \/\/ for StructuredBuffer.\r\n  void ClearOutput(FRHICommandList&amp; rhi_command_list); \/\/ for RWStructuredBuffer.\r\n\r\nprivate:\r\n  FShaderParameter offset_x_; \/\/ float test_offset_x;\r\n\r\n  FShaderResourceParameter input_position_; \/\/ StructuredBuffer&lt;float3&gt; test_input_position;\r\n  FShaderResourceParameter input_scalar_; \/\/ StructuredBuffer&lt;float&gt; test_input_scalar;\r\n  FShaderResourceParameter output_; \/\/ RWStructuredBuffer&lt;float3&gt; test_output;\r\n};<\/pre>\n<p>\u5927\u304d\u304f5\u3064\u306e\u30d6\u30ed\u30c3\u30af\u306b\u5206\u304b\u308c\u307e\u3059\u3002\u7d10\u89e3\u3044\u3066\u3044\u3051\u3070\u3001\u5358\u7d14\u306a\u3053\u3068\u3057\u304b\u3084\u3063\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n<p>\u25c6Uniform Buffer Struct\u306e\u5b9a\u7fa9<\/p>\n<pre class=\"start-line:12 lang:default decode:true \" title=\"TestComputeShader.h\" >\/\/ The first \"F\", like \"FStruct\" is not necessary for uniform buffer struct??\r\n\/\/ The struct has to be implemented in .cpp using IMPLEMENT_UNIFORM_BUFFER_STRUCT\r\nBEGIN_UNIFORM_BUFFER_STRUCT(OffsetYZ, )\r\nDECLARE_UNIFORM_BUFFER_STRUCT_MEMBER(float, y)\r\nDECLARE_UNIFORM_BUFFER_STRUCT_MEMBER(float, z)\r\nEND_UNIFORM_BUFFER_STRUCT(OffsetYZ)<\/pre>\n<p>\u30de\u30af\u30ed\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u3053\u308c\u306b\u5023\u3063\u3066\u66f8\u3051\u3070\u554f\u984c\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\uff08\u305f\u3076\u3093\uff09\u30b7\u30a7\u30fc\u30c0\u30fc\u5074\u3067\u8aad\u3081\u308b\u578b\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308b\u305f\u3081\u3001FVector\u3092\u4f7f\u3044\u305f\u3044\u5834\u5408\u306f\uff08\u305f\u3076\u3093\uff09float\u5909\u65703\u3064\u306b\u5206\u89e3\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u307e\u305f\u3001\u3053\u306e\u69cb\u9020\u4f53\u306fBluePrints\u4e0a\u3067\u7528\u3044\u308bUSTRUCTS()\u3068\u306f\u5225\u7269\u3067\u3042\u308b\u305f\u3081\u3001\u69cb\u9020\u4f53\u540d\u306e\u982d\u306b&#8221;F&#8221;\u3092\u4ed8\u3051\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u25c6DECLARE_EXPORTED_SHADER_TYPE<\/p>\n<pre class=\"start-line:20 lang:default decode:true \" title=\"TestComputeShader.h\" >  DECLARE_EXPORTED_SHADER_TYPE(FTestComputeShader, Global, );<\/pre>\n<p>\u30a4\u30de\u30a4\u30c1\u3088\u304f\u308f\u304b\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u3054\u3081\u3093\u306a\u3055\u3044\u2026\u3002<a href=\"https:\/\/www.unrealengine.com\/ja\/blog\/how-to-add-global-shaders-to-ue4\" rel=\"noopener\" target=\"_blank\"><strong>UE4 \u306b\u30b0\u30ed\u30fc\u30d0\u30eb \u30b7\u30a7\u30fc\u30c0\u30fc\u3092\u8ffd\u52a0\u3057\u3066\u307f\u3088\u3046<\/strong><\/a>\u306b\u3088\u308b\u3068\u3001<\/p>\n<blockquote><p>DECLARE_EXPORTED_SHADER_TYPE() \u30de\u30af\u30ed\u3092\u4f7f\u3046\u3068\u3001\u30b7\u30a7\u30fc\u30c0\u30fc\u306e\u30bf\u30a4\u30d7\u306e\u30b7\u30ea\u30a2\u30eb\u5316\u306b\u5fc5\u8981\u306a\u30a8\u30af\u30b9\u30dd\u30fc\u30c8\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u30023 \u756a\u76ee\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u3001\u30b7\u30a7\u30fc\u30c0\u30fc\u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u5b58\u5728\u3059\u308b\u3053\u3068\u306b\u306a\u308b\u30b3\u30fc\u30c9 \u30e2\u30b8\u30e5\u30fc\u30eb\u306e\u5916\u90e8\u30ea\u30f3\u30b1\u30fc\u30b8\u306e\u30bf\u30a4\u30d7\u3067\u3059\u3002<\/p><\/blockquote>\n<p>\u3068\u306e\u3053\u3068\u3067\u3059\u3002<br \/>\n\u6559\u3048\u3066\u3001\u8a73\u3057\u3044\u4eba\uff01<\/p>\n<p>\u25c6\u5fc5\u9808\u306e\u30e1\u30f3\u30d0\u95a2\u6570\u306e\u5b9a\u7fa9<\/p>\n<pre class=\"start-line:25 lang:default decode:true \" title=\"TestComputeShader.h\" >  FTestComputeShader() {}\r\n  explicit FTestComputeShader(const ShaderMetaType::CompiledShaderInitializerType&amp; initializer);\r\n\r\n  static bool ShouldCache(EShaderPlatform platform) {\r\n    return true;\r\n    \/\/\/\/ Could skip compiling if the platform does not support DirectX Shader Model 4, for example, like the following.\r\n    \/\/return IsFeatureLevelSupported(platform, ERHIFeatureLevel::SM4);\r\n  }\r\n\r\n  static void ModifyCompilationEnvironment(const FGlobalShaderPermutationParameters&amp; PermutationParams, FShaderCompilerEnvironment&amp; OutEnvironment) {\r\n    FGlobalShader::ModifyCompilationEnvironment(PermutationParams, OutEnvironment);\r\n    OutEnvironment.CompilerFlags.Add(CFLAG_StandardOptimization);\r\n  }\r\n\r\n  static bool ShouldCompilePermutation(const FGlobalShaderPermutationParameters&amp; PermutationParams) {\r\n    \/\/ Useful when adding a permutation of a particular shader\r\n    return true;\r\n  }\r\n\r\n  virtual bool Serialize(FArchive&amp; Ar) override;\r\n<\/pre>\n<p><strong>\u8a086\u500b\u306e\u30e1\u30f3\u30d0\u95a2\u6570\u306e\u5b9a\u7fa9\u304c\u5fc5\u9808<\/strong>\u3067\u3059\u3002<strong>\u95a2\u6570\u540d\u3001\u5f15\u6570\u3068\u3082\u306b\u4e0a\u8a18\u306e\u901a\u308a\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059<\/strong>\u3002<\/p>\n<p>\u30fb\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u306f2\u7a2e\u985e\u7528\u610f\u3057\u307e\u3059\u3002\u5f15\u6570\u7121\u3057\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u306f\u5b9f\u88c5\u306f\u7a7a\u306e\u3082\u306b\u3057\u307e\u3059\u3002<strong>const ShaderMetaType::CompiledShaderInitializerType&amp;<\/strong>\u3092\u5f15\u6570\u306b\u53d6\u308b\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u306e\u5b9f\u88c5\u306f\u4eca\u56de\u306f.cpp\u306b\u66f8\u304d\u307e\u3057\u305f\u306e\u3067\u5f8c\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<p>\u30fbShouldCache\u95a2\u6570\u306f\u30a4\u30de\u30a4\u30c1\u3088\u304f\u5206\u304b\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u2026\u3002<a href=\"https:\/\/api.unrealengine.com\/INT\/API\/Runtime\/RHI\/IsFeatureLevelSupported\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>IsFeatureLevelSupported<\/strong><\/a>\u95a2\u6570\u3092\u7528\u3044\u3066\u3001\u5b9f\u884c\u74b0\u5883\u306b\u3088\u3063\u3066\u30b7\u30a7\u30fc\u30c0\u30fc\u30b3\u30f3\u30d1\u30a4\u30eb\u3092\u884c\u308f\u306a\u3044\u3088\u3046\u306b\u8a2d\u5b9a\u3067\u304d\u308b\u3088\u3046\u3067\u3059\u3002<a href=\"https:\/\/api.unrealengine.com\/INT\/API\/Runtime\/RHI\/ERHIFeatureLevel__Type\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>ERHIFeatureLevel::Type\u306e\u5b9a\u7fa9<\/strong><\/a>\u3092\u898b\u3066\u307f\u308b\u3068\u3001DirectX11\u30b5\u30dd\u30fc\u30c8\u306e\u6709\u7121\u3092\u8abf\u3079\u305f\u3051\u308c\u3070<strong>SM5<\/strong>\u3001Metal\u3067\u3042\u308c\u3070<strong>ES3_1<\/strong>\u306a\u3069\u3092\u6307\u5b9a\u3067\u304d\u308b\u3088\u3046\u3067\u3059\u3002\u3053\u306e\u95a2\u6570\u304cfalse\u3092\u8fd4\u3057\u3066\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u306a\u3044\u5834\u5408\u306b\u4f55\u3092\u3069\u3046\u3059\u308c\u3070\u826f\u3044\u306e\u304b\u306f\u3088\u304f\u5206\u304b\u308a\u307e\u305b\u3093\u2026\u3002<br \/>\n\u6559\u3048\u3066\u3001\u8a73\u3057\u3044\u4eba\uff01<\/p>\n<p>\u30fb<strong>ModifyCompilationEnvironment<\/strong>\u306f\u5168\u7136\u5206\u304b\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002<a href=\"https:\/\/medium.com\/@lordned\/unreal-engine-4-rendering-part-2-shaders-and-vertex-data-80317e1ae5f3\" rel=\"noopener\" target=\"_blank\"><strong>Unreal Engine 4 Rendering Part 2: Shaders and Vertex Data<\/strong><\/a>\u306b\u3088\u308b\u3068\uff08\u4e00\u90e8\u7701\u7565\uff09\u3001<\/p>\n<blockquote><p>The second important concept is the ability to change preprocessor defines in the HLSL code before compilation. This functions is called before the shader is compiled and lets you modify the HLSL preprocessor defines. <\/p><\/blockquote>\n<p>\u3068\u306e\u3053\u3068\u3067\u3001<strong>CFLAG_StandardOptimization<\/strong>\u4ee5\u5916\u306b\u3082\u69d8\u3005\u306a\u30d5\u30e9\u30b0\uff08<a href=\"https:\/\/api.unrealengine.com\/INT\/API\/Runtime\/ShaderCore\/ECompilerFlags\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>ECompilerFlags<\/strong><\/a>\uff09\u304c\u3042\u308a\u3001\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u8272\u3005\u5909\u308f\u308b\u2026\u306e\u3060\u3068\u306f\u601d\u3046\u306e\u3067\u3059\u304c\u305d\u308c\u4ee5\u4e0a\u306f\u5168\u7136\u308f\u304b\u3089\u305a\u2026\u3002\u57fa\u672c\u7684\u306b\u306f\u4e0a\u8a18\u306e\u30b3\u30d4\u30da\u3067\u826f\u3044\u3088\u3046\u306a\u6c17\u304c\u3057\u307e\u3059\u3002<br \/>\n\u307e\u305f\u3001<a href=\"http:\/\/rcaloca.blogspot.com\/2018\/01\/adding-global-shaders-to-ue4-v20.html\" rel=\"noopener\" target=\"_blank\"><strong>Yet another blog&#8230;: Adding Global shaders to UE4 v2.0<\/strong><\/a>\u306b\u306f<\/p>\n<blockquote><p>The new ModifyCompilationEnvironment() function is used when the same C++ class defines different behaviors and be able to set up #define values in the shader.<\/p><\/blockquote>\n<p>\u3068\u66f8\u304b\u308c\u3066\u304a\u308a\u3001\u7570\u306a\u308b\u30b5\u30f3\u30d7\u30eb\u5b9f\u88c5\u304c\u66f8\u304b\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\n\u6559\u3048\u3066\u3001\u8a73\u3057\u3044\u4eba\uff01<\/p>\n<p>\u306a\u304a\u3001\uff08\u305f\u3076\u3093\uff09UE4.18\u4ee5\u4e0a\u3068\u672a\u6e80\u3068\u3067\u306f\u5f15\u6570\u306e\u578b\u304c\u7570\u306a\u3063\u3066\u304a\u308a\u3001<strong>const FGlobalShaderPermutationParameters&amp;<\/strong>\u304c\u4ee5\u524d\u306f<strong>EShaderPlatform Platform<\/strong>\u3067\u3057\u305f\u3002Unreal Engine\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u4e0a\u3052\u305f\u3068\u304d\u306b\u30b7\u30a7\u30fc\u30c0\u30fc\u30b3\u30f3\u30d1\u30a4\u30eb\u304c\u901a\u3089\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3046\u539f\u56e0\u306e1\u3064\u3067\u3059\u3002<\/p>\n<p>\u30fb<strong>ShouldCompilePermutation<\/strong>\u306f\u3055\u3089\u306b\u5168\u304f\u5206\u304b\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002<br \/>\n<a href=\"http:\/\/rcaloca.blogspot.com\/2018\/01\/adding-global-shaders-to-ue4-v20.html\" rel=\"noopener\" target=\"_blank\"><strong>Yet another blog&#8230;: Adding Global shaders to UE4 v2.0<\/strong><\/a>\u306b\u3088\u308b\u3068<\/p>\n<blockquote><p>The ShouldCompilePermutation() function, needed when a permutation of a global shader is required. This is a slightly more advanced topic outside the scope of this post.<\/p><\/blockquote>\n<p>\u3068\u306e\u3053\u3068\u3067\u3001\u5358\u7d14\u306b\u30b3\u30d4\u30da\u3057\u3066\u5b8c\u4e86\u3068\u3057\u307e\u3059\u3002<br \/>\n\u6559\u3048\u3066\u3001\u8a73\u3057\u3044\u4eba\uff01<\/p>\n<p>\u30fb\u6700\u5f8c\u306e<strong>Serialize<\/strong>\u306f\u3068\u3066\u3082\u91cd\u8981\u3067\u3001\u5404\u7a2eShader Parameter\uff08\u5f8c\u8ff0\uff09\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<br \/>\n\u3084\u306f\u308a<a href=\"http:\/\/rcaloca.blogspot.com\/2018\/01\/adding-global-shaders-to-ue4-v20.html\" rel=\"noopener\" target=\"_blank\"><strong>Yet another blog&#8230;: Adding Global shaders to UE4 v2.0<\/strong><\/a>\u306e\u8aac\u660e\u3092\u501f\u308a\u308c\u3070<\/p>\n<blockquote><p>The Serialize() method is required. This is where the compile\/cook time information from the shader\u2019s binding (matched during the serialization constructor) gets loaded and stored at runtime.<\/p><\/blockquote>\n<p>\u3068\u306e\u3053\u3068\u3067\u3059\u3002\u4eca\u56de\u306f.cpp\u3067\u5b9f\u88c5\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u25c6C++\u5074\u3067\u8a2d\u5b9a\u3057\u305f\u5024\u3092\u30b7\u30a7\u30fc\u30c0\u5074\u3068\u7d50\u3073\u3064\u3051\u308b\u305f\u3081\u306e\u95a2\u6570<\/p>\n<pre class=\"start-line:48 lang:default decode:true \" title=\"TestComputeShader.h\" >  void SetOffsetX(FRHICommandList&amp; rhi_command_list, const float offset_x);\r\n  void SetOffsetYZ(FRHICommandList&amp; rhi_command_list, const float offset_y, const float offset_z);\r\n\r\n  \/\/ FShaderResourceViewRHIRef for StructuredBuffer, FUnorderedAccessViewRHIParamRef for RWStructuredBuffer.\r\n  void SetInputPosition(FRHICommandList&amp; rhi_command_list, FShaderResourceViewRHIRef input_position);\r\n  void SetInputScalar(FRHICommandList&amp; rhi_command_list, FShaderResourceViewRHIRef input_scalar);\r\n  void SetOutput(FRHICommandList&amp; rhi_command_list, FUnorderedAccessViewRHIParamRef output);\r\n  void ClearParameters(FRHICommandList&amp; rhi_command_list); \/\/ for StructuredBuffer.\r\n  void ClearOutput(FRHICommandList&amp; rhi_command_list); \/\/ for RWStructuredBuffer.\r\n<\/pre>\n<p>\u5177\u4f53\u7684\u306a\u5b9f\u88c5\u306f.cpp\u3067\u8a18\u8ff0\u3057\u3066\u3042\u308a\u307e\u3059\u304c\u3001C++\u3067\u8a2d\u5b9a\u3057\u305f\u5024\u3084\u914d\u5217\u3092\u30b7\u30a7\u30fc\u30c0\u5074\u306b\u6e21\u3059\u3001\u307e\u305f\u306f\u7d42\u4e86\u51e6\u7406\u306e\u305f\u3081\u306e\u5404\u7a2e\u95a2\u6570\u3067\u3059\u3002<br \/>\n<a href=\"https:\/\/api.unrealengine.com\/INT\/API\/Runtime\/RHI\/FRHICommandList_1\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>FRHICommandList<\/strong><\/a>\u306a\u308b\u3082\u306e\u304c\u6bce\u56de\u51fa\u3066\u304d\u307e\u3059\u304c\u3001<a href=\"http:\/\/api.unrealengine.com\/JPN\/Programming\/Rendering\/Overview\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>RHI<\/strong><\/a>\u306fRendering Hardware Interface\u306e\u7565\u3067\u3001Unreal Engine\u304c\u63d0\u4f9b\u3057\u3066\u3044\u308b\u3001\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u975e\u4f9d\u5b58\u306e\u305f\u3081\u306e\u4e00\u9023\u306e\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3067\u3059\u3002<br \/>\n<strong>ComputeShader\u306fUnreal Engine\u306e\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u30b9\u30ec\u30c3\u30c9\u5185\u3067\u51e6\u7406\u3055\u308c\u308b<\/strong>\u306e\u3067\u3059\u304c\u3001\u305d\u306e\u4e2d\u306e\u5404\u7a2e\u51e6\u7406\u306e\u969b\u306bFRHICommandList\u306e\u53c2\u7167\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\uff08\u2026\u3068\u7406\u89e3\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u9055\u3063\u305f\u3089\u3054\u3081\u3093\u306a\u3055\u3044\uff09\u3002<br \/>\n\u6559\u3048\u3066\u3001\u8a73\u3057\u3044\u4eba\uff01<\/p>\n<p>\u307e\u305f\u3001\u914d\u5217\u3092\u30b7\u30a7\u30fc\u30c0\u5074\u306b\u6e21\u3059\u5834\u5408\u306f\u3001StructuredBuffer\u3084Texture2D\u306a\u3069\uff08GPU\u5074\u304b\u3089\u898b\u3066\uff09Read Only\u306e\u3082\u306e\u306e\u5834\u5408\u306b\u306f<a href=\"https:\/\/api.unrealengine.com\/INT\/API\/Runtime\/RHI\/FShaderResourceViewRHIRef\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>FShaderResourceViewRHIRef<\/strong><\/a>\u3092\u4ecb\u3057\u3066\u3001RWStructuredBuffer\u3084RWTexture2D\u306a\u3069\uff08GPU\u5074\u304b\u3089\u898b\u3066\uff09Write\u3082\u884c\u3046\u3082\u306e\u306e\u5834\u5408\u306b\u306f<a href=\"http:\/\/api.unrealengine.com\/INT\/API\/Runtime\/RHI\/FUnorderedAccessViewRHIParamRef\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>FUnorderedAccessViewRHIParamRef<\/strong><\/a>\u3092\u4ecb\u3057\u3066\u6e21\u3059\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u25c6C++\u5074\u3067\u8a2d\u5b9a\u3057\u305f\u5024\u3092\u30b7\u30a7\u30fc\u30c0\u5074\u3068\u7d50\u3073\u3064\u3051\u308b\u305f\u3081\u306e\u5909\u6570<\/p>\n<pre class=\"start-line:59 lang:default decode:true \" title=\"TestComputeShader.h\" >  FShaderParameter offset_x_; \/\/ float test_offset_x;\r\n\r\n  FShaderResourceParameter input_position_; \/\/ StructuredBuffer&lt;float3&gt; test_input_position;\r\n  FShaderResourceParameter input_scalar_; \/\/ StructuredBuffer&lt;float&gt; test_input_scalar;\r\n  FShaderResourceParameter output_; \/\/ RWStructuredBuffer&lt;float3&gt; test_output;\r\n<\/pre>\n<p>int\u3084float\u306a\u3069\u306f<a href=\"https:\/\/api.unrealengine.com\/INT\/API\/Runtime\/ShaderCore\/FShaderParameter\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>FShaderParameter<\/strong><\/a>\u7d4c\u7531\u3001(RW)StructuredBuffer\u306a\u3069\u306f<a href=\"https:\/\/api.unrealengine.com\/INT\/API\/Runtime\/ShaderCore\/FShaderResourceParameter\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>FShaderResourceParameter<\/strong><\/a>\u7d4c\u7531\u3067C++\u5074\u3068\u30b7\u30a7\u30fc\u30c0\u5074\u3068\u306e\u6a4b\u6e21\u3057\u3092\u884c\u3044\u307e\u3059\u3002<br \/>\n\u2026\u3068\u3044\u3046\u7406\u89e3\u3060\u3063\u305f\u306e\u3067\u3059\u304c\u3001FShaderParameter\u306e\u8aac\u660e\u3092\u898b\u308b\u3068<\/p>\n<blockquote><p>A shader parameter&#8217;s register binding. e.g. float1\/2\/3\/4, can be an array, UAV<\/p><\/blockquote>\n<p>\u3068\u66f8\u304b\u308c\u3066\u3044\u307e\u3059\u306d\u2026\u3002\u3046\u30fc\u3080\u3001\u3088\u304f\u308f\u304b\u3089\u3093\u2026\u3002<br \/>\n\u6559\u3048\u3066\u3001\u8a73\u3057\u3044\u4eba\uff01<\/p>\n<p><strong>3. C++\u5074\u304b\u3089\u30b7\u30a7\u30fc\u30c0\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u306e\u30af\u30e9\u30b9\u306e\u8a18\u8ff0\uff08.cpp\uff09<\/strong><\/p>\n<p>\u5168\u90e8\u30d8\u30c3\u30c0\u306b\u66f8\u3044\u3066\u3082\u305f\u3076\u3093\u5927\u4e08\u592b\u306a\u306e\u3067\u3059\u304c\u3001.cpp\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u304d\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"lang:default mark:10,12-23,25-74,76 decode:true \" title=\"TestComputeShader.cpp\" >\/\/ Copyright (c) 2018 Hirofumi Seo, M.D. at SCIEMENT, Inc.\r\n\/\/ http:\/\/www.sciement.com\r\n\/\/ http:\/\/www.sciement.com\/tech-blog\/\r\n\r\n#include \"TestComputeShader.h\"\r\n#include \"ShaderParameterUtils.h\" \/\/ Necessary for SetShaderValue, SetUniformBufferParameter.\r\n\/\/#include \"RHIStaticStates.h\"\r\n\r\n\/\/ xxx of TEXT(\"xxx\") has to be the same variable name of the corresponding global shader.\r\nIMPLEMENT_UNIFORM_BUFFER_STRUCT(OffsetYZ, TEXT(\"offset_yz\"))\r\n\r\nFTestComputeShader::FTestComputeShader(const ShaderMetaType::CompiledShaderInitializerType&amp; Initializer) : FGlobalShader(Initializer) {\r\n  offset_x_.Bind(Initializer.ParameterMap, TEXT(\"test_offset_x\"), SPF_Mandatory);\r\n  input_position_.Bind(Initializer.ParameterMap, TEXT(\"test_input_position\"), SPF_Mandatory);\r\n  input_scalar_.Bind(Initializer.ParameterMap, TEXT(\"test_input_scalar\"), SPF_Mandatory);\r\n  output_.Bind(Initializer.ParameterMap, TEXT(\"test_output\"), SPF_Mandatory);\r\n}\r\n\r\nbool FTestComputeShader::Serialize(FArchive&amp; Ar) {\r\n  bool bShaderHasOutdatedParameters = FGlobalShader::Serialize(Ar);\r\n  Ar &lt;&lt; offset_x_ &lt;&lt; input_position_ &lt;&lt; input_scalar_ &lt;&lt; output_;\r\n  return bShaderHasOutdatedParameters;\r\n}\r\n\r\nvoid FTestComputeShader::SetOffsetX(FRHICommandList&amp; rhi_command_list, const float offset_x) {\r\n  SetShaderValue(rhi_command_list, GetComputeShader(), offset_x_, offset_x);\r\n}\r\n\r\nvoid FTestComputeShader::SetOffsetYZ(FRHICommandList&amp; rhi_command_list, const float offset_y, const float offset_z) {\r\n  OffsetYZ offset_yz;\r\n  offset_yz.y = offset_y;\r\n  offset_yz.z = offset_z;\r\n  SetUniformBufferParameter(rhi_command_list, GetComputeShader(), GetUniformBufferParameter&lt;OffsetYZ&gt;(),\r\n    TUniformBufferRef&lt;OffsetYZ&gt;:: CreateUniformBufferImmediate(offset_yz, UniformBuffer_MultiFrame));\r\n  \/\/ NOTE: The last parameter: \"EUniformBufferUsage Usage\" has not been used in D3D11UniformBuffer.cpp.\r\n  \/\/ NOTE: \"r.UniformBufferPooling\" is set to 1 (on) by default in ConsoleManager.cpp\r\n  \/\/ UniformBuffer_SingleDraw: The uniform buffer is temporary, used for a single draw call then discarded\r\n  \/\/ UniformBuffer_MultiFrame: The uniform buffer is used for multiple draw calls, possibly across multiple frames\r\n}\r\n\r\nvoid FTestComputeShader::SetInputPosition(FRHICommandList&amp; rhi_command_list, FShaderResourceViewRHIRef input_position) {\r\n  if (input_position_.IsBound()) {\r\n    rhi_command_list.SetShaderResourceViewParameter(GetComputeShader(), input_position_.GetBaseIndex(), input_position);\r\n  }\r\n}\r\n\r\nvoid FTestComputeShader::SetInputScalar(FRHICommandList&amp; rhi_command_list, FShaderResourceViewRHIRef input_scalar) {\r\n  if (input_scalar_.IsBound()) {\r\n    rhi_command_list.SetShaderResourceViewParameter(GetComputeShader(), input_scalar_.GetBaseIndex(), input_scalar);\r\n  }\r\n}\r\n\r\nvoid FTestComputeShader::SetOutput(FRHICommandList&amp; rhi_command_list, FUnorderedAccessViewRHIParamRef output) {\r\n  if (output_.IsBound()) {\r\n    rhi_command_list.SetUAVParameter(GetComputeShader(), output_.GetBaseIndex(), output);\r\n  }\r\n}\r\n\r\n\/\/ for StructuredBuffer.\r\nvoid FTestComputeShader::ClearParameters(FRHICommandList&amp; rhi_command_list) {\r\n  if (input_position_.IsBound()) {\r\n    rhi_command_list.SetShaderResourceViewParameter(GetComputeShader(), input_position_.GetBaseIndex(), FShaderResourceViewRHIParamRef());\r\n  }\r\n  if (input_scalar_.IsBound()) {\r\n    rhi_command_list.SetShaderResourceViewParameter(GetComputeShader(), input_scalar_.GetBaseIndex(), FShaderResourceViewRHIParamRef());\r\n  }\r\n}\r\n\r\n\/\/ for RWStructuredBuffer.\r\nvoid FTestComputeShader::ClearOutput(FRHICommandList&amp; rhi_command_list) {\r\n  if (output_.IsBound()) {\r\n    rhi_command_list.SetUAVParameter(GetComputeShader(), output_.GetBaseIndex(), FUnorderedAccessViewRHIParamRef());\r\n  }\r\n}\r\n\r\nIMPLEMENT_SHADER_TYPE(, FTestComputeShader, TEXT(\"\/Project\/Private\/compute_shader_test.usf\"), TEXT(\"CalculateOutput\"), SF_Compute);\r\n<\/pre>\n<p>\u5927\u304d\u304f4\u3064\u306e\u30d6\u30ed\u30c3\u30af\u306b\u5206\u304b\u308c\u307e\u3059\u3002<\/p>\n<p>\u25c6Uniform Buffer Struct\u5909\u6570\u306e\u751f\u6210<\/p>\n<pre class=\"start-line:10 lang:default decode:true \" title=\"TestComputeShader.cpp\" >IMPLEMENT_UNIFORM_BUFFER_STRUCT(OffsetYZ, TEXT(\"offset_yz\"))<\/pre>\n<p>Uniform Buffer Struct\u3092\u4f7f\u3046\u5834\u5408\u306e\u3001HLSL\u30b3\u30fc\u30c9\u5185\u3067\u306e\u5909\u6570\u540d\u3092\u3053\u3053\u3067\u5b9a\u7fa9\u3057\u307e\u3059\u3002<br \/>\nOffsetYZ offset_yz;<br \/>\n\u3068\u66f8\u304f\u304b\u308f\u308a\u306b\u4e0a\u8a18\u306e\u3088\u3046\u306b\u66f8\u304d\u307e\u3059\u3002<\/p>\n<p>\u25c6\u5fc5\u9808\u306e\u30e1\u30f3\u30d0\u95a2\u6570\u306e\u5b9f\u88c5<\/p>\n<pre class=\"start-line:12 lang:default decode:true \" title=\"TestComputeShader.cpp\" >FTestComputeShader::FTestComputeShader(const ShaderMetaType::CompiledShaderInitializerType&amp; Initializer) : FGlobalShader(Initializer) {\r\n  offset_x_.Bind(Initializer.ParameterMap, TEXT(\"test_offset_x\"), SPF_Mandatory);\r\n  input_position_.Bind(Initializer.ParameterMap, TEXT(\"test_input_position\"), SPF_Mandatory);\r\n  input_scalar_.Bind(Initializer.ParameterMap, TEXT(\"test_input_scalar\"), SPF_Mandatory);\r\n  output_.Bind(Initializer.ParameterMap, TEXT(\"test_output\"), SPF_Mandatory);\r\n}\r\n\r\nbool FTestComputeShader::Serialize(FArchive&amp; Ar) {\r\n  bool bShaderHasOutdatedParameters = FGlobalShader::Serialize(Ar);\r\n  Ar &lt;&lt; offset_x_ &lt;&lt; input_position_ &lt;&lt; input_scalar_ &lt;&lt; output_;\r\n  return bShaderHasOutdatedParameters;\r\n}<\/pre>\n<p>\u30fb<strong>const ShaderMetaType::CompiledShaderInitializerType&amp;<\/strong>\u3092\u5f15\u6570\u306b\u53d6\u308b\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3067\u306f\u3001\u307e\u305a\u7d99\u627f\u5143\u306eFGlobalShader\u3092Initializer\u3067\u521d\u671f\u5316\u3057\u305f\u5f8c\u3001\u30b7\u30a7\u30fc\u30c0\u5074\u306e\u5909\u6570\u3068<a href=\"https:\/\/api.unrealengine.com\/INT\/API\/Runtime\/ShaderCore\/FShaderParameter\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>FShaderParameter<\/strong><\/a>\u3001<a href=\"https:\/\/api.unrealengine.com\/INT\/API\/Runtime\/ShaderCore\/FShaderResourceParameter\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>FShaderResourceParameter<\/strong><\/a>\u3068\u306e\u5bfe\u5fdc\u4ed8\u3051\u3092\u884c\u3044\u307e\u3059\u3002<br \/>\n<strong>FShader(Resource)Parameter.Bind(Initializer.ParameterMap, TEXT(&#8220;HLSL\u3067\u306e\u5909\u6570\u540d&#8221;), SPF_Mandatory);<\/strong><br \/>\n\u3068\u3044\u3046\u5f62\u3067\u3059\u3002<br \/>\n\u6700\u5f8c\u306eSPF_Mandatory\u306f<a href=\"http:\/\/api.unrealengine.com\/INT\/API\/Runtime\/ShaderCore\/EShaderParameterFlags\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>EShaderParameterFlags<\/strong><\/a>\u3068\u3044\u3046\u30d5\u30e9\u30b0\u306e1\u3064\u3067\u3001SPF_Mandatory\u307e\u305f\u306fSPF_Optional\u306e\u3069\u3061\u3089\u304b\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u30d1\u30e9\u30e1\u30fc\u30bf\u304c\u4f7f\u308f\u308c\u3066\u3044\u306a\u3044\u3068\u304d\u306b\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc\u306b\u3059\u308b\u304b\u3057\u306a\u3044\u304b\u3092\u6c7a\u3081\u308b\u305d\u3046\u3067\u3059\u304c\u3001\u57fa\u672c\u7684\u306b\u306fSPF_Mandatory\u306b\u3057\u3066\u304a\u3051\u3070\u554f\u984c\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\u79c1\u304c\u898b\u305f\u9650\u308a\u3067\u306f\u3001ComputeShader\u3092\u7528\u3044\u308b\u30b3\u30fc\u30c9\u5168\u3066\u3001SPF_Mandatory\u3057\u304b\u4f7f\u3063\u3066\u3044\u307e\u305b\u3093\u3067\u3057\u305f\u3002<\/p>\n<p>\u30fb<strong>Serialize(FArchive&amp; Ar)<\/strong>\u95a2\u6570\u3067\u306f\u3001bool\u5024\u306e\u53d6\u5f97\u3068\u623b\u308a\u5024\u306f\u3069\u306e\u30b3\u30fc\u30c9\u3067\u3082\u5168\u304f\u540c\u3058\u8a18\u8f09\u3067\u3057\u305f\u306e\u3067\u30b3\u30d4\u30da\u3067\u826f\u3044\u306f\u305a\u3067\u3059\u3002<br \/>\n<strong>Ar << \u7528\u3044\u3066\u3044\u308bFShader(Resource)Parameter;<\/strong><br \/>\n\u3068\u3057\u307e\u3059\u3002<br \/>\n\u5185\u90e8\u3067\u5b9f\u969b\u306b\u4f55\u304c\u884c\u308f\u308c\u3066\u3044\u308b\u304b\u307e\u3067\u306f\u5b9f\u88c5\u3092\u8ffd\u3063\u3066\u3044\u307e\u305b\u3093\u3002<br \/>\n\u6559\u3048\u3066\u3001\u8a73\u3057\u3044\u4eba\uff01<\/p>\n<p>\u25c6C++\u5074\u3067\u8a2d\u5b9a\u3057\u305f\u5024\u3092\u30b7\u30a7\u30fc\u30c0\u5074\u3068\u7d50\u3073\u3064\u3051\u308b\u305f\u3081\u306e\u95a2\u6570<\/p>\n<pre class=\"start-line:25 lang:default decode:true \" title=\"TestComputeShader.cpp\" >void FTestComputeShader::SetOffsetX(FRHICommandList&amp; rhi_command_list, const float offset_x) {\r\n  SetShaderValue(rhi_command_list, GetComputeShader(), offset_x_, offset_x);\r\n}\r\n\r\nvoid FTestComputeShader::SetOffsetYZ(FRHICommandList&amp; rhi_command_list, const float offset_y, const float offset_z) {\r\n  OffsetYZ offset_yz;\r\n  offset_yz.y = offset_y;\r\n  offset_yz.z = offset_z;\r\n  SetUniformBufferParameter(rhi_command_list, GetComputeShader(), GetUniformBufferParameter&lt;OffsetYZ&gt;(),\r\n    TUniformBufferRef&lt;OffsetYZ&gt;:: CreateUniformBufferImmediate(offset_yz, UniformBuffer_MultiFrame));\r\n  \/\/ NOTE: The last parameter: \"EUniformBufferUsage Usage\" has not been used in D3D11UniformBuffer.cpp.\r\n  \/\/ NOTE: \"r.UniformBufferPooling\" is set to 1 (on) by default in ConsoleManager.cpp\r\n  \/\/ UniformBuffer_SingleDraw: The uniform buffer is temporary, used for a single draw call then discarded\r\n  \/\/ UniformBuffer_MultiFrame: The uniform buffer is used for multiple draw calls, possibly across multiple frames\r\n}\r\n\r\nvoid FTestComputeShader::SetInputPosition(FRHICommandList&amp; rhi_command_list, FShaderResourceViewRHIRef input_position) {\r\n  if (input_position_.IsBound()) {\r\n    rhi_command_list.SetShaderResourceViewParameter(GetComputeShader(), input_position_.GetBaseIndex(), input_position);\r\n  }\r\n}\r\n\r\nvoid FTestComputeShader::SetInputScalar(FRHICommandList&amp; rhi_command_list, FShaderResourceViewRHIRef input_scalar) {\r\n  if (input_scalar_.IsBound()) {\r\n    rhi_command_list.SetShaderResourceViewParameter(GetComputeShader(), input_scalar_.GetBaseIndex(), input_scalar);\r\n  }\r\n}\r\n\r\nvoid FTestComputeShader::SetOutput(FRHICommandList&amp; rhi_command_list, FUnorderedAccessViewRHIParamRef output) {\r\n  if (output_.IsBound()) {\r\n    rhi_command_list.SetUAVParameter(GetComputeShader(), output_.GetBaseIndex(), output);\r\n  }\r\n}\r\n\r\n\/\/ for StructuredBuffer.\r\nvoid FTestComputeShader::ClearParameters(FRHICommandList&amp; rhi_command_list) {\r\n  if (input_position_.IsBound()) {\r\n    rhi_command_list.SetShaderResourceViewParameter(GetComputeShader(), input_position_.GetBaseIndex(), FShaderResourceViewRHIParamRef());\r\n  }\r\n  if (input_scalar_.IsBound()) {\r\n    rhi_command_list.SetShaderResourceViewParameter(GetComputeShader(), input_scalar_.GetBaseIndex(), FShaderResourceViewRHIParamRef());\r\n  }\r\n}\r\n\r\n\/\/ for RWStructuredBuffer.\r\nvoid FTestComputeShader::ClearOutput(FRHICommandList&amp; rhi_command_list) {\r\n  if (output_.IsBound()) {\r\n    rhi_command_list.SetUAVParameter(GetComputeShader(), output_.GetBaseIndex(), FUnorderedAccessViewRHIParamRef());\r\n  }\r\n}<\/pre>\n<p>\u3044\u305a\u308c\u3082<strong>FRHICommandList&amp;<\/strong>\u3092\u5f15\u6570\u306b\u53d6\u308a\u307e\u3059\u3002<\/p>\n<p>\u30fb<a href=\"https:\/\/api.unrealengine.com\/INT\/API\/Runtime\/ShaderCore\/FShaderParameter\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>FShaderParameter<\/strong><\/a>\u306e\u5834\u5408\u306f\u3001<a href=\"https:\/\/api.unrealengine.com\/INT\/API\/Runtime\/ShaderCore\/SetShaderValue\/1\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>SetShaderValue<\/strong><\/a>\u3092\u7528\u3044\u307e\u3059\u30022\u3064\u76ee\u306e\u5f15\u6570\u3067\u3042\u308b<strong>FComputeShaderRHIParamRef<\/strong>\u306f<a href=\"http:\/\/api.unrealengine.com\/INT\/API\/Runtime\/ShaderCore\/FShader\/GetComputeShader\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>GetComputeShader()<\/strong><\/a>\u3067\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<br \/>\n\u672c\u5f53\u306f\u3001FShaderParameter\u5909\u6570\u304c\u6b63\u3057\u304fbind\u3055\u308c\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092<br \/>\nFShaderParameter::IsBound\u3067\u8abf\u3079\u305f\u307b\u3046\u304c\u826f\u3044\u306e\u3067\u306f\u306a\u3044\u304b\u3068\u3044\u3046\u6c17\u3082\u3059\u308b\u306e\u3067\u3059\u304c\u3001\u79c1\u304c\u78ba\u8a8d\u3057\u305f\u30b3\u30fc\u30c9\u5168\u3066\u3067\u3001FShaderParameter\u5909\u6570\u306b\u95a2\u3057\u3066\u306fIsBound()\u306f\u4f7f\u308f\u308c\u3066\u3044\u307e\u305b\u3093\u3067\u3057\u305f\u3002<br \/>\n\u7406\u7531\u306f\u3088\u304f\u5206\u304b\u308a\u307e\u305b\u3093\u3002<br \/>\n\u6559\u3048\u3066\u3001\u8a73\u3057\u3044\u4eba\uff01<\/p>\n<p>\u30fbUniform Buffer Struct\u3092\u7528\u3044\u308b\u5834\u5408\u306b\u306f\u3001\u5f53\u8a72Unform Buffer Struct\u5909\u6570\u3092\u7528\u610f\u3057\uff08\u4e0a\u8a18\u3067\u306foffset_yz\uff09\u3001\u5024\u3092\u4ee3\u5165\u3057\u305f\u3046\u3048\u3067\u3001<a href=\"https:\/\/api.unrealengine.com\/INT\/API\/Runtime\/ShaderCore\/SetUniformBufferParameter\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>SetUniformBufferParameter<\/strong><\/a>\u3092\u7528\u3044\u3066\u5024\u3092\u30b7\u30a7\u30fc\u30c0\u5074\u306b\u6e21\u3057\u307e\u3059\u3002<strong>SetUniformBufferParameter<\/strong>\u306e\u5b9f\u88c5\u306f3\u7a2e\u985e\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u4ed6\u306e2\u7a2e\u985e\u3092\u4f7f\u3063\u3066\u3044\u308b\u4f8b\u3092\u898b\u3064\u3051\u3089\u308c\u305a\u3001\u4f7f\u3044\u65b9\u304c\u3088\u304f\u5206\u304b\u308a\u307e\u305b\u3093\u2026\u3002<br \/>\n\u6559\u3048\u3066\u3001\u8a73\u3057\u3044\u4eba\uff01<\/p>\n<p><a href=\"http:\/\/api.unrealengine.com\/INT\/API\/Runtime\/ShaderCore\/FShader\/GetUniformBufferParameter\/1\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>GetUniformBufferParameter<\/strong><\/a>\u306f\u516c\u5f0f\u30da\u30fc\u30b8\u306b\u8a18\u8f09\u3055\u308c\u3066\u3044\u308b\u901a\u308a\u3067\u3001<\/p>\n<blockquote><p>Finds an automatically bound uniform buffer matching the given uniform buffer type if one exists, or returns an unbound parameter.<\/p><\/blockquote>\n<p>\u3068\u306e\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u5384\u4ecb\u3001\u3068\u3044\u3046\u304b\u4e00\u756a\u8b0e\u3060\u3063\u305f\u306e\u306f\u3001<a href=\"http:\/\/api.unrealengine.com\/INT\/API\/Runtime\/RenderCore\/TUniformBufferRef\/CreateUniformBufferImmediate\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>TUniformBufferRef::CreateUniformBufferImmediate<\/strong><\/a>\u306e\u7b2c\u4e00\u5f15\u6570\u3067\u5024\u3092\u6e21\u3059\u306e\u3067\u3059\u304c\u3001\u7b2c\u4e8c\u5f15\u6570\u306e<a href=\"http:\/\/api.unrealengine.com\/INT\/API\/Runtime\/RHI\/EUniformBufferUsage\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>EUniformBufferUsage<\/strong><\/a>\u3067\u3059\u30023\u7a2e\u985e\u306e\u5024\u3092\u53d6\u308a\u5f97\u308b\u306e\u3067\u3059\u304c\u3001\u4e0a\u8a18\u30b3\u30fc\u30c9\u306e\u30b3\u30e1\u30f3\u30c8\u3067\u3082\u66f8\u3044\u305f\u3088\u3046\u306b\u3001<br \/>\nDirectX11\u7528\u306e\u5b9f\u88c5\u672c\u4f53\u3067\u306f\u3001<a href=\"http:\/\/api.unrealengine.com\/INT\/API\/Runtime\/RHI\/EUniformBufferUsage\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>EUniformBufferUsage<\/strong><\/a>\u306f\u4e00\u5207\u4f7f\u308f\u308c\u3066\u3044\u307e\u305b\u3093\u3067\u3057\u305f\u3002<br \/>\n\u3064\u307e\u308a\u3001<strong>3\u7a2e\u985e\u306e\u3046\u3061\u3069\u306e\u5024\u3092\u53d6\u3063\u3066\u3082\u7d50\u679c\u306f\u540c\u3058\u3067\u3059<\/strong>\u3002<br \/>\n\u3061\u306a\u307f\u306bDirectX12\u7528\u306e\u5b9f\u88c5\u3067\u306f\u3001\u3053\u306e\u5024\u306b\u3088\u3063\u3066\u51e6\u7406\u306e\u5206\u5c90\u304c\u884c\u308f\u308c\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u3067\u3001\u79c1\u306f\u6700\u521d\u3001<strong>UniformBuffer_MultiFrame<\/strong>\u3092\u6307\u5b9a\u3059\u308c\u3070\u3001HLSL\u3067\u306fConstant Buffer\u3068\u547c\u3070\u308c\u3066\u3044\u308b\u304f\u3089\u3044\u3067\u3059\u306e\u3067\u3001\u4e00\u5ea6\u5024\u3092\u6e21\u3057\u305f\u5f8c\u306b\u305a\u3063\u3068\u5024\u304c\u4fdd\u6301\u3055\u308c\u308b\u3082\u306e\u3068\u601d\u3063\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u8272\u3005\u5b9f\u9a13\u3057\u3066\u307f\u308b\u3068\u3069\u3046\u3084\u3089\u305d\u3046\u3067\u306f\u306a\u3044\u3088\u3046\u3067\u3057\u305f\u2026\u3002<br \/>\n\u3053\u306e\u3042\u305f\u308a\u306e\u8a73\u3057\u3044\u3053\u3068\u306f\u3001\uff08\u305f\u3076\u3093\uff09NVIDIA\u306e\u4e2d\u306e\u4eba\u306b\u3088\u308b<a href=\"https:\/\/shikihuiku.wordpress.com\/2014\/10\/02\/memo_ue4_dx11_constant-buffer\/\" rel=\"noopener\" target=\"_blank\"><strong>[\u30e1\u30e2]UE4\u306eDX11\u306eConstant Buffer\u306e\u53d6\u308a\u6271\u3044\u306b\u3064\u3044\u3066 | shikihuiku<\/strong><\/a>\u3092\u3054\u89a7\u4e0b\u3055\u3044\u3002<br \/>\n\u3061\u306a\u307f\u306b\u3053\u306e\u8a18\u4e8b\u5185\u3067\u89e6\u308c\u3089\u308c\u3066\u3044\u308b<strong>r.UniformBufferPooling<\/strong>\u306f\u3001\u4e0a\u8a18\u30b3\u30fc\u30c9\u306e\u30b3\u30e1\u30f3\u30c8\u306b\u3082\u66f8\u3044\u305f\u3088\u3046\u306b\u3001<strong>ConsoleManager.cpp<\/strong>\u5185\u30671\u306b\u521d\u671f\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u305b\u3044\u305c\u30442, 3\u30d5\u30ec\u30fc\u30e0\u4fdd\u6301\u3055\u308c\u308b\u3068\u3044\u3046\u3053\u3068\u306a\u306e\u3067\u3057\u3087\u3046\u304b\u2026\uff1f<br \/>\n\u6559\u3048\u3066\u3001\u8a73\u3057\u3044\u4eba\uff01<\/p>\n<p>\u30fbHLSL\u5185\u3067StructuredBuffer\u3084Texture2D\u306a\u3069\uff08GPU\u5074\u304b\u3089\u898b\u3066\uff09Read Only\u306e\u578b\u306e\u5834\u5408\u306fShaderResourceView\u3092\u4ecb\u3057\u3066\u5024\u3092\u3084\u308a\u53d6\u308a\u3059\u308b\u305f\u3081<a href=\"https:\/\/api.unrealengine.com\/INT\/API\/Runtime\/RHI\/FRHICommandList_1\/SetShaderResourceViewParameter\/1\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>FRHICommandList::SetShaderResourceViewParameter<\/strong><\/a>\u3092\u3001RWStructuredBuffer\u3084RWTexture2D\u306a\u3069\uff08GPU\u5074\u304b\u3089\u898b\u3066\uff09Write\u3082\u884c\u3046\u3082\u306e\u306e\u5834\u5408\u306b\u306fUnorderedAccessView\u3092\u4ecb\u3057\u3066\u5024\u3092\u3084\u308a\u53d6\u308a\u3059\u308b\u305f\u3081<a href=\"http:\/\/api.unrealengine.com\/INT\/API\/Runtime\/RHI\/FRHICommandList_1\/SetUAVParameter\/\" rel=\"noopener\" target=\"_blank\"><strong>SetUAVParameter<\/strong><\/a>\u3092\u4f7f\u3044\u307e\u3059\u3002\u306a\u305c\u95a2\u6570\u540d\u304cSetSRVParameter\u3067\u306a\u3044\u306e\u304b\u306f\u8b0e\u3067\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001FShaderResourceParameter\u306b\u5bfe\u3057\u3066\u306f\u3001IsBound()\u3067bind\u3055\u308c\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u306e\u30c1\u30a7\u30c3\u30af\u3092\u884c\u3063\u305f\u308a\u3001\u51e6\u7406\u304c\u7d42\u308f\u3063\u305f\u3089\u958b\u653e\u3059\u308b\u95a2\u6570\u3092\u4f5c\u308b\u305d\u3046\u3067\u3059\u3002<br \/>\n\u958b\u653e\u306b\u306f<strong>FShaderResourceViewRHIParamRef()<\/strong>\u3084<strong>FUnorderedAccessViewRHIParamRef()<\/strong>\u3092\u7528\u3044\u307e\u3059\u3002<br \/>\n<a href=\"https:\/\/api.unrealengine.com\/INT\/API\/Runtime\/ShaderCore\/FShaderResourceParameter\/GetBaseIndex\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>FShaderResourceParameter::GetBaseIndex<\/strong><\/a>\u304c\u4f55\u3092\u3084\u3063\u3066\u3044\u308b\u306e\u304b\u306f\u30a4\u30de\u30a4\u30c1\u3088\u304f\u308f\u304b\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u2026\u3002<br \/>\n\u6559\u3048\u3066\u3001\u8a73\u3057\u3044\u4eba\uff01<\/p>\n<p>\u25c6\u30b7\u30a7\u30fc\u30c0\u30bf\u30a4\u30d7\u306e\u767b\u9332<\/p>\n<pre class=\"start-line:25 lang:default decode:true \" title=\"TestComputeShader.cpp\" >IMPLEMENT_SHADER_TYPE(, FTestComputeShader, TEXT(\"\/Project\/Private\/compute_shader_test.usf\"), TEXT(\"CalculateOutput\"), SF_Compute);<\/pre>\n<p>\u516c\u5f0f\u89e3\u8aac\u8a18\u4e8b\u3067\u3042\u308b<a href=\"https:\/\/www.unrealengine.com\/ja\/blog\/how-to-add-global-shaders-to-ue4\" rel=\"noopener\" target=\"_blank\"><strong>UE4 \u306b\u30b0\u30ed\u30fc\u30d0\u30eb \u30b7\u30a7\u30fc\u30c0\u30fc\u3092\u8ffd\u52a0\u3057\u3066\u307f\u3088\u3046<\/strong><\/a>\u3067\u8a73\u3057\u304f\u8aac\u660e\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\n\u30b0\u30ed\u30fc\u30d0\u30eb\u30b7\u30a7\u30fc\u30c0\u3092\u7d99\u627f\u3057\u305f\u30af\u30e9\u30b9\uff08FTestComputeShader\uff09\u3092\u3001.usf\u30d5\u30a1\u30a4\u30eb\uff08&#8221;\/Project\/Private\/compute_shader_test.usf&#8221;\uff09\u306e\u30b7\u30a7\u30fc\u30c0\u30a8\u30f3\u30c8\u30ea\u30dd\u30a4\u30f3\u30c8\uff08&#8221;CalculateOutput&#8221;\uff09\u306b\u3001\u30b7\u30a7\u30fc\u30c0\u30b9\u30c6\u30fc\u30b8\uff08SF_Compute\uff09\u3068\u3057\u3066\u30de\u30c3\u30d7\u3059\u308b\u3001\u3068\u3044\u3046\u610f\u5473\u306e\u3088\u3046\u3067\u3059\u3002<br \/>\n\u6700\u5f8c\u306eSF_Compute\u306f<a href=\"https:\/\/api.unrealengine.com\/INT\/API\/Runtime\/RHI\/EShaderFrequency\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>EShaderFrequency<\/strong><\/a>\u306e\u5024\u306e1\u3064\u3067\u3001\u4eca\u56de\u306fComputeShader\u3067\u3059\u304c\u3001VertexShader\u3067\u3042\u308c\u3070SF_Vertex\u3092\u3001PixelShader\u3067\u3042\u308c\u3070SF_Pixel\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>&#8212;&#8212;<\/p>\n<p>\u2026\u3068\u3001\u3053\u308c\u3067\u3084\u3063\u3068C++\u5074\u3067\u306e\u30b7\u30a7\u30fc\u30c0\u306e\u7a93\u53e3\u306e\u5b8c\u6210\u3067\u3059\u3002<br \/>\n\u3067\u306f\u3053\u306e\u30af\u30e9\u30b9\u3092\u5b9f\u969b\u306b\u3069\u3046\u4f7f\u3046\u304b\u3001\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308b\u306e\u3067\u3059\u304c\u3001\u307e\u305f\u3057\u3066\u3082\u9577\u6587\u306b\u306a\u3063\u3066\u3057\u307e\u3063\u305f\u306e\u3067\u3001\u7d9a\u304d\u306f\u6b21\u56de\uff08<a href=\"http:\/\/www.sciement.com\/tech-blog\/c\/structured_buffer_compute_shader_ue4_part3\/\" rel=\"noopener\" target=\"_blank\"><strong>\u305d\u306e\uff13\uff1a\u5b9f\u969b\u306b\u7528\u3044\u308b<\/strong><\/a>\uff09\u306b\u56de\u3057\u307e\u3059\u3002<br \/>\n<a href=\"https:\/\/github.com\/HSeo\/ComputeShaderUE419Test\" rel=\"noopener\" target=\"_blank\"><strong>\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092GitHub\u306b\u4e0a\u3052\u3066\u3042\u308a\u307e\u3059<\/strong><\/a>\u306e\u3067\u3001\u89e3\u8aac\u306a\u3093\u3066\u8981\u3089\u306a\u3044\u3068\u3044\u3046\u65b9\u306f\u3054\u81ea\u7531\u306b\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u773a\u3081\u3066\u304f\u3060\u3055\u3044\u307e\u305b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u305d\u306e\uff11\uff1a\u30a4\u30f3\u30c8\u30ed\u3067\u306f\u6587\u5b57\u901a\u308a\u30a4\u30f3\u30c8\u30ed\uff08\u3068\u611a\u75f4\u2026\uff09\u3060\u3051\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u306e\u3067\u3001\u305d\u306e\uff12\u3067\u306f\u5177\u4f53\u7684\u306a\u5b9f\u88c5\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002 1. C++\u7d4c\u7531\u3067\u5909\u6570\u3092HLSL\u5074\u306b\u6e21\u3059 2. C++\u5074\u306e\u5909\u6570\u306b\u306fFVector\u3082\u5165\u308c\u308b 3. Stru &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,12,11,6],"tags":[],"class_list":["post-250","post","type-post","status-publish","format-standard","hentry","category-c","category-computeshader","category-hlsl","category-unreal-engine-4"],"_links":{"self":[{"href":"https:\/\/www.sciement.com\/tech-blog\/wp-json\/wp\/v2\/posts\/250","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sciement.com\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sciement.com\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sciement.com\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sciement.com\/tech-blog\/wp-json\/wp\/v2\/comments?post=250"}],"version-history":[{"count":14,"href":"https:\/\/www.sciement.com\/tech-blog\/wp-json\/wp\/v2\/posts\/250\/revisions"}],"predecessor-version":[{"id":274,"href":"https:\/\/www.sciement.com\/tech-blog\/wp-json\/wp\/v2\/posts\/250\/revisions\/274"}],"wp:attachment":[{"href":"https:\/\/www.sciement.com\/tech-blog\/wp-json\/wp\/v2\/media?parent=250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sciement.com\/tech-blog\/wp-json\/wp\/v2\/categories?post=250"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sciement.com\/tech-blog\/wp-json\/wp\/v2\/tags?post=250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}