Forráskód Böngészése

migrate to direct x 12 with raytracing

Kolja Strohm 4 hete
szülő
commit
eddaa40ad7

+ 1 - 1
FactoryCraft/Block.cpp

@@ -3,7 +3,7 @@
 #include <Shader.h>
 #include <Texture.h>
 
-#include "CustomDX11API.h"
+#include "CustomDX12API.h"
 #include "Globals.h"
 
 Block::Block(const BlockType* zType,

+ 3 - 26
FactoryCraft/Chunk.cpp

@@ -5,7 +5,7 @@
 #include "ChunkFluidModel.h"
 #include "ChunkGroundModel.h"
 #include "Constants.h"
-#include "CustomDX11API.h"
+#include "CustomDX12API.h"
 #include "FactoryCraftModel.h"
 #include "Globals.h"
 #include "TransparentChunkGroundModel.h"
@@ -363,20 +363,12 @@ void Chunk::updateLight(ChunkModelBuilder* builder)
     builder->updateLightning();
 }
 
-void Chunk::renderSolid(std::function<void(Model3D*)> f)
+void Chunk::forAll(std::function<void(Model3D*)> f)
 {
-    CustomDX11API* api
-        = (CustomDX11API*)uiFactory.initParam.bildschirm->zGraphicsApi();
-    api->setCullBack(false);
     for (ChunkModelBuilder* builder : modelBuilders)
     {
-        if (!builder->isTransparent())
-        {
-            f(builder->zModel());
-        }
+        f(builder->zModel());
     }
-    api->setCullBack(true);
-    float dist = 0.f;
     vLock.lockRead();
     for (Block* b : visibleBlocks)
     {
@@ -385,21 +377,6 @@ void Chunk::renderSolid(std::function<void(Model3D*)> f)
     vLock.unlockRead();
 }
 
-void Chunk::renderTransparent(std::function<void(Model3D*)> f)
-{
-    CustomDX11API* api
-        = (CustomDX11API*)uiFactory.initParam.bildschirm->zGraphicsApi();
-    api->setCullBack(false);
-    for (ChunkModelBuilder* builder : modelBuilders)
-    {
-        if (builder->isTransparent())
-        {
-            f(builder->zModel());
-        }
-    }
-    api->setCullBack(true);
-}
-
 bool Chunk::tick(std::function<void(Model3D*)> f, double time)
 {
     for (ChunkModelBuilder* builder : modelBuilders)

+ 1 - 2
FactoryCraft/Chunk.h

@@ -50,8 +50,7 @@ public:
     Chunk(Framework::Point location, Framework::StreamReader* zReader);
     ~Chunk();
 
-    void renderSolid(std::function<void(Model3D*)> f);
-    void renderTransparent(std::function<void(Model3D*)> f);
+    void forAll(std::function<void(Model3D*)> f);
     bool tick(std::function<void(Model3D*)> f, double time);
 
     void destroy();

+ 7 - 0
FactoryCraft/ClosestHit.hlsl

@@ -0,0 +1,7 @@
+#include "Common.hlsl"
+
+[shader("closesthit")]
+void ClosestHit(inout HitInfo payload, Attributes attrib)
+{
+    payload.colorAndDistance = float4(1, 1, 0, RayTCurrent());
+}

+ 17 - 0
FactoryCraft/Common.hlsl

@@ -0,0 +1,17 @@
+// Hit information, aka ray payload
+// This sample only carries a shading color and hit distance.
+// Note that the payload should be kept as small as possible,
+// and that its size must be declared in the corresponding
+// D3D12_RAYTRACING_SHADER_CONFIG pipeline subobjet.
+
+struct [raypayload] HitInfo
+{
+    float4 colorAndDistance : write(caller, closesthit, miss) : read(caller);
+};
+
+// Attributes output by the raytracing when hitting a surface,
+// here the barycentric coordinates
+struct Attributes
+{
+    float2 bary;
+};

+ 326 - 0
FactoryCraft/CustomClosestHitShader.h

@@ -0,0 +1,326 @@
+#if 0
+; shader debug name: C:\Users\kolja\Desktop\Kolja-Strohm-Games\Spiele
+; shader hash: 74a3796374236d47f2714b165d5753e0
+;
+; Buffer Definitions:
+;
+;
+; Resource Bindings:
+;
+; Name                                 Type  Format         Dim      ID      HLSL Bind  Count
+; ------------------------------ ---------- ------- ----------- ------- -------------- ------
+;
+target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64"
+target triple = "dxil-ms-dx"
+
+%struct.HitInfo = type { <4 x float> }
+%struct.Attributes = type { <2 x float> }
+
+@dx.nothing.a = internal constant [1 x i32] zeroinitializer
+
+; Function Attrs: nounwind
+define void @"\01?ClosestHit@@YAXUHitInfo@@UAttributes@@@Z"(%struct.HitInfo* noalias %payload, %struct.Attributes* %attrib) #0 {
+  %1 = call float @dx.op.rayTCurrent.f32(i32 154)  ; RayTCurrent()
+  %2 = insertelement <4 x float> <float 1.000000e+00, float 1.000000e+00, float 0.000000e+00, float undef>, float %1, i64 3
+  %3 = load i32, i32* getelementptr inbounds ([1 x i32], [1 x i32]* @dx.nothing.a, i32 0, i32 0)
+  %4 = load i32, i32* getelementptr inbounds ([1 x i32], [1 x i32]* @dx.nothing.a, i32 0, i32 0)
+  %5 = getelementptr inbounds %struct.HitInfo, %struct.HitInfo* %payload, i32 0, i32 0
+  store <4 x float> %2, <4 x float>* %5
+  ret void
+}
+
+; Function Attrs: nounwind readonly
+declare float @dx.op.rayTCurrent.f32(i32) #1
+
+attributes #0 = { nounwind }
+attributes #1 = { nounwind readonly }
+
+!llvm.ident = !{!0}
+!dx.version = !{!1}
+!dx.valver = !{!1}
+!dx.shaderModel = !{!2}
+!dx.typeAnnotations = !{!3}
+!dx.dxrPayloadAnnotations = !{!9}
+!dx.entryPoints = !{!12, !14}
+
+!0 = !{!"dxcoob 1.8.2502.11 (239921522)"}
+!1 = !{i32 1, i32 8}
+!2 = !{!"lib", i32 6, i32 8}
+!3 = !{i32 1, void (%struct.HitInfo*, %struct.Attributes*)* @"\01?ClosestHit@@YAXUHitInfo@@UAttributes@@@Z", !4}
+!4 = !{!5, !7, !8}
+!5 = !{i32 1, !6, !6}
+!6 = !{}
+!7 = !{i32 2, !6, !6}
+!8 = !{i32 0, !6, !6}
+!9 = !{i32 0, %struct.HitInfo undef, !10}
+!10 = !{!11}
+!11 = !{i32 0, i32 547}
+!12 = !{null, !"", null, null, !13}
+!13 = !{i32 0, i64 1}
+!14 = !{void (%struct.HitInfo*, %struct.Attributes*)* @"\01?ClosestHit@@YAXUHitInfo@@UAttributes@@@Z", !"\01?ClosestHit@@YAXUHitInfo@@UAttributes@@@Z", null, null, !15}
+!15 = !{i32 8, i32 10, i32 6, i32 16, i32 7, i32 8, i32 5, !16}
+!16 = !{i32 0}
+
+#endif
+
+const unsigned char CustomClosestHitShader[] = {
+  0x44, 0x58, 0x42, 0x43, 0x9b, 0x80, 0x8d, 0x0c, 0xfa, 0xa4, 0x3c, 0xad,
+  0x6a, 0x99, 0x8a, 0xcf, 0xeb, 0xac, 0xe2, 0x20, 0x01, 0x00, 0x00, 0x00,
+  0x20, 0x0c, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00,
+  0x4c, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00,
+  0x6c, 0x06, 0x00, 0x00, 0xac, 0x06, 0x00, 0x00, 0xc8, 0x06, 0x00, 0x00,
+  0x53, 0x46, 0x49, 0x30, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x56, 0x45, 0x52, 0x53, 0x28, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, 0x12, 0x00, 0x00,
+  0x15, 0x00, 0x00, 0x00, 0x32, 0x33, 0x39, 0x39, 0x32, 0x31, 0x35, 0x32,
+  0x00, 0x31, 0x2e, 0x38, 0x2e, 0x32, 0x35, 0x30, 0x32, 0x2e, 0x31, 0x31,
+  0x00, 0x00, 0x00, 0x00, 0x52, 0x44, 0x41, 0x54, 0x94, 0x00, 0x00, 0x00,
+  0x10, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
+  0x50, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00,
+  0x00, 0x01, 0x3f, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x73, 0x74, 0x48, 0x69,
+  0x74, 0x40, 0x40, 0x59, 0x41, 0x58, 0x55, 0x48, 0x69, 0x74, 0x49, 0x6e,
+  0x66, 0x6f, 0x40, 0x40, 0x55, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75,
+  0x74, 0x65, 0x73, 0x40, 0x40, 0x40, 0x5a, 0x00, 0x43, 0x6c, 0x6f, 0x73,
+  0x65, 0x73, 0x74, 0x48, 0x69, 0x74, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+  0x3c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
+  0xff, 0xff, 0xff, 0xff, 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
+  0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x04, 0x00, 0x00, 0x63, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0xff, 0xff, 0xff, 0xff, 0x53, 0x54, 0x41, 0x54, 0x4c, 0x05, 0x00, 0x00,
+  0x68, 0x00, 0x06, 0x00, 0x53, 0x01, 0x00, 0x00, 0x44, 0x58, 0x49, 0x4c,
+  0x08, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x34, 0x05, 0x00, 0x00,
+  0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00, 0x4a, 0x01, 0x00, 0x00,
+  0x0b, 0x82, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
+  0x07, 0x81, 0x23, 0x91, 0x41, 0xc8, 0x04, 0x49, 0x06, 0x10, 0x32, 0x39,
+  0x92, 0x01, 0x84, 0x0c, 0x25, 0x05, 0x08, 0x19, 0x1e, 0x04, 0x8b, 0x62,
+  0x80, 0x14, 0x45, 0x02, 0x42, 0x92, 0x0b, 0x42, 0xa4, 0x10, 0x32, 0x14,
+  0x38, 0x08, 0x18, 0x4b, 0x0a, 0x32, 0x52, 0x88, 0x48, 0x90, 0x14, 0x20,
+  0x43, 0x46, 0x88, 0xa5, 0x00, 0x19, 0x32, 0x42, 0xe4, 0x48, 0x0e, 0x90,
+  0x91, 0x22, 0xc4, 0x50, 0x41, 0x51, 0x81, 0x8c, 0xe1, 0x83, 0xe5, 0x8a,
+  0x04, 0x29, 0x46, 0x06, 0x51, 0x18, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
+  0x1b, 0x88, 0x20, 0x00, 0x92, 0x0d, 0x84, 0xf0, 0xff, 0xff, 0xff, 0xff,
+  0x03, 0x20, 0x6d, 0x30, 0x86, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x09,
+  0xa8, 0x00, 0x00, 0x00, 0x49, 0x18, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+  0x13, 0x84, 0x40, 0x98, 0x10, 0x0c, 0x00, 0x00, 0x89, 0x20, 0x00, 0x00,
+  0x18, 0x00, 0x00, 0x00, 0x32, 0x22, 0x48, 0x09, 0x20, 0x64, 0x85, 0x04,
+  0x93, 0x22, 0xa4, 0x84, 0x04, 0x93, 0x22, 0xe3, 0x84, 0xa1, 0x90, 0x14,
+  0x12, 0x4c, 0x8a, 0x8c, 0x0b, 0x84, 0xa4, 0x4c, 0x10, 0x44, 0x73, 0x04,
+  0x60, 0x90, 0x01, 0x80, 0xc2, 0x08, 0xc0, 0x0c, 0xc0, 0x30, 0x02, 0x41,
+  0x9c, 0x23, 0x4d, 0x11, 0x25, 0x4c, 0x7e, 0x88, 0x4c, 0x62, 0x53, 0x38,
+  0x28, 0x28, 0x64, 0x86, 0x11, 0x04, 0xe2, 0x22, 0x69, 0x8a, 0x28, 0x61,
+  0xf2, 0xb5, 0x69, 0x8a, 0x90, 0x80, 0x9a, 0x08, 0x09, 0x05, 0x88, 0x52,
+  0x19, 0xc6, 0x51, 0xb4, 0x8a, 0x40, 0x00, 0xb5, 0x81, 0x80, 0x39, 0x02,
+  0x50, 0x00, 0x00, 0x00, 0x13, 0x14, 0x72, 0xc0, 0x87, 0x74, 0x60, 0x87,
+  0x36, 0x68, 0x87, 0x79, 0x68, 0x03, 0x72, 0xc0, 0x87, 0x0d, 0xaf, 0x50,
+  0x0e, 0x6d, 0xd0, 0x0e, 0x7a, 0x50, 0x0e, 0x6d, 0x00, 0x0f, 0x7a, 0x30,
+  0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0xa0,
+  0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x78, 0xa0, 0x07, 0x73, 0x20,
+  0x07, 0x6d, 0x90, 0x0e, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0,
+  0x06, 0xe9, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90,
+  0x0e, 0x76, 0x40, 0x07, 0x7a, 0x60, 0x07, 0x74, 0xd0, 0x06, 0xe6, 0x10,
+  0x07, 0x76, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x60, 0x0e, 0x73, 0x20,
+  0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe6, 0x60, 0x07, 0x74, 0xa0,
+  0x07, 0x76, 0x40, 0x07, 0x6d, 0xe0, 0x0e, 0x78, 0xa0, 0x07, 0x71, 0x60,
+  0x07, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x3a, 0x0f,
+  0x24, 0x90, 0x21, 0x23, 0x25, 0x40, 0x00, 0x1e, 0xaa, 0x31, 0xe4, 0x59,
+  0x80, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0xc8,
+  0xd3, 0x00, 0x01, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
+  0x16, 0x08, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x32, 0x1e, 0x98, 0x14,
+  0x19, 0x11, 0x4c, 0x90, 0x8c, 0x09, 0x26, 0x47, 0xc6, 0x04, 0x43, 0x02,
+  0x25, 0x50, 0x10, 0x23, 0x00, 0xc5, 0x50, 0x20, 0x65, 0x50, 0x0e, 0x25,
+  0x51, 0x1a, 0x85, 0x50, 0x04, 0x65, 0x8c, 0x50, 0x14, 0xa5, 0x40, 0xb0,
+  0x04, 0xc8, 0xcc, 0x00, 0x50, 0x9a, 0x01, 0xa0, 0x30, 0x02, 0x00, 0x00,
+  0x79, 0x18, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x1a, 0x03, 0x4c, 0x90,
+  0x46, 0x02, 0x13, 0x44, 0x8f, 0x0c, 0x6f, 0xec, 0xed, 0x4d, 0x0c, 0x24,
+  0xc6, 0x05, 0xc7, 0x45, 0xa6, 0x06, 0x46, 0xc6, 0x25, 0x26, 0x06, 0x04,
+  0x45, 0x66, 0x26, 0x27, 0x47, 0x26, 0xa6, 0x46, 0x46, 0x26, 0x65, 0x43,
+  0x10, 0x4c, 0x10, 0x80, 0x61, 0x82, 0x00, 0x10, 0x1b, 0x84, 0x81, 0x98,
+  0x20, 0x00, 0xc5, 0x06, 0xc1, 0x30, 0x38, 0xb0, 0xa5, 0x89, 0x4d, 0x10,
+  0x00, 0x63, 0xc3, 0x80, 0x24, 0xc4, 0x04, 0xc1, 0x90, 0x26, 0x08, 0xc0,
+  0x41, 0x68, 0xec, 0x8d, 0xed, 0x4d, 0x2e, 0xc8, 0x8d, 0x8c, 0x28, 0x6d,
+  0x8e, 0x2e, 0xcc, 0x6d, 0xac, 0x6c, 0x82, 0x00, 0x20, 0x13, 0x04, 0x20,
+  0x99, 0x20, 0x00, 0xca, 0x04, 0x01, 0x58, 0x26, 0x08, 0x00, 0xb3, 0x01,
+  0x49, 0x1a, 0xc7, 0x78, 0xa0, 0x48, 0xda, 0x20, 0x30, 0xd3, 0x04, 0x21,
+  0x99, 0x48, 0x88, 0x85, 0xc9, 0xe5, 0x4d, 0x10, 0x80, 0x66, 0x03, 0x92,
+  0x58, 0x8e, 0xf1, 0x40, 0xd1, 0xb5, 0x41, 0x20, 0xb0, 0x0d, 0x85, 0xb1,
+  0x50, 0x55, 0x36, 0x41, 0x60, 0x82, 0x0d, 0xc0, 0x86, 0x61, 0xe0, 0xb8,
+  0x0d, 0xc3, 0xc5, 0x71, 0x1b, 0x06, 0x83, 0xe3, 0x36, 0x0c, 0x9d, 0xf7,
+  0x6d, 0x18, 0x86, 0x0d, 0x0c, 0x26, 0x08, 0x80, 0xb3, 0x41, 0x30, 0xc4,
+  0x60, 0x43, 0x30, 0x06, 0x1b, 0x06, 0x63, 0x21, 0x03, 0x02, 0x13, 0x04,
+  0x28, 0xda, 0x20, 0x18, 0x67, 0xb0, 0xa1, 0x00, 0xcc, 0x00, 0x00, 0xd0,
+  0x80, 0x6a, 0x10, 0xf0, 0x33, 0xc4, 0xf6, 0x36, 0x57, 0x36, 0x47, 0x87,
+  0x94, 0x46, 0x07, 0x04, 0x94, 0x15, 0x84, 0x55, 0x85, 0x94, 0x46, 0x97,
+  0xe4, 0x66, 0xf6, 0x06, 0x04, 0x54, 0x15, 0x44, 0x47, 0x27, 0x97, 0x26,
+  0x56, 0x47, 0x57, 0x36, 0x07, 0x04, 0x04, 0xa4, 0x35, 0x41, 0x00, 0x9e,
+  0x09, 0x02, 0x00, 0x6d, 0x08, 0x8c, 0x0d, 0x08, 0xb1, 0x06, 0x09, 0xf3,
+  0x10, 0x6c, 0xd0, 0x06, 0x1b, 0x8a, 0x4d, 0x0d, 0x00, 0xc0, 0x0d, 0x58,
+  0xa4, 0xb9, 0xcd, 0xd1, 0xcd, 0x6d, 0x10, 0xe0, 0xe0, 0xa9, 0xc2, 0xc6,
+  0x66, 0xd7, 0xe6, 0x92, 0x46, 0x56, 0xe6, 0x46, 0x37, 0x25, 0x08, 0xaa,
+  0x90, 0xe1, 0xb9, 0xd8, 0x95, 0xc9, 0xcd, 0xa5, 0xbd, 0xb9, 0x4d, 0x09,
+  0x88, 0x26, 0x64, 0x78, 0x2e, 0x76, 0x61, 0x6c, 0x76, 0x65, 0x72, 0x53,
+  0x02, 0xa3, 0x0e, 0x19, 0x9e, 0xcb, 0x1c, 0x5a, 0x18, 0x59, 0x99, 0x5c,
+  0xd3, 0x1b, 0x59, 0x19, 0xdb, 0x94, 0x20, 0xa9, 0x44, 0x86, 0xe7, 0x42,
+  0x97, 0x07, 0x57, 0x16, 0xe4, 0xe6, 0xf6, 0x46, 0x17, 0x46, 0x97, 0xf6,
+  0xe6, 0x36, 0x37, 0x45, 0xc8, 0xc0, 0xa0, 0x18, 0x19, 0x9e, 0x0b, 0x19,
+  0x9e, 0x1c, 0x54, 0x58, 0x1e, 0xdb, 0x5b, 0x18, 0x59, 0x90, 0x9b, 0xdb,
+  0x1b, 0x5d, 0x18, 0x5d, 0xda, 0x9b, 0xdb, 0xdc, 0x94, 0x80, 0x0c, 0xea,
+  0x90, 0xe1, 0xb9, 0x94, 0xb9, 0xd1, 0xc9, 0xe5, 0x41, 0xbd, 0xa5, 0xb9,
+  0xd1, 0xcd, 0x4d, 0x11, 0xd0, 0xc0, 0x0d, 0xba, 0x90, 0xe1, 0xb9, 0x8c,
+  0xbd, 0xd5, 0xb9, 0xd1, 0x95, 0xc9, 0xcd, 0x4d, 0x09, 0xe0, 0x00, 0x00,
+  0x79, 0x18, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x33, 0x08, 0x80, 0x1c,
+  0xc4, 0xe1, 0x1c, 0x66, 0x14, 0x01, 0x3d, 0x88, 0x43, 0x38, 0x84, 0xc3,
+  0x8c, 0x42, 0x80, 0x07, 0x79, 0x78, 0x07, 0x73, 0x98, 0x71, 0x0c, 0xe6,
+  0x00, 0x0f, 0xed, 0x10, 0x0e, 0xf4, 0x80, 0x0e, 0x33, 0x0c, 0x42, 0x1e,
+  0xc2, 0xc1, 0x1d, 0xce, 0xa1, 0x1c, 0x66, 0x30, 0x05, 0x3d, 0x88, 0x43,
+  0x38, 0x84, 0x83, 0x1b, 0xcc, 0x03, 0x3d, 0xc8, 0x43, 0x3d, 0x8c, 0x03,
+  0x3d, 0xcc, 0x78, 0x8c, 0x74, 0x70, 0x07, 0x7b, 0x08, 0x07, 0x79, 0x48,
+  0x87, 0x70, 0x70, 0x07, 0x7a, 0x70, 0x03, 0x76, 0x78, 0x87, 0x70, 0x20,
+  0x87, 0x19, 0xcc, 0x11, 0x0e, 0xec, 0x90, 0x0e, 0xe1, 0x30, 0x0f, 0x6e,
+  0x30, 0x0f, 0xe3, 0xf0, 0x0e, 0xf0, 0x50, 0x0e, 0x33, 0x10, 0xc4, 0x1d,
+  0xde, 0x21, 0x1c, 0xd8, 0x21, 0x1d, 0xc2, 0x61, 0x1e, 0x66, 0x30, 0x89,
+  0x3b, 0xbc, 0x83, 0x3b, 0xd0, 0x43, 0x39, 0xb4, 0x03, 0x3c, 0xbc, 0x83,
+  0x3c, 0x84, 0x03, 0x3b, 0xcc, 0xf0, 0x14, 0x76, 0x60, 0x07, 0x7b, 0x68,
+  0x07, 0x37, 0x68, 0x87, 0x72, 0x68, 0x07, 0x37, 0x80, 0x87, 0x70, 0x90,
+  0x87, 0x70, 0x60, 0x07, 0x76, 0x28, 0x07, 0x76, 0xf8, 0x05, 0x76, 0x78,
+  0x87, 0x77, 0x80, 0x87, 0x5f, 0x08, 0x87, 0x71, 0x18, 0x87, 0x72, 0x98,
+  0x87, 0x79, 0x98, 0x81, 0x2c, 0xee, 0xf0, 0x0e, 0xee, 0xe0, 0x0e, 0xf5,
+  0xc0, 0x0e, 0xec, 0x30, 0x03, 0x62, 0xc8, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c,
+  0xcc, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xdc, 0x61, 0x1c, 0xca, 0x21, 0x1c,
+  0xc4, 0x81, 0x1d, 0xca, 0x61, 0x06, 0xd6, 0x90, 0x43, 0x39, 0xc8, 0x43,
+  0x39, 0x98, 0x43, 0x39, 0xc8, 0x43, 0x39, 0xb8, 0xc3, 0x38, 0x94, 0x43,
+  0x38, 0x88, 0x03, 0x3b, 0x94, 0xc3, 0x2f, 0xbc, 0x83, 0x3c, 0xfc, 0x82,
+  0x3b, 0xd4, 0x03, 0x3b, 0xb0, 0xc3, 0x8c, 0xc8, 0x21, 0x07, 0x7c, 0x70,
+  0x03, 0x72, 0x10, 0x87, 0x73, 0x70, 0x03, 0x7b, 0x08, 0x07, 0x79, 0x60,
+  0x87, 0x70, 0xc8, 0x87, 0x77, 0xa8, 0x07, 0x7a, 0x98, 0x81, 0x3c, 0xe4,
+  0x80, 0x0f, 0x6e, 0x40, 0x0f, 0xe5, 0xd0, 0x0e, 0xf0, 0x00, 0x00, 0x00,
+  0x71, 0x20, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x15, 0xa0, 0x06, 0x81,
+  0xdf, 0x90, 0xfd, 0x9e, 0x97, 0xe7, 0x74, 0x64, 0x9a, 0x0e, 0x04, 0x66,
+  0x83, 0xd8, 0x2a, 0x32, 0x4d, 0x4f, 0xba, 0xcd, 0x6f, 0x20, 0xb0, 0x1a,
+  0xa4, 0xd3, 0xe5, 0x69, 0x71, 0x9d, 0x5e, 0x9e, 0x03, 0x81, 0x40, 0xad,
+  0x01, 0x30, 0xc3, 0xe5, 0x37, 0xce, 0x74, 0x20, 0x8d, 0xe1, 0x03, 0x26,
+  0x50, 0x0d, 0x97, 0xef, 0x3c, 0x7e, 0x04, 0x60, 0x2d, 0x47, 0x45, 0x11,
+  0xd1, 0x4c, 0x7e, 0x71, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x49, 0x4c, 0x44, 0x4e, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00,
+  0x43, 0x3a, 0x5c, 0x55, 0x73, 0x65, 0x72, 0x73, 0x5c, 0x6b, 0x6f, 0x6c,
+  0x6a, 0x61, 0x5c, 0x44, 0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x5c, 0x4b,
+  0x6f, 0x6c, 0x6a, 0x61, 0x2d, 0x53, 0x74, 0x72, 0x6f, 0x68, 0x6d, 0x2d,
+  0x47, 0x61, 0x6d, 0x65, 0x73, 0x5c, 0x53, 0x70, 0x69, 0x65, 0x6c, 0x65,
+  0x00, 0x00, 0x00, 0x00, 0x48, 0x41, 0x53, 0x48, 0x14, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x74, 0xa3, 0x79, 0x63, 0x74, 0x23, 0x6d, 0x47,
+  0xf2, 0x71, 0x4b, 0x16, 0x5d, 0x57, 0x53, 0xe0, 0x44, 0x58, 0x49, 0x4c,
+  0x50, 0x05, 0x00, 0x00, 0x68, 0x00, 0x06, 0x00, 0x54, 0x01, 0x00, 0x00,
+  0x44, 0x58, 0x49, 0x4c, 0x08, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
+  0x38, 0x05, 0x00, 0x00, 0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00,
+  0x4b, 0x01, 0x00, 0x00, 0x0b, 0x82, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00,
+  0x13, 0x00, 0x00, 0x00, 0x07, 0x81, 0x23, 0x91, 0x41, 0xc8, 0x04, 0x49,
+  0x06, 0x10, 0x32, 0x39, 0x92, 0x01, 0x84, 0x0c, 0x25, 0x05, 0x08, 0x19,
+  0x1e, 0x04, 0x8b, 0x62, 0x80, 0x14, 0x45, 0x02, 0x42, 0x92, 0x0b, 0x42,
+  0xa4, 0x10, 0x32, 0x14, 0x38, 0x08, 0x18, 0x4b, 0x0a, 0x32, 0x52, 0x88,
+  0x48, 0x90, 0x14, 0x20, 0x43, 0x46, 0x88, 0xa5, 0x00, 0x19, 0x32, 0x42,
+  0xe4, 0x48, 0x0e, 0x90, 0x91, 0x22, 0xc4, 0x50, 0x41, 0x51, 0x81, 0x8c,
+  0xe1, 0x83, 0xe5, 0x8a, 0x04, 0x29, 0x46, 0x06, 0x51, 0x18, 0x00, 0x00,
+  0x07, 0x00, 0x00, 0x00, 0x1b, 0x88, 0x20, 0x00, 0x92, 0x0d, 0x84, 0xf0,
+  0xff, 0xff, 0xff, 0xff, 0x03, 0x20, 0x6d, 0x30, 0x86, 0xff, 0xff, 0xff,
+  0xff, 0x1f, 0x00, 0x09, 0xa8, 0x00, 0x00, 0x00, 0x49, 0x18, 0x00, 0x00,
+  0x02, 0x00, 0x00, 0x00, 0x13, 0x84, 0x40, 0x98, 0x10, 0x0c, 0x00, 0x00,
+  0x89, 0x20, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x32, 0x22, 0x48, 0x09,
+  0x20, 0x64, 0x85, 0x04, 0x93, 0x22, 0xa4, 0x84, 0x04, 0x93, 0x22, 0xe3,
+  0x84, 0xa1, 0x90, 0x14, 0x12, 0x4c, 0x8a, 0x8c, 0x0b, 0x84, 0xa4, 0x4c,
+  0x10, 0x4c, 0x73, 0x04, 0x60, 0x90, 0x01, 0x80, 0xc2, 0x08, 0xc0, 0x0c,
+  0xc0, 0x30, 0x02, 0x41, 0x9c, 0x23, 0x4d, 0x11, 0x25, 0x4c, 0x7e, 0x88,
+  0x4c, 0x62, 0x53, 0x38, 0x28, 0x28, 0x64, 0x86, 0x11, 0x04, 0xe2, 0x22,
+  0x69, 0x8a, 0x28, 0x61, 0xf2, 0xb5, 0x69, 0x8a, 0x90, 0x80, 0x9a, 0x08,
+  0x09, 0x05, 0x88, 0x52, 0x19, 0xc6, 0x51, 0xb4, 0x8a, 0x40, 0x00, 0xb5,
+  0x81, 0x80, 0x39, 0x02, 0x50, 0x20, 0x40, 0x05, 0x00, 0x00, 0x00, 0x00,
+  0x13, 0x14, 0x72, 0xc0, 0x87, 0x74, 0x60, 0x87, 0x36, 0x68, 0x87, 0x79,
+  0x68, 0x03, 0x72, 0xc0, 0x87, 0x0d, 0xaf, 0x50, 0x0e, 0x6d, 0xd0, 0x0e,
+  0x7a, 0x50, 0x0e, 0x6d, 0x00, 0x0f, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07,
+  0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0xa0, 0x07, 0x73, 0x20, 0x07,
+  0x6d, 0x90, 0x0e, 0x78, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e,
+  0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe9, 0x30, 0x07,
+  0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x76, 0x40, 0x07,
+  0x7a, 0x60, 0x07, 0x74, 0xd0, 0x06, 0xe6, 0x10, 0x07, 0x76, 0xa0, 0x07,
+  0x73, 0x20, 0x07, 0x6d, 0x60, 0x0e, 0x73, 0x20, 0x07, 0x7a, 0x30, 0x07,
+  0x72, 0xd0, 0x06, 0xe6, 0x60, 0x07, 0x74, 0xa0, 0x07, 0x76, 0x40, 0x07,
+  0x6d, 0xe0, 0x0e, 0x78, 0xa0, 0x07, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07,
+  0x72, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x3a, 0x0f, 0x24, 0x90, 0x21, 0x23,
+  0x25, 0x40, 0x00, 0x1e, 0xa0, 0x31, 0xe4, 0x59, 0x00, 0x00, 0x08, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0xc8, 0xd3, 0x00, 0x01, 0x20,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x16, 0x08, 0x00, 0x00,
+  0x0b, 0x00, 0x00, 0x00, 0x32, 0x1e, 0x98, 0x14, 0x19, 0x11, 0x4c, 0x90,
+  0x8c, 0x09, 0x26, 0x47, 0xc6, 0x04, 0x43, 0x02, 0x25, 0x50, 0x10, 0xc5,
+  0x50, 0x04, 0x23, 0x00, 0x65, 0x8c, 0x50, 0x14, 0x05, 0x52, 0x0e, 0xa5,
+  0x40, 0xb0, 0x04, 0xc8, 0xcc, 0x00, 0x50, 0x18, 0x01, 0x00, 0x00, 0x00,
+  0x79, 0x18, 0x00, 0x00, 0x53, 0x00, 0x00, 0x00, 0x1a, 0x03, 0x4c, 0x90,
+  0x46, 0x02, 0x13, 0x44, 0x8f, 0x0c, 0x6f, 0xec, 0xed, 0x4d, 0x0c, 0x24,
+  0xc6, 0x05, 0xc7, 0x45, 0xa6, 0x06, 0x46, 0xc6, 0x25, 0x26, 0x06, 0x04,
+  0x45, 0x66, 0x26, 0x27, 0x47, 0x26, 0xa6, 0x46, 0x46, 0x26, 0x65, 0x43,
+  0x10, 0x4c, 0x10, 0x80, 0x61, 0x82, 0x00, 0x10, 0x1b, 0x84, 0x81, 0xe0,
+  0xc0, 0x96, 0x26, 0x36, 0x41, 0x00, 0x8a, 0x0d, 0x83, 0x71, 0x10, 0x13,
+  0x04, 0x26, 0xd8, 0x00, 0x6c, 0x18, 0x06, 0x45, 0x99, 0x20, 0x00, 0xc6,
+  0x86, 0x81, 0x51, 0x94, 0x09, 0x02, 0x70, 0x6c, 0x18, 0x1c, 0x45, 0xd9,
+  0x30, 0x2c, 0xcd, 0xb3, 0x61, 0x18, 0x12, 0x68, 0x82, 0x60, 0x38, 0x13,
+  0x04, 0x00, 0xd9, 0x20, 0x38, 0xd3, 0x86, 0x80, 0xda, 0x30, 0x38, 0x52,
+  0x45, 0x60, 0x82, 0x00, 0x35, 0x1b, 0x04, 0x07, 0xdb, 0x50, 0x00, 0x17,
+  0x00, 0x64, 0x54, 0x83, 0x80, 0x9f, 0x21, 0xb6, 0xb7, 0xb9, 0xb2, 0x39,
+  0x3a, 0xa4, 0x34, 0x3a, 0x20, 0xa0, 0xac, 0x20, 0xac, 0x2a, 0xa4, 0x34,
+  0xba, 0x24, 0x37, 0xb3, 0x37, 0x20, 0xa0, 0xaa, 0x20, 0x3a, 0x3a, 0xb9,
+  0x34, 0xb1, 0x3a, 0xba, 0xb2, 0x39, 0x20, 0x20, 0x20, 0xad, 0x09, 0x02,
+  0x90, 0x4c, 0x10, 0x00, 0x65, 0x82, 0x00, 0x2c, 0x13, 0x04, 0x80, 0xd9,
+  0x10, 0x38, 0x1b, 0x10, 0x82, 0x3b, 0x3a, 0x8f, 0xf8, 0xc0, 0x60, 0x43,
+  0x91, 0x6c, 0x00, 0x10, 0x06, 0x55, 0xd8, 0xd8, 0xec, 0xda, 0x5c, 0xd2,
+  0xc8, 0xca, 0xdc, 0xe8, 0xa6, 0x04, 0x41, 0x15, 0x32, 0x3c, 0x17, 0xbb,
+  0x32, 0xb9, 0xb9, 0xb4, 0x37, 0xb7, 0x29, 0x01, 0xd1, 0x84, 0x0c, 0xcf,
+  0xc5, 0x2e, 0x8c, 0xcd, 0xae, 0x4c, 0x6e, 0x4a, 0x40, 0xd4, 0x21, 0xc3,
+  0x73, 0x99, 0x43, 0x0b, 0x23, 0x2b, 0x93, 0x6b, 0x7a, 0x23, 0x2b, 0x63,
+  0x9b, 0x12, 0x1c, 0x95, 0xc8, 0xf0, 0x5c, 0xe8, 0xf2, 0xe0, 0xca, 0x82,
+  0xdc, 0xdc, 0xde, 0xe8, 0xc2, 0xe8, 0xd2, 0xde, 0xdc, 0xe6, 0xa6, 0x04,
+  0x50, 0x31, 0x32, 0x3c, 0x17, 0x32, 0x3c, 0x39, 0xa8, 0xb0, 0x3c, 0xb6,
+  0xb7, 0x30, 0xb2, 0x20, 0x37, 0xb7, 0x37, 0xba, 0x30, 0xba, 0xb4, 0x37,
+  0xb7, 0xb9, 0x29, 0x41, 0x55, 0x87, 0x0c, 0xcf, 0xa5, 0xcc, 0x8d, 0x4e,
+  0x2e, 0x0f, 0xea, 0x2d, 0xcd, 0x8d, 0x6e, 0x6e, 0x8a, 0x90, 0x85, 0x01,
+  0x00, 0x00, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00,
+  0x33, 0x08, 0x80, 0x1c, 0xc4, 0xe1, 0x1c, 0x66, 0x14, 0x01, 0x3d, 0x88,
+  0x43, 0x38, 0x84, 0xc3, 0x8c, 0x42, 0x80, 0x07, 0x79, 0x78, 0x07, 0x73,
+  0x98, 0x71, 0x0c, 0xe6, 0x00, 0x0f, 0xed, 0x10, 0x0e, 0xf4, 0x80, 0x0e,
+  0x33, 0x0c, 0x42, 0x1e, 0xc2, 0xc1, 0x1d, 0xce, 0xa1, 0x1c, 0x66, 0x30,
+  0x05, 0x3d, 0x88, 0x43, 0x38, 0x84, 0x83, 0x1b, 0xcc, 0x03, 0x3d, 0xc8,
+  0x43, 0x3d, 0x8c, 0x03, 0x3d, 0xcc, 0x78, 0x8c, 0x74, 0x70, 0x07, 0x7b,
+  0x08, 0x07, 0x79, 0x48, 0x87, 0x70, 0x70, 0x07, 0x7a, 0x70, 0x03, 0x76,
+  0x78, 0x87, 0x70, 0x20, 0x87, 0x19, 0xcc, 0x11, 0x0e, 0xec, 0x90, 0x0e,
+  0xe1, 0x30, 0x0f, 0x6e, 0x30, 0x0f, 0xe3, 0xf0, 0x0e, 0xf0, 0x50, 0x0e,
+  0x33, 0x10, 0xc4, 0x1d, 0xde, 0x21, 0x1c, 0xd8, 0x21, 0x1d, 0xc2, 0x61,
+  0x1e, 0x66, 0x30, 0x89, 0x3b, 0xbc, 0x83, 0x3b, 0xd0, 0x43, 0x39, 0xb4,
+  0x03, 0x3c, 0xbc, 0x83, 0x3c, 0x84, 0x03, 0x3b, 0xcc, 0xf0, 0x14, 0x76,
+  0x60, 0x07, 0x7b, 0x68, 0x07, 0x37, 0x68, 0x87, 0x72, 0x68, 0x07, 0x37,
+  0x80, 0x87, 0x70, 0x90, 0x87, 0x70, 0x60, 0x07, 0x76, 0x28, 0x07, 0x76,
+  0xf8, 0x05, 0x76, 0x78, 0x87, 0x77, 0x80, 0x87, 0x5f, 0x08, 0x87, 0x71,
+  0x18, 0x87, 0x72, 0x98, 0x87, 0x79, 0x98, 0x81, 0x2c, 0xee, 0xf0, 0x0e,
+  0xee, 0xe0, 0x0e, 0xf5, 0xc0, 0x0e, 0xec, 0x30, 0x03, 0x62, 0xc8, 0xa1,
+  0x1c, 0xe4, 0xa1, 0x1c, 0xcc, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xdc, 0x61,
+  0x1c, 0xca, 0x21, 0x1c, 0xc4, 0x81, 0x1d, 0xca, 0x61, 0x06, 0xd6, 0x90,
+  0x43, 0x39, 0xc8, 0x43, 0x39, 0x98, 0x43, 0x39, 0xc8, 0x43, 0x39, 0xb8,
+  0xc3, 0x38, 0x94, 0x43, 0x38, 0x88, 0x03, 0x3b, 0x94, 0xc3, 0x2f, 0xbc,
+  0x83, 0x3c, 0xfc, 0x82, 0x3b, 0xd4, 0x03, 0x3b, 0xb0, 0xc3, 0x8c, 0xc8,
+  0x21, 0x07, 0x7c, 0x70, 0x03, 0x72, 0x10, 0x87, 0x73, 0x70, 0x03, 0x7b,
+  0x08, 0x07, 0x79, 0x60, 0x87, 0x70, 0xc8, 0x87, 0x77, 0xa8, 0x07, 0x7a,
+  0x98, 0x81, 0x3c, 0xe4, 0x80, 0x0f, 0x6e, 0x40, 0x0f, 0xe5, 0xd0, 0x0e,
+  0xf0, 0x00, 0x00, 0x00, 0x71, 0x20, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00,
+  0x15, 0xa0, 0x06, 0x81, 0xdf, 0x90, 0xfd, 0x9e, 0x97, 0xe7, 0x74, 0x64,
+  0x9a, 0x0e, 0x04, 0x66, 0x83, 0xd8, 0x2a, 0x32, 0x4d, 0x4f, 0xba, 0xcd,
+  0x6f, 0x20, 0xb0, 0x1a, 0xa4, 0xd3, 0xe5, 0x69, 0x71, 0x9d, 0x5e, 0x9e,
+  0x03, 0x81, 0x40, 0xad, 0x01, 0x30, 0xc3, 0xe5, 0x37, 0xce, 0x74, 0x20,
+  0x8d, 0xe1, 0x03, 0x26, 0x50, 0x0d, 0x97, 0xef, 0x3c, 0x7e, 0x04, 0x60,
+  0x2d, 0x47, 0x45, 0x11, 0xd1, 0x4c, 0x7e, 0x71, 0xdb, 0x00, 0x00, 0x00,
+  0x61, 0x20, 0x00, 0x00, 0x1a, 0x00, 0x00, 0x00, 0x13, 0x04, 0x41, 0x2c,
+  0x10, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x04, 0x8a, 0x56, 0x80,
+  0x60, 0x19, 0x10, 0x19, 0x01, 0x98, 0x01, 0xa0, 0x32, 0x07, 0x71, 0x5d,
+  0x54, 0x45, 0x64, 0x8c, 0x00, 0x04, 0x41, 0x10, 0xff, 0x28, 0x0e, 0x75,
+  0x04, 0x02, 0x00, 0x1c, 0xc0, 0x01, 0x00, 0x00, 0x23, 0x06, 0x05, 0x00,
+  0x82, 0x60, 0xd0, 0x5c, 0xc7, 0x1c, 0x03, 0x11, 0x1c, 0x34, 0x00, 0x40,
+  0x04, 0x00, 0xdb, 0x0c, 0x8d, 0x65, 0x0d, 0x1b, 0x10, 0x01, 0x01, 0x00,
+  0x18, 0x0e, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x16, 0x61, 0x00, 0xd3,
+  0x14, 0x21, 0x81, 0x41, 0x1c, 0x0f, 0x80, 0x2d, 0x0e, 0x30, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};

+ 0 - 81
FactoryCraft/CustomDX11API.cpp

@@ -1,81 +0,0 @@
-#include "CustomDX11API.h"
-
-#include <d3d11.h>
-#include <DXBuffer.h>
-#include <Shader.h>
-
-#include "CustomUIDX11PixelShader.h"
-#include "CustomUIDX11VertexShader.h"
-
-using namespace Framework;
-
-CustomDX11API::CustomDX11API()
-    : DirectX11(),
-      vertexShaderLightBufferIndex(-1)
-{}
-
-Framework::DX11VertexShader* CustomDX11API::initializeVertexShader(
-    unsigned char* byteCode, int size)
-{
-    D3D11_RASTERIZER_DESC rasterDesc;
-    ZeroMemory(&rasterDesc, sizeof(rasterDesc));
-    rasterDesc.AntialiasedLineEnable = false;
-    rasterDesc.CullMode = D3D11_CULL_NONE;
-    rasterDesc.DepthBiasClamp = 0.0f;
-    rasterDesc.DepthClipEnable = true;
-    rasterDesc.FillMode = D3D11_FILL_SOLID;
-    rasterDesc.FrontCounterClockwise = false;
-    rasterDesc.MultisampleEnable = false;
-    rasterDesc.ScissorEnable = false;
-    rasterDesc.SlopeScaledDepthBias = 0.0f;
-    ID3D11Device* device;
-    deviceLock.lock();
-    zContext()->GetDevice(&device);
-    device->CreateRasterizerState(&rasterDesc, &noCull);
-    deviceLock.unlock();
-
-    DX11VertexShader* shader = DirectX11::initializeVertexShader(
-        (unsigned char*)CustomUIDX11VertexShader,
-        sizeof(CustomUIDX11VertexShader));
-    vertexShaderLightBufferIndex = shader->getFirstUninitializedBufferIndex();
-    shader->createConstBuffer(20, vertexShaderLightBufferIndex);
-    char buffer[8];
-    *(int*)buffer = 0;
-    *(float*)(buffer + 4) = 1.f;
-    shader->fillConstBuffer(buffer, vertexShaderLightBufferIndex, 8);
-    return shader;
-}
-
-Framework::DX11PixelShader* CustomDX11API::initializePixelShader(
-    unsigned char* byteCode, int size)
-{
-    DX11PixelShader* shader = DirectX11::initializePixelShader(
-        (unsigned char*)CustomUIDX11PixelShader,
-        sizeof(CustomUIDX11PixelShader));
-    return shader;
-}
-
-void CustomDX11API::setVertexLightBuffer(Framework::DXBuffer* zBuffer)
-{
-    DX11StructuredBuffer* buffer = dynamic_cast<DX11StructuredBuffer*>(zBuffer);
-    if (buffer)
-    {
-        ID3D11ShaderResourceView* v[1];
-        v[0] = *buffer;
-        deviceLock.lock();
-        zContext()->VSSetShaderResources(0, 1, v);
-        deviceLock.unlock();
-    }
-}
-
-int CustomDX11API::getVertexShaderLightBufferIndex() const
-{
-    return vertexShaderLightBufferIndex;
-}
-
-void CustomDX11API::setCullBack(bool cull)
-{
-    deviceLock.lock();
-    zContext()->RSSetState(cull ? texturRS : noCull);
-    deviceLock.unlock();
-}

+ 0 - 25
FactoryCraft/CustomDX11API.h

@@ -1,25 +0,0 @@
-#pragma once
-
-#include <GraphicsApi.h>
-#
-
-class CustomDX11API : public Framework::DirectX11
-{
-private:
-    int vertexShaderLightBufferIndex;
-
-protected:
-    ID3D11RasterizerState* noCull;
-    Framework::DX11VertexShader* initializeVertexShader(
-        unsigned char* byteCode, int size) override;
-    Framework::DX11PixelShader* initializePixelShader(
-        unsigned char* byteCode, int size) override;
-
-public:
-    CustomDX11API();
-
-    void setVertexLightBuffer(Framework::DXBuffer* zBuffer);
-
-    int getVertexShaderLightBufferIndex() const;
-    void setCullBack(bool cull);
-};

+ 69 - 0
FactoryCraft/CustomDX12API.cpp

@@ -0,0 +1,69 @@
+#include "CustomDX12API.h"
+
+#include <d3d12.h>
+#include <DX12Buffer.h>
+#include <DX12Shader.h>
+
+#include "CustomClosestHitShader.h"
+#include "CustomMissShader.h"
+#include "CustomRayGenShader.h"
+
+using namespace Framework;
+
+CustomDX12API::CustomDX12API()
+    : DirectX12()
+{}
+
+void CustomDX12API::initializePipeline()
+{
+    DirectX12::initializePipeline();
+}
+
+void CustomDX12API::initializeGlobalDescriptorHeap()
+{
+    DirectX12::initializeGlobalDescriptorHeap();
+}
+
+void CustomDX12API::fillShaderBindingTable(
+    Framework::DX12ShaderBindingTable* zShaderBindingTable,
+    Framework::Model3D* zModel,
+    int objectIndex)
+{
+    DX12Shader* rayGenShader
+        = new DX12Shader(CustomRayGenShader, sizeof(CustomRayGenShader));
+    // RayGen from RayGen.hlsl
+    DX12ShaderSignature* rayGenSignature = new DX12ShaderSignature();
+    renderTargetInputOffset
+        = rayGenSignature->addRegisterUsageLinkedToShaderBindingTable(
+            DX12_SHADER_REGISTER_U_UNORDERED_ACCESS, 0);
+    rayGenSignature->addRegisterUsageLinkedToDescriptorHeap(
+        0, DX12_SHADER_REGISTER_U_UNORDERED_ACCESS, 1);
+    tlasInputOffset
+        = rayGenSignature->addRegisterUsageLinkedToShaderBindingTable(
+            DX12_SHADER_REGISTER_T_SHADER_RESOURCE, 0);
+    defaultRayGenerationShaderFunction = new DX12ShaderFunction(
+        "RayGen", rayGenSignature, DX12_SHADER_FUNCTION_TYPE_RAY_GEN);
+    rayGenShader->addFunction(defaultRayGenerationShaderFunction);
+    pipeline->addShader(rayGenShader);
+
+    DX12Shader* missShader
+        = new DX12Shader(CustomMissShader, sizeof(CustomMissShader));
+    // Miss from Miss.hlsl
+    missShader->addFunction(new DX12ShaderFunction(
+        "Miss", new DX12ShaderSignature(), DX12_SHADER_FUNCTION_TYPE_MISS));
+    pipeline->addShader(missShader);
+
+    DX12Shader* hitShader = new DX12Shader(
+        CustomClosestHitShader, sizeof(CustomClosestHitShader));
+    // ClosestHit from Hit.hlsl
+    DX12ShaderFunction* closestHitFunction
+        = new DX12ShaderFunction("ClosestHit",
+            new DX12ShaderSignature(),
+            DX12_SHADER_FUNCTION_TYPE_CLOSEST_HIT);
+    hitShader->addFunction(closestHitFunction);
+    pipeline->addShader(hitShader);
+
+    defaultHitGroup = new DX12ShaderHitGroup("HitGroup");
+    defaultHitGroup->setClosestHitShaderFunction(closestHitFunction);
+    pipeline->addHitGroup(defaultHitGroup);
+}

+ 16 - 0
FactoryCraft/CustomDX12API.h

@@ -0,0 +1,16 @@
+#pragma once
+
+#include <DX12GraphicsApi.h>
+
+class CustomDX12API : public Framework::DirectX12
+{
+public:
+    CustomDX12API();
+
+    void initializePipeline() override;
+    void initializeGlobalDescriptorHeap() override;
+    void fillShaderBindingTable(
+        Framework::DX12ShaderBindingTable* zShaderBindingTable,
+        Framework::Model3D* zModel,
+        int objectIndex) override;
+};

+ 304 - 0
FactoryCraft/CustomMissShader.h

@@ -0,0 +1,304 @@
+#if 0
+; shader debug name: C:\Users\kolja\Desktop\Kolja-Strohm-Games\Spiele
+; shader hash: 5552496376075f09aebd66c7bced3d04
+;
+; Buffer Definitions:
+;
+;
+; Resource Bindings:
+;
+; Name                                 Type  Format         Dim      ID      HLSL Bind  Count
+; ------------------------------ ---------- ------- ----------- ------- -------------- ------
+;
+target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64"
+target triple = "dxil-ms-dx"
+
+%struct.HitInfo = type { <4 x float> }
+
+@dx.nothing.a = internal constant [1 x i32] zeroinitializer
+
+; Function Attrs: nounwind
+define void @"\01?Miss@@YAXUHitInfo@@@Z"(%struct.HitInfo* noalias %payload) #0 {
+  %1 = load i32, i32* getelementptr inbounds ([1 x i32], [1 x i32]* @dx.nothing.a, i32 0, i32 0)
+  %2 = load i32, i32* getelementptr inbounds ([1 x i32], [1 x i32]* @dx.nothing.a, i32 0, i32 0)
+  %3 = getelementptr inbounds %struct.HitInfo, %struct.HitInfo* %payload, i32 0, i32 0
+  store <4 x float> <float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FE99999A0000000, float -1.000000e+00>, <4 x float>* %3
+  ret void
+}
+
+attributes #0 = { nounwind }
+
+!llvm.ident = !{!0}
+!dx.version = !{!1}
+!dx.valver = !{!1}
+!dx.shaderModel = !{!2}
+!dx.typeAnnotations = !{!3, !6}
+!dx.dxrPayloadAnnotations = !{!12}
+!dx.entryPoints = !{!15, !17}
+
+!0 = !{!"dxcoob 1.8.2502.11 (239921522)"}
+!1 = !{i32 1, i32 8}
+!2 = !{!"lib", i32 6, i32 8}
+!3 = !{i32 0, %struct.HitInfo undef, !4}
+!4 = !{i32 16, !5}
+!5 = !{i32 6, !"colorAndDistance", i32 3, i32 0, i32 7, i32 9, i32 13, i32 4}
+!6 = !{i32 1, void (%struct.HitInfo*)* @"\01?Miss@@YAXUHitInfo@@@Z", !7}
+!7 = !{!8, !10}
+!8 = !{i32 1, !9, !9}
+!9 = !{}
+!10 = !{i32 2, !11, !9}
+!11 = !{i32 4, !"SV_RayPayload"}
+!12 = !{i32 0, %struct.HitInfo undef, !13}
+!13 = !{!14}
+!14 = !{i32 0, i32 547}
+!15 = !{null, !"", null, null, !16}
+!16 = !{i32 0, i64 1}
+!17 = !{void (%struct.HitInfo*)* @"\01?Miss@@YAXUHitInfo@@@Z", !"\01?Miss@@YAXUHitInfo@@@Z", null, null, !18}
+!18 = !{i32 8, i32 11, i32 6, i32 16, i32 5, !19}
+!19 = !{i32 0}
+
+#endif
+
+const unsigned char CustomMissShader[] = {
+  0x44, 0x58, 0x42, 0x43, 0xf1, 0x69, 0xe6, 0xf2, 0x4e, 0x6f, 0xc0, 0x0d,
+  0xc1, 0x11, 0xbc, 0xbe, 0x75, 0xc1, 0x8e, 0xd3, 0x01, 0x00, 0x00, 0x00,
+  0x44, 0x0b, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00,
+  0x4c, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+  0xd4, 0x05, 0x00, 0x00, 0x14, 0x06, 0x00, 0x00, 0x30, 0x06, 0x00, 0x00,
+  0x53, 0x46, 0x49, 0x30, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x56, 0x45, 0x52, 0x53, 0x28, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, 0x12, 0x00, 0x00,
+  0x15, 0x00, 0x00, 0x00, 0x32, 0x33, 0x39, 0x39, 0x32, 0x31, 0x35, 0x32,
+  0x00, 0x31, 0x2e, 0x38, 0x2e, 0x32, 0x35, 0x30, 0x32, 0x2e, 0x31, 0x31,
+  0x00, 0x00, 0x00, 0x00, 0x52, 0x44, 0x41, 0x54, 0x7c, 0x00, 0x00, 0x00,
+  0x10, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
+  0x38, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
+  0x00, 0x01, 0x3f, 0x4d, 0x69, 0x73, 0x73, 0x40, 0x40, 0x59, 0x41, 0x58,
+  0x55, 0x48, 0x69, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x40, 0x40, 0x40, 0x5a,
+  0x00, 0x4d, 0x69, 0x73, 0x73, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+  0x3c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
+  0xff, 0xff, 0xff, 0xff, 0x0b, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x08, 0x00, 0x00, 0x63, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0xff, 0xff, 0xff, 0xff, 0x53, 0x54, 0x41, 0x54, 0xcc, 0x04, 0x00, 0x00,
+  0x68, 0x00, 0x06, 0x00, 0x33, 0x01, 0x00, 0x00, 0x44, 0x58, 0x49, 0x4c,
+  0x08, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xb4, 0x04, 0x00, 0x00,
+  0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00, 0x2a, 0x01, 0x00, 0x00,
+  0x0b, 0x82, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
+  0x07, 0x81, 0x23, 0x91, 0x41, 0xc8, 0x04, 0x49, 0x06, 0x10, 0x32, 0x39,
+  0x92, 0x01, 0x84, 0x0c, 0x25, 0x05, 0x08, 0x19, 0x1e, 0x04, 0x8b, 0x62,
+  0x80, 0x10, 0x45, 0x02, 0x42, 0x92, 0x0b, 0x42, 0x84, 0x10, 0x32, 0x14,
+  0x38, 0x08, 0x18, 0x4b, 0x0a, 0x32, 0x42, 0x88, 0x48, 0x90, 0x14, 0x20,
+  0x43, 0x46, 0x88, 0xa5, 0x00, 0x19, 0x32, 0x42, 0xe4, 0x48, 0x0e, 0x90,
+  0x11, 0x22, 0xc4, 0x50, 0x41, 0x51, 0x81, 0x8c, 0xe1, 0x83, 0xe5, 0x8a,
+  0x04, 0x21, 0x46, 0x06, 0x51, 0x18, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+  0x1b, 0x88, 0x20, 0x00, 0x92, 0x0d, 0x84, 0xf0, 0xff, 0xff, 0xff, 0xff,
+  0x03, 0x20, 0x01, 0x00, 0x49, 0x18, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+  0x13, 0x84, 0x40, 0x00, 0x89, 0x20, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00,
+  0x32, 0x22, 0x08, 0x09, 0x20, 0x64, 0x85, 0x04, 0x13, 0x22, 0xa4, 0x84,
+  0x04, 0x13, 0x22, 0xe3, 0x84, 0xa1, 0x90, 0x14, 0x12, 0x4c, 0x88, 0x8c,
+  0x0b, 0x84, 0x84, 0x4c, 0x10, 0x30, 0x73, 0x04, 0x60, 0x90, 0x01, 0x40,
+  0x31, 0x02, 0x30, 0x03, 0x30, 0x8c, 0x40, 0x10, 0xe7, 0x48, 0x53, 0x44,
+  0x09, 0x93, 0x1f, 0x22, 0x93, 0xd8, 0x14, 0x0e, 0x0a, 0x8a, 0xac, 0x08,
+  0x73, 0x84, 0x03, 0x01, 0x73, 0x04, 0xa0, 0x00, 0x13, 0x14, 0x72, 0xc0,
+  0x87, 0x74, 0x60, 0x87, 0x36, 0x68, 0x87, 0x79, 0x68, 0x03, 0x72, 0xc0,
+  0x87, 0x0d, 0xaf, 0x50, 0x0e, 0x6d, 0xd0, 0x0e, 0x7a, 0x50, 0x0e, 0x6d,
+  0x00, 0x0f, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d,
+  0x90, 0x0e, 0x71, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x78,
+  0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0x60, 0x07, 0x7a,
+  0x30, 0x07, 0x72, 0xd0, 0x06, 0xe9, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73,
+  0x20, 0x07, 0x6d, 0x90, 0x0e, 0x76, 0x40, 0x07, 0x7a, 0x60, 0x07, 0x74,
+  0xd0, 0x06, 0xe6, 0x10, 0x07, 0x76, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d,
+  0x60, 0x0e, 0x73, 0x20, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe6,
+  0x60, 0x07, 0x74, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x6d, 0xe0, 0x0e, 0x78,
+  0xa0, 0x07, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x76,
+  0x40, 0x07, 0x3a, 0x0f, 0x24, 0x90, 0x21, 0x23, 0x25, 0x40, 0x00, 0x1e,
+  0xa6, 0x31, 0xe4, 0x41, 0x80, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x20, 0x0b, 0x04, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
+  0x32, 0x1e, 0x98, 0x14, 0x19, 0x11, 0x4c, 0x90, 0x8c, 0x09, 0x26, 0x47,
+  0xc6, 0x04, 0x43, 0x82, 0x12, 0x28, 0x88, 0x11, 0x80, 0x62, 0x28, 0x90,
+  0x32, 0x28, 0x87, 0x92, 0x28, 0x8d, 0x42, 0x28, 0x82, 0x32, 0x46, 0x28,
+  0x8b, 0x52, 0xa0, 0x2d, 0x01, 0xb2, 0x19, 0x00, 0x8a, 0x11, 0x00, 0x00,
+  0x79, 0x18, 0x00, 0x00, 0x65, 0x00, 0x00, 0x00, 0x1a, 0x03, 0x4c, 0x90,
+  0x46, 0x02, 0x13, 0x44, 0x8f, 0x0c, 0x6f, 0xec, 0xed, 0x4d, 0x0c, 0x24,
+  0xc6, 0x05, 0xc7, 0x45, 0xa6, 0x06, 0x46, 0xc6, 0x25, 0x26, 0x06, 0x04,
+  0x45, 0x66, 0x26, 0x27, 0x47, 0x26, 0xa6, 0x46, 0x46, 0x26, 0x65, 0x43,
+  0x10, 0x4c, 0x10, 0x00, 0x61, 0x82, 0x00, 0x0c, 0x1b, 0x84, 0x81, 0x98,
+  0x20, 0x00, 0xc4, 0x06, 0xc1, 0x30, 0x38, 0xb0, 0xa5, 0x89, 0x4d, 0x10,
+  0x80, 0x62, 0xc3, 0x80, 0x24, 0xc4, 0x04, 0xc1, 0x88, 0x26, 0x08, 0x80,
+  0x41, 0x68, 0xec, 0x8d, 0xed, 0x4d, 0x2e, 0xc8, 0x8d, 0x8c, 0x28, 0x6d,
+  0x8e, 0x2e, 0xcc, 0x6d, 0xac, 0x6c, 0x82, 0x00, 0x1c, 0x13, 0x04, 0x00,
+  0x99, 0x20, 0x00, 0xc9, 0x04, 0x01, 0x50, 0x26, 0x08, 0xc0, 0xb2, 0x01,
+  0x49, 0x1a, 0xc7, 0x78, 0xa0, 0x48, 0xda, 0x20, 0x30, 0xd3, 0x86, 0xc1,
+  0x58, 0xa8, 0x09, 0x42, 0x12, 0x6c, 0x00, 0x36, 0x0c, 0xc3, 0x75, 0x4d,
+  0x10, 0x00, 0x86, 0xcd, 0x94, 0xd5, 0x97, 0x54, 0x58, 0x1e, 0x54, 0x58,
+  0x1e, 0xdb, 0x5b, 0x18, 0xd9, 0x06, 0x41, 0xd2, 0x36, 0x0c, 0xd9, 0x76,
+  0x6d, 0x10, 0x30, 0x6e, 0xc3, 0x30, 0x58, 0xdd, 0x04, 0x01, 0x68, 0x36,
+  0x08, 0xc6, 0xb7, 0x21, 0x00, 0x83, 0x0d, 0x83, 0xb1, 0x84, 0x01, 0x81,
+  0x09, 0xc2, 0x02, 0x6d, 0x10, 0x0c, 0x32, 0xd8, 0x50, 0x00, 0x63, 0x00,
+  0x00, 0x65, 0xc0, 0x2b, 0xe0, 0xa7, 0x29, 0x6d, 0x6e, 0x0e, 0x08, 0x28,
+  0x2b, 0x08, 0xab, 0x0a, 0x29, 0x8d, 0x2e, 0xc9, 0xcd, 0xec, 0x0d, 0x08,
+  0x08, 0x48, 0x6b, 0x82, 0x00, 0x38, 0x13, 0x04, 0xe0, 0xd9, 0x10, 0x18,
+  0x1b, 0x0c, 0x02, 0x0d, 0x12, 0x26, 0x0d, 0xd4, 0x60, 0x43, 0x61, 0x9d,
+  0x01, 0x00, 0xac, 0x01, 0x8b, 0x34, 0xb7, 0x39, 0xba, 0xb9, 0x0d, 0x42,
+  0x1b, 0xa4, 0x41, 0x15, 0x36, 0x36, 0xbb, 0x36, 0x97, 0x34, 0xb2, 0x32,
+  0x37, 0xba, 0x29, 0x41, 0x50, 0x85, 0x0c, 0xcf, 0xc5, 0xae, 0x4c, 0x6e,
+  0x2e, 0xed, 0xcd, 0x6d, 0x4a, 0x40, 0x34, 0x21, 0xc3, 0x73, 0xb1, 0x0b,
+  0x63, 0xb3, 0x2b, 0x93, 0x9b, 0x12, 0x18, 0x75, 0xc8, 0xf0, 0x5c, 0xe6,
+  0xd0, 0xc2, 0xc8, 0xca, 0xe4, 0x9a, 0xde, 0xc8, 0xca, 0xd8, 0xa6, 0x04,
+  0x49, 0x25, 0x32, 0x3c, 0x17, 0xba, 0x3c, 0xb8, 0xb2, 0x20, 0x37, 0xb7,
+  0x37, 0xba, 0x30, 0xba, 0xb4, 0x37, 0xb7, 0xb9, 0x29, 0x02, 0xd5, 0x15,
+  0x23, 0xc3, 0x73, 0x21, 0xc3, 0x93, 0x83, 0x0a, 0xcb, 0x63, 0x7b, 0x0b,
+  0x23, 0x0b, 0x72, 0x73, 0x7b, 0xa3, 0x0b, 0xa3, 0x4b, 0x7b, 0x73, 0x9b,
+  0x9b, 0x12, 0x84, 0x41, 0x1d, 0x32, 0x3c, 0x97, 0x32, 0x37, 0x3a, 0xb9,
+  0x3c, 0xa8, 0xb7, 0x34, 0x37, 0xba, 0xb9, 0x29, 0x42, 0x19, 0xac, 0x41,
+  0x17, 0x32, 0x3c, 0x97, 0xb1, 0xb7, 0x3a, 0x37, 0xba, 0x32, 0xb9, 0xb9,
+  0x29, 0x41, 0x1b, 0x00, 0x79, 0x18, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00,
+  0x33, 0x08, 0x80, 0x1c, 0xc4, 0xe1, 0x1c, 0x66, 0x14, 0x01, 0x3d, 0x88,
+  0x43, 0x38, 0x84, 0xc3, 0x8c, 0x42, 0x80, 0x07, 0x79, 0x78, 0x07, 0x73,
+  0x98, 0x71, 0x0c, 0xe6, 0x00, 0x0f, 0xed, 0x10, 0x0e, 0xf4, 0x80, 0x0e,
+  0x33, 0x0c, 0x42, 0x1e, 0xc2, 0xc1, 0x1d, 0xce, 0xa1, 0x1c, 0x66, 0x30,
+  0x05, 0x3d, 0x88, 0x43, 0x38, 0x84, 0x83, 0x1b, 0xcc, 0x03, 0x3d, 0xc8,
+  0x43, 0x3d, 0x8c, 0x03, 0x3d, 0xcc, 0x78, 0x8c, 0x74, 0x70, 0x07, 0x7b,
+  0x08, 0x07, 0x79, 0x48, 0x87, 0x70, 0x70, 0x07, 0x7a, 0x70, 0x03, 0x76,
+  0x78, 0x87, 0x70, 0x20, 0x87, 0x19, 0xcc, 0x11, 0x0e, 0xec, 0x90, 0x0e,
+  0xe1, 0x30, 0x0f, 0x6e, 0x30, 0x0f, 0xe3, 0xf0, 0x0e, 0xf0, 0x50, 0x0e,
+  0x33, 0x10, 0xc4, 0x1d, 0xde, 0x21, 0x1c, 0xd8, 0x21, 0x1d, 0xc2, 0x61,
+  0x1e, 0x66, 0x30, 0x89, 0x3b, 0xbc, 0x83, 0x3b, 0xd0, 0x43, 0x39, 0xb4,
+  0x03, 0x3c, 0xbc, 0x83, 0x3c, 0x84, 0x03, 0x3b, 0xcc, 0xf0, 0x14, 0x76,
+  0x60, 0x07, 0x7b, 0x68, 0x07, 0x37, 0x68, 0x87, 0x72, 0x68, 0x07, 0x37,
+  0x80, 0x87, 0x70, 0x90, 0x87, 0x70, 0x60, 0x07, 0x76, 0x28, 0x07, 0x76,
+  0xf8, 0x05, 0x76, 0x78, 0x87, 0x77, 0x80, 0x87, 0x5f, 0x08, 0x87, 0x71,
+  0x18, 0x87, 0x72, 0x98, 0x87, 0x79, 0x98, 0x81, 0x2c, 0xee, 0xf0, 0x0e,
+  0xee, 0xe0, 0x0e, 0xf5, 0xc0, 0x0e, 0xec, 0x30, 0x03, 0x62, 0xc8, 0xa1,
+  0x1c, 0xe4, 0xa1, 0x1c, 0xcc, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xdc, 0x61,
+  0x1c, 0xca, 0x21, 0x1c, 0xc4, 0x81, 0x1d, 0xca, 0x61, 0x06, 0xd6, 0x90,
+  0x43, 0x39, 0xc8, 0x43, 0x39, 0x98, 0x43, 0x39, 0xc8, 0x43, 0x39, 0xb8,
+  0xc3, 0x38, 0x94, 0x43, 0x38, 0x88, 0x03, 0x3b, 0x94, 0xc3, 0x2f, 0xbc,
+  0x83, 0x3c, 0xfc, 0x82, 0x3b, 0xd4, 0x03, 0x3b, 0xb0, 0xc3, 0x8c, 0xc8,
+  0x21, 0x07, 0x7c, 0x70, 0x03, 0x72, 0x10, 0x87, 0x73, 0x70, 0x03, 0x7b,
+  0x08, 0x07, 0x79, 0x60, 0x87, 0x70, 0xc8, 0x87, 0x77, 0xa8, 0x07, 0x7a,
+  0x98, 0x81, 0x3c, 0xe4, 0x80, 0x0f, 0x6e, 0x40, 0x0f, 0xe5, 0xd0, 0x0e,
+  0xf0, 0x00, 0x00, 0x00, 0x71, 0x20, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00,
+  0x15, 0x70, 0x05, 0x7e, 0xcd, 0xf4, 0x7c, 0x0e, 0x04, 0x66, 0x83, 0xd8,
+  0x2a, 0x32, 0x4d, 0x4f, 0xba, 0xcd, 0x6f, 0x20, 0x10, 0xa8, 0x35, 0x00,
+  0x66, 0xb8, 0xfc, 0xc6, 0x99, 0x0e, 0xa4, 0x31, 0x7c, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x49, 0x4c, 0x44, 0x4e, 0x38, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x30, 0x00, 0x43, 0x3a, 0x5c, 0x55, 0x73, 0x65, 0x72, 0x73,
+  0x5c, 0x6b, 0x6f, 0x6c, 0x6a, 0x61, 0x5c, 0x44, 0x65, 0x73, 0x6b, 0x74,
+  0x6f, 0x70, 0x5c, 0x4b, 0x6f, 0x6c, 0x6a, 0x61, 0x2d, 0x53, 0x74, 0x72,
+  0x6f, 0x68, 0x6d, 0x2d, 0x47, 0x61, 0x6d, 0x65, 0x73, 0x5c, 0x53, 0x70,
+  0x69, 0x65, 0x6c, 0x65, 0x00, 0x00, 0x00, 0x00, 0x48, 0x41, 0x53, 0x48,
+  0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x52, 0x49, 0x63,
+  0x76, 0x07, 0x5f, 0x09, 0xae, 0xbd, 0x66, 0xc7, 0xbc, 0xed, 0x3d, 0x04,
+  0x44, 0x58, 0x49, 0x4c, 0x0c, 0x05, 0x00, 0x00, 0x68, 0x00, 0x06, 0x00,
+  0x43, 0x01, 0x00, 0x00, 0x44, 0x58, 0x49, 0x4c, 0x08, 0x01, 0x00, 0x00,
+  0x10, 0x00, 0x00, 0x00, 0xf4, 0x04, 0x00, 0x00, 0x42, 0x43, 0xc0, 0xde,
+  0x21, 0x0c, 0x00, 0x00, 0x3a, 0x01, 0x00, 0x00, 0x0b, 0x82, 0x20, 0x00,
+  0x02, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x07, 0x81, 0x23, 0x91,
+  0x41, 0xc8, 0x04, 0x49, 0x06, 0x10, 0x32, 0x39, 0x92, 0x01, 0x84, 0x0c,
+  0x25, 0x05, 0x08, 0x19, 0x1e, 0x04, 0x8b, 0x62, 0x80, 0x10, 0x45, 0x02,
+  0x42, 0x92, 0x0b, 0x42, 0x84, 0x10, 0x32, 0x14, 0x38, 0x08, 0x18, 0x4b,
+  0x0a, 0x32, 0x42, 0x88, 0x48, 0x90, 0x14, 0x20, 0x43, 0x46, 0x88, 0xa5,
+  0x00, 0x19, 0x32, 0x42, 0xe4, 0x48, 0x0e, 0x90, 0x11, 0x22, 0xc4, 0x50,
+  0x41, 0x51, 0x81, 0x8c, 0xe1, 0x83, 0xe5, 0x8a, 0x04, 0x21, 0x46, 0x06,
+  0x51, 0x18, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1b, 0x88, 0x20, 0x00,
+  0x92, 0x0d, 0x84, 0xf0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x20, 0x01, 0x00,
+  0x49, 0x18, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x13, 0x84, 0x40, 0x00,
+  0x89, 0x20, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x32, 0x22, 0x08, 0x09,
+  0x20, 0x64, 0x85, 0x04, 0x13, 0x22, 0xa4, 0x84, 0x04, 0x13, 0x22, 0xe3,
+  0x84, 0xa1, 0x90, 0x14, 0x12, 0x4c, 0x88, 0x8c, 0x0b, 0x84, 0x84, 0x4c,
+  0x10, 0x38, 0x73, 0x04, 0x60, 0x90, 0x01, 0x40, 0x31, 0x02, 0x30, 0x03,
+  0x30, 0x8c, 0x40, 0x10, 0xe7, 0x48, 0x53, 0x44, 0x09, 0x93, 0x1f, 0x22,
+  0x93, 0xd8, 0x14, 0x0e, 0x0a, 0x8a, 0xac, 0x08, 0x73, 0x84, 0x03, 0x01,
+  0x73, 0x04, 0xa0, 0x40, 0x40, 0x05, 0x00, 0x00, 0x13, 0x14, 0x72, 0xc0,
+  0x87, 0x74, 0x60, 0x87, 0x36, 0x68, 0x87, 0x79, 0x68, 0x03, 0x72, 0xc0,
+  0x87, 0x0d, 0xaf, 0x50, 0x0e, 0x6d, 0xd0, 0x0e, 0x7a, 0x50, 0x0e, 0x6d,
+  0x00, 0x0f, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d,
+  0x90, 0x0e, 0x71, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x78,
+  0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0x60, 0x07, 0x7a,
+  0x30, 0x07, 0x72, 0xd0, 0x06, 0xe9, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x73,
+  0x20, 0x07, 0x6d, 0x90, 0x0e, 0x76, 0x40, 0x07, 0x7a, 0x60, 0x07, 0x74,
+  0xd0, 0x06, 0xe6, 0x10, 0x07, 0x76, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d,
+  0x60, 0x0e, 0x73, 0x20, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe6,
+  0x60, 0x07, 0x74, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x6d, 0xe0, 0x0e, 0x78,
+  0xa0, 0x07, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07, 0x76,
+  0x40, 0x07, 0x3a, 0x0f, 0x24, 0x90, 0x21, 0x23, 0x25, 0x40, 0x00, 0x1e,
+  0xa6, 0x31, 0xe4, 0x41, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x20, 0x0b, 0x04, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
+  0x32, 0x1e, 0x98, 0x14, 0x19, 0x11, 0x4c, 0x90, 0x8c, 0x09, 0x26, 0x47,
+  0xc6, 0x04, 0x43, 0x82, 0x12, 0x28, 0x88, 0x62, 0x18, 0x01, 0x28, 0x90,
+  0x32, 0x28, 0x87, 0x92, 0x28, 0x8d, 0x42, 0x28, 0x82, 0x32, 0x46, 0x28,
+  0x8b, 0x52, 0xa0, 0x2d, 0x01, 0xb2, 0x19, 0x00, 0x8a, 0x11, 0x00, 0x00,
+  0x79, 0x18, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x1a, 0x03, 0x4c, 0x90,
+  0x46, 0x02, 0x13, 0x44, 0x8f, 0x0c, 0x6f, 0xec, 0xed, 0x4d, 0x0c, 0x24,
+  0xc6, 0x05, 0xc7, 0x45, 0xa6, 0x06, 0x46, 0xc6, 0x25, 0x26, 0x06, 0x04,
+  0x45, 0x66, 0x26, 0x27, 0x47, 0x26, 0xa6, 0x46, 0x46, 0x26, 0x65, 0x43,
+  0x10, 0x4c, 0x10, 0x00, 0x61, 0x82, 0x00, 0x0c, 0x1b, 0x84, 0x81, 0xe0,
+  0xc0, 0x96, 0x26, 0x36, 0x41, 0x00, 0x88, 0x0d, 0x83, 0x71, 0x10, 0x13,
+  0x04, 0xa0, 0x98, 0x20, 0x18, 0xd1, 0x04, 0x01, 0x30, 0x08, 0x8d, 0xbd,
+  0xb1, 0xbd, 0xc9, 0x05, 0xb9, 0x91, 0x11, 0xa5, 0xcd, 0xd1, 0x85, 0xb9,
+  0x8d, 0x95, 0x4d, 0x10, 0x80, 0x63, 0x82, 0x00, 0x20, 0x13, 0x04, 0x20,
+  0x99, 0x20, 0x00, 0xca, 0x04, 0x01, 0x58, 0x36, 0x20, 0x07, 0xd3, 0x24,
+  0xce, 0x03, 0x45, 0x1b, 0x84, 0x45, 0xda, 0x30, 0x24, 0xca, 0x34, 0x41,
+  0x48, 0x82, 0x0d, 0xc0, 0x86, 0x61, 0xb0, 0xac, 0x09, 0x02, 0xc0, 0xb0,
+  0x99, 0xb2, 0xfa, 0x92, 0x0a, 0xcb, 0x83, 0x0a, 0xcb, 0x63, 0x7b, 0x0b,
+  0x23, 0xdb, 0x20, 0x44, 0xd9, 0x86, 0x01, 0xd3, 0xac, 0x0d, 0xc2, 0xb5,
+  0x6d, 0x18, 0x86, 0x8a, 0x9b, 0x20, 0x00, 0xcd, 0x06, 0x21, 0xf1, 0x36,
+  0x04, 0xdf, 0x86, 0x21, 0x51, 0xc0, 0x80, 0xc0, 0x04, 0x61, 0x81, 0x36,
+  0x08, 0xc9, 0x18, 0x6c, 0x28, 0x00, 0x31, 0x00, 0x00, 0x32, 0xe0, 0x15,
+  0xf0, 0xd3, 0x94, 0x36, 0x37, 0x07, 0x04, 0x94, 0x15, 0x84, 0x55, 0x85,
+  0x94, 0x46, 0x97, 0xe4, 0x66, 0xf6, 0x06, 0x04, 0x04, 0xa4, 0x35, 0x41,
+  0x00, 0x9c, 0x09, 0x02, 0xf0, 0x6c, 0x08, 0x92, 0x0d, 0x06, 0x71, 0x06,
+  0xc7, 0x82, 0x06, 0x69, 0xb0, 0xa1, 0xa8, 0xcc, 0x00, 0x00, 0xd4, 0xa0,
+  0x0a, 0x1b, 0x9b, 0x5d, 0x9b, 0x4b, 0x1a, 0x59, 0x99, 0x1b, 0xdd, 0x94,
+  0x20, 0xa8, 0x42, 0x86, 0xe7, 0x62, 0x57, 0x26, 0x37, 0x97, 0xf6, 0xe6,
+  0x36, 0x25, 0x20, 0x9a, 0x90, 0xe1, 0xb9, 0xd8, 0x85, 0xb1, 0xd9, 0x95,
+  0xc9, 0x4d, 0x09, 0x88, 0x3a, 0x64, 0x78, 0x2e, 0x73, 0x68, 0x61, 0x64,
+  0x65, 0x72, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x53, 0x82, 0xa3, 0x12, 0x19,
+  0x9e, 0x0b, 0x5d, 0x1e, 0x5c, 0x59, 0x90, 0x9b, 0xdb, 0x1b, 0x5d, 0x18,
+  0x5d, 0xda, 0x9b, 0xdb, 0xdc, 0x14, 0x61, 0xe2, 0x8a, 0x91, 0xe1, 0xb9,
+  0x90, 0xe1, 0xc9, 0x41, 0x85, 0xe5, 0xb1, 0xbd, 0x85, 0x91, 0x05, 0xb9,
+  0xb9, 0xbd, 0xd1, 0x85, 0xd1, 0xa5, 0xbd, 0xb9, 0xcd, 0x4d, 0x09, 0xc0,
+  0xa0, 0x0e, 0x19, 0x9e, 0x4b, 0x99, 0x1b, 0x9d, 0x5c, 0x1e, 0xd4, 0x5b,
+  0x9a, 0x1b, 0xdd, 0xdc, 0x14, 0x81, 0x0c, 0xd4, 0x00, 0x00, 0x00, 0x00,
+  0x79, 0x18, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x33, 0x08, 0x80, 0x1c,
+  0xc4, 0xe1, 0x1c, 0x66, 0x14, 0x01, 0x3d, 0x88, 0x43, 0x38, 0x84, 0xc3,
+  0x8c, 0x42, 0x80, 0x07, 0x79, 0x78, 0x07, 0x73, 0x98, 0x71, 0x0c, 0xe6,
+  0x00, 0x0f, 0xed, 0x10, 0x0e, 0xf4, 0x80, 0x0e, 0x33, 0x0c, 0x42, 0x1e,
+  0xc2, 0xc1, 0x1d, 0xce, 0xa1, 0x1c, 0x66, 0x30, 0x05, 0x3d, 0x88, 0x43,
+  0x38, 0x84, 0x83, 0x1b, 0xcc, 0x03, 0x3d, 0xc8, 0x43, 0x3d, 0x8c, 0x03,
+  0x3d, 0xcc, 0x78, 0x8c, 0x74, 0x70, 0x07, 0x7b, 0x08, 0x07, 0x79, 0x48,
+  0x87, 0x70, 0x70, 0x07, 0x7a, 0x70, 0x03, 0x76, 0x78, 0x87, 0x70, 0x20,
+  0x87, 0x19, 0xcc, 0x11, 0x0e, 0xec, 0x90, 0x0e, 0xe1, 0x30, 0x0f, 0x6e,
+  0x30, 0x0f, 0xe3, 0xf0, 0x0e, 0xf0, 0x50, 0x0e, 0x33, 0x10, 0xc4, 0x1d,
+  0xde, 0x21, 0x1c, 0xd8, 0x21, 0x1d, 0xc2, 0x61, 0x1e, 0x66, 0x30, 0x89,
+  0x3b, 0xbc, 0x83, 0x3b, 0xd0, 0x43, 0x39, 0xb4, 0x03, 0x3c, 0xbc, 0x83,
+  0x3c, 0x84, 0x03, 0x3b, 0xcc, 0xf0, 0x14, 0x76, 0x60, 0x07, 0x7b, 0x68,
+  0x07, 0x37, 0x68, 0x87, 0x72, 0x68, 0x07, 0x37, 0x80, 0x87, 0x70, 0x90,
+  0x87, 0x70, 0x60, 0x07, 0x76, 0x28, 0x07, 0x76, 0xf8, 0x05, 0x76, 0x78,
+  0x87, 0x77, 0x80, 0x87, 0x5f, 0x08, 0x87, 0x71, 0x18, 0x87, 0x72, 0x98,
+  0x87, 0x79, 0x98, 0x81, 0x2c, 0xee, 0xf0, 0x0e, 0xee, 0xe0, 0x0e, 0xf5,
+  0xc0, 0x0e, 0xec, 0x30, 0x03, 0x62, 0xc8, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c,
+  0xcc, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xdc, 0x61, 0x1c, 0xca, 0x21, 0x1c,
+  0xc4, 0x81, 0x1d, 0xca, 0x61, 0x06, 0xd6, 0x90, 0x43, 0x39, 0xc8, 0x43,
+  0x39, 0x98, 0x43, 0x39, 0xc8, 0x43, 0x39, 0xb8, 0xc3, 0x38, 0x94, 0x43,
+  0x38, 0x88, 0x03, 0x3b, 0x94, 0xc3, 0x2f, 0xbc, 0x83, 0x3c, 0xfc, 0x82,
+  0x3b, 0xd4, 0x03, 0x3b, 0xb0, 0xc3, 0x8c, 0xc8, 0x21, 0x07, 0x7c, 0x70,
+  0x03, 0x72, 0x10, 0x87, 0x73, 0x70, 0x03, 0x7b, 0x08, 0x07, 0x79, 0x60,
+  0x87, 0x70, 0xc8, 0x87, 0x77, 0xa8, 0x07, 0x7a, 0x98, 0x81, 0x3c, 0xe4,
+  0x80, 0x0f, 0x6e, 0x40, 0x0f, 0xe5, 0xd0, 0x0e, 0xf0, 0x00, 0x00, 0x00,
+  0x71, 0x20, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x15, 0x70, 0x05, 0x7e,
+  0xcd, 0xf4, 0x7c, 0x0e, 0x04, 0x66, 0x83, 0xd8, 0x2a, 0x32, 0x4d, 0x4f,
+  0xba, 0xcd, 0x6f, 0x20, 0x10, 0xa8, 0x35, 0x00, 0x66, 0xb8, 0xfc, 0xc6,
+  0x99, 0x0e, 0xa4, 0x31, 0x7c, 0x00, 0x00, 0x00, 0x61, 0x20, 0x00, 0x00,
+  0x14, 0x00, 0x00, 0x00, 0x13, 0x04, 0x41, 0x2c, 0x10, 0x00, 0x00, 0x00,
+  0x08, 0x00, 0x00, 0x00, 0x54, 0x63, 0x11, 0xad, 0x39, 0xe7, 0xe4, 0xd7,
+  0x9a, 0x73, 0x4e, 0x7e, 0xad, 0x39, 0xe7, 0xf4, 0x07, 0x82, 0x20, 0x88,
+  0xff, 0x02, 0xf1, 0x50, 0x47, 0x20, 0x00, 0x40, 0x01, 0x14, 0x00, 0x00,
+  0x14, 0x00, 0x20, 0x01, 0xc0, 0xb6, 0xa1, 0x98, 0xa6, 0x61, 0x03, 0x22,
+  0x28, 0x00, 0x00, 0xc3, 0x81, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+  0x36, 0x71, 0x3c, 0x00, 0xb6, 0x38, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00
+};

+ 468 - 0
FactoryCraft/CustomRayGenShader.h

@@ -0,0 +1,468 @@
+#if 0
+;
+; Note: shader requires additional functionality:
+;       Typed UAV Load Additional Formats
+;
+; shader debug name: C:\Users\kolja\Desktop\Kolja-Strohm-Games\Spiele
+; shader hash: ca1c0efee56faf469ccff1b426e700b3
+;
+; Buffer Definitions:
+;
+;
+; Resource Bindings:
+;
+; Name                                 Type  Format         Dim      ID      HLSL Bind  Count
+; ------------------------------ ---------- ------- ----------- ------- -------------- ------
+; gOutput                               UAV     f32          2d      U0             u0     1
+; guiTexture                            UAV     f32          2d      U1             u1     1
+;
+target datalayout = "e-m:e-p:32:32-i1:32-i8:32-i16:32-i32:32-i64:64-f16:32-f32:32-f64:64-n8:16:32:64"
+target triple = "dxil-ms-dx"
+
+%dx.types.Handle = type { i8* }
+%dx.types.ResourceProperties = type { i32, i32 }
+%dx.types.ResRet.f32 = type { float, float, float, float, i32 }
+%"class.RWTexture2D<vector<float, 4> >" = type { <4 x float> }
+%struct.HitInfo = type { <4 x float> }
+
+@"\01?gOutput@@3V?$RWTexture2D@V?$vector@M$03@@@@A" = external constant %dx.types.Handle, align 4
+@"\01?guiTexture@@3V?$RWTexture2D@V?$vector@M$03@@@@A" = external constant %dx.types.Handle, align 4
+@dx.nothing.a = internal constant [1 x i32] zeroinitializer
+
+; Function Attrs: nounwind
+define void @"\01?RayGen@@YAXXZ"() #0 {
+  %1 = load %dx.types.Handle, %dx.types.Handle* @"\01?guiTexture@@3V?$RWTexture2D@V?$vector@M$03@@@@A"
+  %2 = load %dx.types.Handle, %dx.types.Handle* @"\01?gOutput@@3V?$RWTexture2D@V?$vector@M$03@@@@A"
+  %3 = load i32, i32* getelementptr inbounds ([1 x i32], [1 x i32]* @dx.nothing.a, i32 0, i32 0)
+  %4 = call i32 @dx.op.dispatchRaysIndex.i32(i32 145, i8 0)  ; DispatchRaysIndex(col)
+  %5 = call i32 @dx.op.dispatchRaysIndex.i32(i32 145, i8 1)  ; DispatchRaysIndex(col)
+  %6 = load i32, i32* getelementptr inbounds ([1 x i32], [1 x i32]* @dx.nothing.a, i32 0, i32 0)
+  %7 = load i32, i32* getelementptr inbounds ([1 x i32], [1 x i32]* @dx.nothing.a, i32 0, i32 0)
+  %8 = call %dx.types.Handle @dx.op.createHandleForLib.dx.types.Handle(i32 160, %dx.types.Handle %1)  ; CreateHandleForLib(Resource)
+  %9 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %8, %dx.types.ResourceProperties { i32 4098, i32 1033 })  ; AnnotateHandle(res,props)  resource: RWTexture2D<4xF32>
+  %10 = call %dx.types.ResRet.f32 @dx.op.textureLoad.f32(i32 66, %dx.types.Handle %9, i32 undef, i32 %4, i32 %5, i32 undef, i32 undef, i32 undef, i32 undef)  ; TextureLoad(srv,mipLevelOrSampleCount,coord0,coord1,coord2,offset0,offset1,offset2)
+  %11 = extractvalue %dx.types.ResRet.f32 %10, 0
+  %12 = extractvalue %dx.types.ResRet.f32 %10, 1
+  %13 = extractvalue %dx.types.ResRet.f32 %10, 2
+  %14 = extractvalue %dx.types.ResRet.f32 %10, 3
+  %15 = load i32, i32* getelementptr inbounds ([1 x i32], [1 x i32]* @dx.nothing.a, i32 0, i32 0)
+  %16 = fsub fast float 1.000000e+00, %14
+  %17 = fmul fast float 0x3FECCCCCC0000000, %16
+  %18 = fmul fast float 0x3FE3333340000000, %16
+  %19 = fmul fast float 0x3FC99999A0000000, %16
+  %20 = fmul fast float %11, %14
+  %21 = fmul fast float %12, %14
+  %22 = fmul fast float %13, %14
+  %23 = fadd fast float %17, %20
+  %24 = fadd fast float %18, %21
+  %25 = fadd fast float %19, %22
+  %26 = call %dx.types.Handle @dx.op.createHandleForLib.dx.types.Handle(i32 160, %dx.types.Handle %2)  ; CreateHandleForLib(Resource)
+  %27 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %26, %dx.types.ResourceProperties { i32 4098, i32 1033 })  ; AnnotateHandle(res,props)  resource: RWTexture2D<4xF32>
+  call void @dx.op.textureStore.f32(i32 67, %dx.types.Handle %27, i32 %4, i32 %5, i32 undef, float %23, float %24, float %25, float 1.000000e+00, i8 15)  ; TextureStore(srv,coord0,coord1,coord2,value0,value1,value2,value3,mask)
+  %28 = call %dx.types.Handle @dx.op.createHandleForLib.dx.types.Handle(i32 160, %dx.types.Handle %2)  ; CreateHandleForLib(Resource)
+  %29 = call %dx.types.Handle @dx.op.annotateHandle(i32 216, %dx.types.Handle %28, %dx.types.ResourceProperties { i32 4098, i32 1033 })  ; AnnotateHandle(res,props)  resource: RWTexture2D<4xF32>
+  call void @dx.op.textureStore.f32(i32 67, %dx.types.Handle %29, i32 %4, i32 %5, i32 undef, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, i8 15)  ; TextureStore(srv,coord0,coord1,coord2,value0,value1,value2,value3,mask)
+  %30 = load i32, i32* getelementptr inbounds ([1 x i32], [1 x i32]* @dx.nothing.a, i32 0, i32 0)
+  ret void
+}
+
+; Function Attrs: nounwind readnone
+declare i32 @dx.op.dispatchRaysIndex.i32(i32, i8) #1
+
+; Function Attrs: nounwind readonly
+declare %dx.types.ResRet.f32 @dx.op.textureLoad.f32(i32, %dx.types.Handle, i32, i32, i32, i32, i32, i32, i32) #2
+
+; Function Attrs: nounwind
+declare void @dx.op.textureStore.f32(i32, %dx.types.Handle, i32, i32, i32, float, float, float, float, i8) #0
+
+; Function Attrs: nounwind readnone
+declare %dx.types.Handle @dx.op.annotateHandle(i32, %dx.types.Handle, %dx.types.ResourceProperties) #1
+
+; Function Attrs: nounwind readonly
+declare %dx.types.Handle @dx.op.createHandleForLib.dx.types.Handle(i32, %dx.types.Handle) #2
+
+attributes #0 = { nounwind }
+attributes #1 = { nounwind readnone }
+attributes #2 = { nounwind readonly }
+
+!llvm.ident = !{!0}
+!dx.version = !{!1}
+!dx.valver = !{!1}
+!dx.shaderModel = !{!2}
+!dx.resources = !{!3}
+!dx.typeAnnotations = !{!8}
+!dx.dxrPayloadAnnotations = !{!12}
+!dx.entryPoints = !{!15, !17}
+
+!0 = !{!"dxcoob 1.8.2502.11 (239921522)"}
+!1 = !{i32 1, i32 8}
+!2 = !{!"lib", i32 6, i32 8}
+!3 = !{null, !4, null, null}
+!4 = !{!5, !7}
+!5 = !{i32 0, %"class.RWTexture2D<vector<float, 4> >"* bitcast (%dx.types.Handle* @"\01?gOutput@@3V?$RWTexture2D@V?$vector@M$03@@@@A" to %"class.RWTexture2D<vector<float, 4> >"*), !"gOutput", i32 0, i32 0, i32 1, i32 2, i1 false, i1 false, i1 false, !6}
+!6 = !{i32 0, i32 9}
+!7 = !{i32 1, %"class.RWTexture2D<vector<float, 4> >"* bitcast (%dx.types.Handle* @"\01?guiTexture@@3V?$RWTexture2D@V?$vector@M$03@@@@A" to %"class.RWTexture2D<vector<float, 4> >"*), !"guiTexture", i32 0, i32 1, i32 1, i32 2, i1 false, i1 false, i1 false, !6}
+!8 = !{i32 1, void ()* @"\01?RayGen@@YAXXZ", !9}
+!9 = !{!10}
+!10 = !{i32 1, !11, !11}
+!11 = !{}
+!12 = !{i32 0, %struct.HitInfo undef, !13}
+!13 = !{!14}
+!14 = !{i32 0, i32 547}
+!15 = !{null, !"", null, !3, !16}
+!16 = !{i32 0, i64 8589942785}
+!17 = !{void ()* @"\01?RayGen@@YAXXZ", !"\01?RayGen@@YAXXZ", null, null, !18}
+!18 = !{i32 8, i32 7, i32 5, !19}
+!19 = !{i32 0}
+
+#endif
+
+const unsigned char CustomRayGenShader[] = {
+  0x44, 0x58, 0x42, 0x43, 0x6b, 0x6d, 0xb7, 0x44, 0xf2, 0xc7, 0xe0, 0x1e,
+  0xa8, 0xcf, 0x3b, 0x71, 0xb9, 0x75, 0xe7, 0x49, 0x01, 0x00, 0x00, 0x00,
+  0x40, 0x10, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00,
+  0x4c, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x78, 0x01, 0x00, 0x00,
+  0x3c, 0x08, 0x00, 0x00, 0x7c, 0x08, 0x00, 0x00, 0x98, 0x08, 0x00, 0x00,
+  0x53, 0x46, 0x49, 0x30, 0x08, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x56, 0x45, 0x52, 0x53, 0x28, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, 0x12, 0x00, 0x00,
+  0x15, 0x00, 0x00, 0x00, 0x32, 0x33, 0x39, 0x39, 0x32, 0x31, 0x35, 0x32,
+  0x00, 0x31, 0x2e, 0x38, 0x2e, 0x32, 0x35, 0x30, 0x32, 0x2e, 0x31, 0x31,
+  0x00, 0x00, 0x00, 0x00, 0x52, 0x44, 0x41, 0x54, 0xf4, 0x00, 0x00, 0x00,
+  0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00,
+  0x4c, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x67, 0x4f, 0x75,
+  0x74, 0x70, 0x75, 0x74, 0x00, 0x67, 0x75, 0x69, 0x54, 0x65, 0x78, 0x74,
+  0x75, 0x72, 0x65, 0x00, 0x01, 0x3f, 0x52, 0x61, 0x79, 0x47, 0x65, 0x6e,
+  0x40, 0x40, 0x59, 0x41, 0x58, 0x58, 0x5a, 0x00, 0x52, 0x61, 0x79, 0x47,
+  0x65, 0x6e, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00,
+  0x02, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+  0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x04, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+  0x34, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x63, 0x00, 0x07, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00,
+  0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x01, 0x00, 0x00, 0x00, 0x53, 0x54, 0x41, 0x54, 0xbc, 0x06, 0x00, 0x00,
+  0x68, 0x00, 0x06, 0x00, 0xaf, 0x01, 0x00, 0x00, 0x44, 0x58, 0x49, 0x4c,
+  0x08, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xa4, 0x06, 0x00, 0x00,
+  0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00, 0xa6, 0x01, 0x00, 0x00,
+  0x0b, 0x82, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
+  0x07, 0x81, 0x23, 0x91, 0x41, 0xc8, 0x04, 0x49, 0x06, 0x10, 0x32, 0x39,
+  0x92, 0x01, 0x84, 0x0c, 0x25, 0x05, 0x08, 0x19, 0x1e, 0x04, 0x8b, 0x62,
+  0x80, 0x14, 0x45, 0x02, 0x42, 0x92, 0x0b, 0x42, 0xa4, 0x10, 0x32, 0x14,
+  0x38, 0x08, 0x18, 0x4b, 0x0a, 0x32, 0x52, 0x88, 0x48, 0x90, 0x14, 0x20,
+  0x43, 0x46, 0x88, 0xa5, 0x00, 0x19, 0x32, 0x42, 0xe4, 0x48, 0x0e, 0x90,
+  0x91, 0x22, 0xc4, 0x50, 0x41, 0x51, 0x81, 0x8c, 0xe1, 0x83, 0xe5, 0x8a,
+  0x04, 0x29, 0x46, 0x06, 0x51, 0x18, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
+  0x1b, 0x88, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x40, 0xda, 0x60, 0x08,
+  0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x12, 0x40, 0x6d, 0x30, 0x86, 0xff,
+  0xff, 0xff, 0xff, 0x1f, 0x00, 0x09, 0xa8, 0x00, 0x49, 0x18, 0x00, 0x00,
+  0x03, 0x00, 0x00, 0x00, 0x13, 0x82, 0x60, 0x42, 0x20, 0x4c, 0x08, 0x06,
+  0x00, 0x00, 0x00, 0x00, 0x89, 0x20, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00,
+  0x32, 0x22, 0x48, 0x09, 0x20, 0x64, 0x85, 0x04, 0x93, 0x22, 0xa4, 0x84,
+  0x04, 0x93, 0x22, 0xe3, 0x84, 0xa1, 0x90, 0x14, 0x12, 0x4c, 0x8a, 0x8c,
+  0x0b, 0x84, 0xa4, 0x4c, 0x10, 0x78, 0x73, 0x04, 0x08, 0x81, 0x7b, 0x86,
+  0xcb, 0x9f, 0xb0, 0x87, 0x90, 0xfc, 0x10, 0x68, 0x86, 0x85, 0x40, 0x41,
+  0x20, 0x31, 0x47, 0x00, 0x06, 0x19, 0x40, 0xa8, 0x8c, 0x00, 0x94, 0xe0,
+  0x10, 0x2a, 0x03, 0x21, 0x80, 0xd4, 0x0c, 0xc0, 0x4d, 0xc3, 0xe5, 0x4f,
+  0xd8, 0x43, 0x48, 0xfe, 0x4a, 0x48, 0x2b, 0x31, 0xf9, 0xc5, 0x6d, 0xa3,
+  0x82, 0x31, 0xc6, 0x48, 0x51, 0x1a, 0x11, 0x84, 0x10, 0x42, 0x08, 0x21,
+  0x57, 0x96, 0x43, 0x04, 0x21, 0x84, 0x31, 0xc6, 0x00, 0xc1, 0xdb, 0x86,
+  0xcb, 0x9f, 0xb0, 0x87, 0x90, 0xfc, 0x95, 0x90, 0x1c, 0x2a, 0x12, 0x88,
+  0x34, 0x72, 0x1e, 0x22, 0x9a, 0x10, 0x42, 0x42, 0x02, 0x21, 0x85, 0x10,
+  0x44, 0x48, 0x9a, 0x65, 0x10, 0x44, 0x50, 0x1d, 0x08, 0x18, 0x46, 0x20,
+  0x98, 0x99, 0xc8, 0x60, 0x1c, 0xd8, 0x21, 0x1c, 0xe6, 0x61, 0x1e, 0xdc,
+  0x40, 0x16, 0x6e, 0x81, 0x16, 0xca, 0x01, 0x1f, 0xe8, 0xa1, 0x1e, 0xe4,
+  0xa1, 0x1c, 0xe4, 0x80, 0x14, 0xf8, 0xc0, 0x1e, 0xca, 0x61, 0x1c, 0xe8,
+  0xe1, 0x1d, 0xe4, 0x81, 0x0f, 0xcc, 0x81, 0x1d, 0xde, 0x21, 0x1c, 0xe8,
+  0x81, 0x0d, 0xc0, 0x80, 0x0e, 0xfc, 0x00, 0x0c, 0xfc, 0x00, 0x05, 0x98,
+  0xf2, 0x1c, 0x41, 0x70, 0x8e, 0x34, 0x45, 0x94, 0x30, 0xf9, 0x21, 0x32,
+  0x89, 0x4d, 0xe1, 0xa0, 0x00, 0xcf, 0x11, 0x80, 0x02, 0x00, 0x00, 0x00,
+  0x13, 0x14, 0x72, 0xc0, 0x87, 0x74, 0x60, 0x87, 0x36, 0x68, 0x87, 0x79,
+  0x68, 0x03, 0x72, 0xc0, 0x87, 0x0d, 0xaf, 0x50, 0x0e, 0x6d, 0xd0, 0x0e,
+  0x7a, 0x50, 0x0e, 0x6d, 0x00, 0x0f, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07,
+  0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0xa0, 0x07, 0x73, 0x20, 0x07,
+  0x6d, 0x90, 0x0e, 0x78, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e,
+  0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe9, 0x30, 0x07,
+  0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x76, 0x40, 0x07,
+  0x7a, 0x60, 0x07, 0x74, 0xd0, 0x06, 0xe6, 0x10, 0x07, 0x76, 0xa0, 0x07,
+  0x73, 0x20, 0x07, 0x6d, 0x60, 0x0e, 0x73, 0x20, 0x07, 0x7a, 0x30, 0x07,
+  0x72, 0xd0, 0x06, 0xe6, 0x60, 0x07, 0x74, 0xa0, 0x07, 0x76, 0x40, 0x07,
+  0x6d, 0xe0, 0x0e, 0x78, 0xa0, 0x07, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07,
+  0x72, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x3a, 0x0f, 0x64, 0x90, 0x21, 0x23,
+  0x45, 0x44, 0x00, 0x6a, 0x00, 0xc0, 0xd4, 0x00, 0x80, 0xd9, 0x41, 0x1b,
+  0x0c, 0x79, 0x10, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x18, 0xf2, 0x28, 0x40, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x30, 0xe4, 0x71, 0x80, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x60, 0xc8, 0x03, 0x01, 0x01, 0x10, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0xc0, 0x90, 0x67, 0x02, 0x02, 0x40, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x21, 0x4f, 0x05, 0x04, 0xc0, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0x20, 0x00, 0x00, 0x00,
+  0x0f, 0x00, 0x00, 0x00, 0x32, 0x1e, 0x98, 0x14, 0x19, 0x11, 0x4c, 0x90,
+  0x8c, 0x09, 0x26, 0x47, 0xc6, 0x04, 0x43, 0x22, 0x25, 0x50, 0x10, 0x23,
+  0x00, 0xc5, 0x50, 0x04, 0x25, 0x51, 0xc6, 0x08, 0xe5, 0x50, 0x0a, 0x45,
+  0x51, 0x42, 0xd4, 0x4b, 0x10, 0x30, 0x10, 0x10, 0x88, 0xf6, 0x08, 0x00,
+  0x69, 0xdb, 0x11, 0x60, 0x3b, 0x00, 0x88, 0xcf, 0x00, 0x50, 0x19, 0x01,
+  0x00, 0x00, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00,
+  0x1a, 0x03, 0x4c, 0x90, 0x46, 0x02, 0x13, 0x44, 0x8f, 0x0c, 0x6f, 0xec,
+  0xed, 0x4d, 0x0c, 0x24, 0xc6, 0x05, 0xc7, 0x45, 0xa6, 0x06, 0x46, 0xc6,
+  0x25, 0x26, 0x06, 0x04, 0x45, 0x66, 0x26, 0x27, 0x47, 0x26, 0xa6, 0x46,
+  0x46, 0x26, 0x65, 0x43, 0x10, 0x4c, 0x10, 0x88, 0x64, 0x82, 0x40, 0x28,
+  0x1b, 0x84, 0x81, 0x98, 0x20, 0x10, 0xcb, 0x06, 0xc1, 0x30, 0x38, 0xb0,
+  0xa5, 0x89, 0x4d, 0x10, 0x08, 0x66, 0xc3, 0x80, 0x24, 0xc4, 0x04, 0x41,
+  0xbb, 0x78, 0x9c, 0x3d, 0xd5, 0xd1, 0xc1, 0xd5, 0xd1, 0x4d, 0x10, 0x88,
+  0x66, 0x82, 0xb0, 0x55, 0x13, 0x04, 0xc2, 0xd9, 0x20, 0x18, 0xcf, 0x86,
+  0xc5, 0x58, 0x18, 0xc3, 0x18, 0x1a, 0xc7, 0x71, 0xa0, 0x09, 0x82, 0x66,
+  0x51, 0x39, 0xab, 0x4b, 0xa3, 0x2a, 0xc3, 0xa3, 0xab, 0x93, 0x2b, 0xdb,
+  0xb0, 0x0c, 0xd2, 0x64, 0x0c, 0x43, 0xe3, 0x38, 0x0e, 0xb4, 0x41, 0x88,
+  0xa8, 0x0d, 0x04, 0x50, 0x01, 0xc0, 0x04, 0x21, 0x19, 0x36, 0x00, 0x1b,
+  0x86, 0x01, 0xc3, 0x36, 0x04, 0xd9, 0x86, 0x61, 0xb8, 0xb4, 0x09, 0x02,
+  0x87, 0x4d, 0x10, 0x88, 0x67, 0x83, 0x60, 0x74, 0x1b, 0x02, 0x6f, 0xc3,
+  0x60, 0x70, 0x1f, 0x81, 0x09, 0x42, 0x47, 0x6d, 0x10, 0x0c, 0x31, 0xd8,
+  0x50, 0x00, 0x61, 0x00, 0x58, 0x63, 0xc0, 0x27, 0xe0, 0x47, 0x2a, 0x2c,
+  0xef, 0xa8, 0xcc, 0x0d, 0x08, 0x28, 0x2b, 0x08, 0x0b, 0x4b, 0x6b, 0x82,
+  0x40, 0x40, 0x13, 0x04, 0x22, 0xda, 0x10, 0x18, 0x1b, 0x08, 0xc2, 0x0c,
+  0xce, 0x00, 0x0d, 0x36, 0x14, 0x57, 0x19, 0x00, 0x40, 0x1a, 0xd0, 0x30,
+  0x63, 0x7b, 0x0b, 0xa3, 0x9b, 0x9b, 0x20, 0x10, 0x12, 0x8b, 0x34, 0xb7,
+  0x39, 0xba, 0xb9, 0x09, 0x02, 0x31, 0x11, 0xa1, 0x2b, 0xc3, 0xfb, 0x62,
+  0x7b, 0x0b, 0x23, 0x63, 0x42, 0x57, 0x86, 0xf7, 0x35, 0x47, 0xf7, 0x26,
+  0x57, 0xb6, 0x01, 0x59, 0x03, 0x36, 0x68, 0x03, 0x37, 0x78, 0x83, 0x01,
+  0x0e, 0x9a, 0x2a, 0x6c, 0x6c, 0x76, 0x6d, 0x2e, 0x69, 0x64, 0x65, 0x6e,
+  0x74, 0x53, 0x82, 0xa0, 0x0a, 0x19, 0x9e, 0x8b, 0x5d, 0x99, 0xdc, 0x5c,
+  0xda, 0x9b, 0xdb, 0x94, 0x80, 0x68, 0x42, 0x86, 0xe7, 0x62, 0x17, 0xc6,
+  0x66, 0x57, 0x26, 0x37, 0x25, 0x30, 0xea, 0x90, 0xe1, 0xb9, 0xcc, 0xa1,
+  0x85, 0x91, 0x95, 0xc9, 0x35, 0xbd, 0x91, 0x95, 0xb1, 0x4d, 0x09, 0x92,
+  0x32, 0x64, 0x78, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
+  0x73, 0x53, 0x82, 0xaa, 0x12, 0x19, 0x9e, 0x0b, 0x5d, 0x1e, 0x5c, 0x59,
+  0x90, 0x9b, 0xdb, 0x1b, 0x5d, 0x18, 0x5d, 0xda, 0x9b, 0xdb, 0xdc, 0x94,
+  0x40, 0x2b, 0x46, 0x86, 0xe7, 0x42, 0x86, 0x27, 0x07, 0x15, 0x96, 0xc7,
+  0xf6, 0x16, 0x46, 0x16, 0xe4, 0xe6, 0xf6, 0x46, 0x17, 0x46, 0x97, 0xf6,
+  0xe6, 0x36, 0x37, 0x25, 0xf8, 0xea, 0x90, 0xe1, 0xb9, 0x94, 0xb9, 0xd1,
+  0xc9, 0xe5, 0x41, 0xbd, 0xa5, 0xb9, 0xd1, 0xcd, 0x4d, 0x11, 0xc6, 0x20,
+  0x0d, 0xba, 0x90, 0xe1, 0xb9, 0x8c, 0xbd, 0xd5, 0xb9, 0xd1, 0x95, 0xc9,
+  0xcd, 0x4d, 0x09, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00,
+  0x4c, 0x00, 0x00, 0x00, 0x33, 0x08, 0x80, 0x1c, 0xc4, 0xe1, 0x1c, 0x66,
+  0x14, 0x01, 0x3d, 0x88, 0x43, 0x38, 0x84, 0xc3, 0x8c, 0x42, 0x80, 0x07,
+  0x79, 0x78, 0x07, 0x73, 0x98, 0x71, 0x0c, 0xe6, 0x00, 0x0f, 0xed, 0x10,
+  0x0e, 0xf4, 0x80, 0x0e, 0x33, 0x0c, 0x42, 0x1e, 0xc2, 0xc1, 0x1d, 0xce,
+  0xa1, 0x1c, 0x66, 0x30, 0x05, 0x3d, 0x88, 0x43, 0x38, 0x84, 0x83, 0x1b,
+  0xcc, 0x03, 0x3d, 0xc8, 0x43, 0x3d, 0x8c, 0x03, 0x3d, 0xcc, 0x78, 0x8c,
+  0x74, 0x70, 0x07, 0x7b, 0x08, 0x07, 0x79, 0x48, 0x87, 0x70, 0x70, 0x07,
+  0x7a, 0x70, 0x03, 0x76, 0x78, 0x87, 0x70, 0x20, 0x87, 0x19, 0xcc, 0x11,
+  0x0e, 0xec, 0x90, 0x0e, 0xe1, 0x30, 0x0f, 0x6e, 0x30, 0x0f, 0xe3, 0xf0,
+  0x0e, 0xf0, 0x50, 0x0e, 0x33, 0x10, 0xc4, 0x1d, 0xde, 0x21, 0x1c, 0xd8,
+  0x21, 0x1d, 0xc2, 0x61, 0x1e, 0x66, 0x30, 0x89, 0x3b, 0xbc, 0x83, 0x3b,
+  0xd0, 0x43, 0x39, 0xb4, 0x03, 0x3c, 0xbc, 0x83, 0x3c, 0x84, 0x03, 0x3b,
+  0xcc, 0xf0, 0x14, 0x76, 0x60, 0x07, 0x7b, 0x68, 0x07, 0x37, 0x68, 0x87,
+  0x72, 0x68, 0x07, 0x37, 0x80, 0x87, 0x70, 0x90, 0x87, 0x70, 0x60, 0x07,
+  0x76, 0x28, 0x07, 0x76, 0xf8, 0x05, 0x76, 0x78, 0x87, 0x77, 0x80, 0x87,
+  0x5f, 0x08, 0x87, 0x71, 0x18, 0x87, 0x72, 0x98, 0x87, 0x79, 0x98, 0x81,
+  0x2c, 0xee, 0xf0, 0x0e, 0xee, 0xe0, 0x0e, 0xf5, 0xc0, 0x0e, 0xec, 0x30,
+  0x03, 0x62, 0xc8, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xcc, 0xa1, 0x1c, 0xe4,
+  0xa1, 0x1c, 0xdc, 0x61, 0x1c, 0xca, 0x21, 0x1c, 0xc4, 0x81, 0x1d, 0xca,
+  0x61, 0x06, 0xd6, 0x90, 0x43, 0x39, 0xc8, 0x43, 0x39, 0x98, 0x43, 0x39,
+  0xc8, 0x43, 0x39, 0xb8, 0xc3, 0x38, 0x94, 0x43, 0x38, 0x88, 0x03, 0x3b,
+  0x94, 0xc3, 0x2f, 0xbc, 0x83, 0x3c, 0xfc, 0x82, 0x3b, 0xd4, 0x03, 0x3b,
+  0xb0, 0xc3, 0x8c, 0xc8, 0x21, 0x07, 0x7c, 0x70, 0x03, 0x72, 0x10, 0x87,
+  0x73, 0x70, 0x03, 0x7b, 0x08, 0x07, 0x79, 0x60, 0x87, 0x70, 0xc8, 0x87,
+  0x77, 0xa8, 0x07, 0x7a, 0x98, 0x81, 0x3c, 0xe4, 0x80, 0x0f, 0x6e, 0x40,
+  0x0f, 0xe5, 0xd0, 0x0e, 0xf0, 0x00, 0x00, 0x00, 0x71, 0x20, 0x00, 0x00,
+  0x39, 0x00, 0x00, 0x00, 0x35, 0xf0, 0x04, 0x7e, 0xd2, 0x70, 0xfe, 0x58,
+  0x76, 0x03, 0x81, 0xd9, 0x20, 0x16, 0xab, 0x2d, 0x00, 0x37, 0x08, 0xfc,
+  0xce, 0xcf, 0x3a, 0x1d, 0x5e, 0xa7, 0x03, 0x81, 0x33, 0xeb, 0x8f, 0x24,
+  0xbd, 0x52, 0xcb, 0x78, 0x7a, 0x5d, 0x5e, 0x96, 0x11, 0x81, 0xd6, 0x1f,
+  0xc9, 0x5e, 0x1e, 0xd3, 0xdf, 0x72, 0x60, 0x93, 0x04, 0x9b, 0x01, 0x81,
+  0x40, 0x60, 0xb0, 0x02, 0xe2, 0x20, 0xf0, 0x3b, 0xd7, 0xd3, 0xd4, 0x32,
+  0x9e, 0x5e, 0x97, 0x97, 0x81, 0xc0, 0x99, 0xf5, 0x47, 0x92, 0x5e, 0xa9,
+  0x65, 0x3c, 0xbd, 0x2e, 0x2f, 0xcb, 0x88, 0x40, 0xeb, 0x8f, 0x64, 0x2f,
+  0x8f, 0xe9, 0x6f, 0x39, 0xb0, 0x49, 0x82, 0xcd, 0x80, 0x40, 0x20, 0x30,
+  0x68, 0x02, 0xcc, 0x70, 0xf9, 0x8d, 0x33, 0x1d, 0x48, 0x63, 0xf8, 0x80,
+  0x1d, 0x50, 0xc3, 0xe5, 0x3b, 0x8f, 0x0f, 0x34, 0x8d, 0x33, 0x01, 0x13,
+  0x11, 0x02, 0xcd, 0xb0, 0x10, 0x86, 0x80, 0x06, 0xc3, 0xe5, 0x3b, 0x8f,
+  0x2f, 0x44, 0x04, 0x30, 0x11, 0x21, 0xd0, 0x0c, 0x0b, 0xf1, 0x39, 0x51,
+  0x89, 0x04, 0xfe, 0x70, 0xf9, 0x13, 0xf6, 0x10, 0x92, 0x1f, 0x02, 0xcd,
+  0xb0, 0x10, 0x46, 0xb0, 0x0d, 0x97, 0xef, 0x3c, 0xfe, 0x80, 0x48, 0x0f,
+  0x30, 0x09, 0xc7, 0x0a, 0x60, 0x92, 0xd8, 0x0c, 0xc4, 0xe5, 0x23, 0xb7,
+  0x6d, 0x05, 0xd5, 0x70, 0xf9, 0xce, 0xe3, 0x4f, 0xc4, 0x35, 0x51, 0x11,
+  0x51, 0x3a, 0xc0, 0xe0, 0x17, 0xb7, 0x6d, 0x06, 0xd6, 0x70, 0xf9, 0xce,
+  0xe3, 0x4f, 0xc4, 0x35, 0x51, 0x11, 0xc1, 0x4e, 0x4e, 0x44, 0xf8, 0xc5,
+  0x6d, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x4c, 0x44, 0x4e,
+  0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x43, 0x3a, 0x5c, 0x55,
+  0x73, 0x65, 0x72, 0x73, 0x5c, 0x6b, 0x6f, 0x6c, 0x6a, 0x61, 0x5c, 0x44,
+  0x65, 0x73, 0x6b, 0x74, 0x6f, 0x70, 0x5c, 0x4b, 0x6f, 0x6c, 0x6a, 0x61,
+  0x2d, 0x53, 0x74, 0x72, 0x6f, 0x68, 0x6d, 0x2d, 0x47, 0x61, 0x6d, 0x65,
+  0x73, 0x5c, 0x53, 0x70, 0x69, 0x65, 0x6c, 0x65, 0x00, 0x00, 0x00, 0x00,
+  0x48, 0x41, 0x53, 0x48, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0xca, 0x1c, 0x0e, 0xfe, 0xe5, 0x6f, 0xaf, 0x46, 0x9c, 0xcf, 0xf1, 0xb4,
+  0x26, 0xe7, 0x00, 0xb3, 0x44, 0x58, 0x49, 0x4c, 0xa0, 0x07, 0x00, 0x00,
+  0x68, 0x00, 0x06, 0x00, 0xe8, 0x01, 0x00, 0x00, 0x44, 0x58, 0x49, 0x4c,
+  0x08, 0x01, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x88, 0x07, 0x00, 0x00,
+  0x42, 0x43, 0xc0, 0xde, 0x21, 0x0c, 0x00, 0x00, 0xdf, 0x01, 0x00, 0x00,
+  0x0b, 0x82, 0x20, 0x00, 0x02, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
+  0x07, 0x81, 0x23, 0x91, 0x41, 0xc8, 0x04, 0x49, 0x06, 0x10, 0x32, 0x39,
+  0x92, 0x01, 0x84, 0x0c, 0x25, 0x05, 0x08, 0x19, 0x1e, 0x04, 0x8b, 0x62,
+  0x80, 0x14, 0x45, 0x02, 0x42, 0x92, 0x0b, 0x42, 0xa4, 0x10, 0x32, 0x14,
+  0x38, 0x08, 0x18, 0x4b, 0x0a, 0x32, 0x52, 0x88, 0x48, 0x90, 0x14, 0x20,
+  0x43, 0x46, 0x88, 0xa5, 0x00, 0x19, 0x32, 0x42, 0xe4, 0x48, 0x0e, 0x90,
+  0x91, 0x22, 0xc4, 0x50, 0x41, 0x51, 0x81, 0x8c, 0xe1, 0x83, 0xe5, 0x8a,
+  0x04, 0x29, 0x46, 0x06, 0x51, 0x18, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
+  0x1b, 0x88, 0xe0, 0xff, 0xff, 0xff, 0xff, 0x07, 0x40, 0xda, 0x60, 0x08,
+  0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x12, 0x40, 0x6d, 0x30, 0x86, 0xff,
+  0xff, 0xff, 0xff, 0x1f, 0x00, 0x09, 0xa8, 0x00, 0x49, 0x18, 0x00, 0x00,
+  0x03, 0x00, 0x00, 0x00, 0x13, 0x82, 0x60, 0x42, 0x20, 0x4c, 0x08, 0x06,
+  0x00, 0x00, 0x00, 0x00, 0x89, 0x20, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00,
+  0x32, 0x22, 0x48, 0x09, 0x20, 0x64, 0x85, 0x04, 0x93, 0x22, 0xa4, 0x84,
+  0x04, 0x93, 0x22, 0xe3, 0x84, 0xa1, 0x90, 0x14, 0x12, 0x4c, 0x8a, 0x8c,
+  0x0b, 0x84, 0xa4, 0x4c, 0x10, 0x7c, 0x73, 0x04, 0x08, 0x81, 0x7b, 0x86,
+  0xcb, 0x9f, 0xb0, 0x87, 0x90, 0xfc, 0x10, 0x68, 0x86, 0x85, 0x40, 0x41,
+  0x20, 0x31, 0x47, 0x00, 0x06, 0x19, 0x40, 0xa8, 0x8c, 0x00, 0x94, 0xe0,
+  0x10, 0x2a, 0x03, 0x21, 0x80, 0xd4, 0x0c, 0xc0, 0x4d, 0xc3, 0xe5, 0x4f,
+  0xd8, 0x43, 0x48, 0xfe, 0x4a, 0x48, 0x2b, 0x31, 0xf9, 0xc5, 0x6d, 0xa3,
+  0x82, 0x31, 0xc6, 0x48, 0x51, 0x1a, 0x11, 0x84, 0x10, 0x42, 0x08, 0x21,
+  0x57, 0x96, 0x43, 0x04, 0x21, 0x84, 0x31, 0xc6, 0x00, 0xc1, 0xdb, 0x86,
+  0xcb, 0x9f, 0xb0, 0x87, 0x90, 0xfc, 0x95, 0x90, 0x1c, 0x2a, 0x12, 0x88,
+  0x34, 0x72, 0x1e, 0x22, 0x9a, 0x10, 0x42, 0x42, 0x02, 0x21, 0x85, 0x10,
+  0x44, 0x48, 0x9a, 0x65, 0x10, 0x44, 0x50, 0x1d, 0x08, 0x18, 0x46, 0x20,
+  0x98, 0x99, 0xc8, 0x60, 0x1c, 0xd8, 0x21, 0x1c, 0xe6, 0x61, 0x1e, 0xdc,
+  0x40, 0x16, 0x6e, 0x81, 0x16, 0xca, 0x01, 0x1f, 0xe8, 0xa1, 0x1e, 0xe4,
+  0xa1, 0x1c, 0xe4, 0x80, 0x14, 0xf8, 0xc0, 0x1e, 0xca, 0x61, 0x1c, 0xe8,
+  0xe1, 0x1d, 0xe4, 0x81, 0x0f, 0xcc, 0x81, 0x1d, 0xde, 0x21, 0x1c, 0xe8,
+  0x81, 0x0d, 0xc0, 0x80, 0x0e, 0xfc, 0x00, 0x0c, 0xfc, 0x00, 0x05, 0x98,
+  0xf2, 0x1c, 0x41, 0x70, 0x8e, 0x34, 0x45, 0x94, 0x30, 0xf9, 0x21, 0x32,
+  0x89, 0x4d, 0xe1, 0xa0, 0x00, 0xcf, 0x11, 0x80, 0x02, 0x11, 0x00, 0x00,
+  0x13, 0x14, 0x72, 0xc0, 0x87, 0x74, 0x60, 0x87, 0x36, 0x68, 0x87, 0x79,
+  0x68, 0x03, 0x72, 0xc0, 0x87, 0x0d, 0xaf, 0x50, 0x0e, 0x6d, 0xd0, 0x0e,
+  0x7a, 0x50, 0x0e, 0x6d, 0x00, 0x0f, 0x7a, 0x30, 0x07, 0x72, 0xa0, 0x07,
+  0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x71, 0xa0, 0x07, 0x73, 0x20, 0x07,
+  0x6d, 0x90, 0x0e, 0x78, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e,
+  0x71, 0x60, 0x07, 0x7a, 0x30, 0x07, 0x72, 0xd0, 0x06, 0xe9, 0x30, 0x07,
+  0x72, 0xa0, 0x07, 0x73, 0x20, 0x07, 0x6d, 0x90, 0x0e, 0x76, 0x40, 0x07,
+  0x7a, 0x60, 0x07, 0x74, 0xd0, 0x06, 0xe6, 0x10, 0x07, 0x76, 0xa0, 0x07,
+  0x73, 0x20, 0x07, 0x6d, 0x60, 0x0e, 0x73, 0x20, 0x07, 0x7a, 0x30, 0x07,
+  0x72, 0xd0, 0x06, 0xe6, 0x60, 0x07, 0x74, 0xa0, 0x07, 0x76, 0x40, 0x07,
+  0x6d, 0xe0, 0x0e, 0x78, 0xa0, 0x07, 0x71, 0x60, 0x07, 0x7a, 0x30, 0x07,
+  0x72, 0xa0, 0x07, 0x76, 0x40, 0x07, 0x3a, 0x0f, 0x64, 0x90, 0x21, 0x23,
+  0x45, 0x44, 0x00, 0x6a, 0x00, 0xc0, 0xd4, 0x00, 0x80, 0xd9, 0x01, 0x1b,
+  0x0c, 0x79, 0x10, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x18, 0xf2, 0x28, 0x40, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x30, 0xe4, 0x71, 0x80, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x60, 0xc8, 0x03, 0x01, 0x01, 0x10, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0xc0, 0x90, 0x67, 0x02, 0x02, 0x40, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x21, 0x4f, 0x05, 0x04, 0xc0, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0x20, 0x00, 0x00, 0x00,
+  0x0e, 0x00, 0x00, 0x00, 0x32, 0x1e, 0x98, 0x14, 0x19, 0x11, 0x4c, 0x90,
+  0x8c, 0x09, 0x26, 0x47, 0xc6, 0x04, 0x43, 0x22, 0x25, 0x50, 0x10, 0xc5,
+  0x30, 0x02, 0x50, 0x04, 0x25, 0x51, 0xc6, 0x08, 0xe5, 0x50, 0x0a, 0xd4,
+  0x4b, 0x10, 0x30, 0x10, 0x10, 0x88, 0xf6, 0x08, 0x00, 0x69, 0xdb, 0x11,
+  0x60, 0x3b, 0x00, 0x88, 0xcf, 0x00, 0x50, 0x19, 0x01, 0x00, 0x00, 0x00,
+  0x79, 0x18, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x1a, 0x03, 0x4c, 0x90,
+  0x46, 0x02, 0x13, 0x44, 0x8f, 0x0c, 0x6f, 0xec, 0xed, 0x4d, 0x0c, 0x24,
+  0xc6, 0x05, 0xc7, 0x45, 0xa6, 0x06, 0x46, 0xc6, 0x25, 0x26, 0x06, 0x04,
+  0x45, 0x66, 0x26, 0x27, 0x47, 0x26, 0xa6, 0x46, 0x46, 0x26, 0x65, 0x43,
+  0x10, 0x4c, 0x10, 0x88, 0x64, 0x82, 0x40, 0x28, 0x1b, 0x84, 0x81, 0xe0,
+  0xc0, 0x96, 0x26, 0x36, 0x41, 0x20, 0x96, 0x0d, 0x83, 0x71, 0x10, 0x13,
+  0x04, 0x82, 0x99, 0x20, 0x68, 0x15, 0x8f, 0xb3, 0xa7, 0x3a, 0x3a, 0xb8,
+  0x3a, 0xba, 0x09, 0x02, 0xd1, 0x4c, 0x10, 0xb6, 0x69, 0x82, 0x40, 0x38,
+  0x1b, 0x84, 0xc4, 0xd9, 0xb0, 0x24, 0xca, 0x92, 0x24, 0x03, 0xd3, 0x34,
+  0xcd, 0x33, 0x41, 0xd0, 0x28, 0x2a, 0x67, 0x75, 0x69, 0x54, 0x65, 0x78,
+  0x74, 0x75, 0x72, 0x65, 0x1b, 0x96, 0x21, 0x92, 0x92, 0x61, 0x60, 0x9a,
+  0xa6, 0x79, 0x36, 0x08, 0xd0, 0xb4, 0x81, 0x00, 0x28, 0x00, 0x98, 0x20,
+  0x24, 0xc3, 0x06, 0x60, 0xc3, 0x30, 0x5c, 0xd7, 0x86, 0x00, 0xdb, 0x30,
+  0x0c, 0x56, 0x36, 0x41, 0xe0, 0xac, 0x09, 0x02, 0xf1, 0x6c, 0x10, 0x12,
+  0x6e, 0x43, 0xd0, 0x6d, 0x18, 0x92, 0xcd, 0x23, 0x30, 0x41, 0xe8, 0xa4,
+  0x0d, 0x42, 0x12, 0x06, 0x1b, 0x0a, 0x00, 0x0c, 0x80, 0x4a, 0x0c, 0xf8,
+  0x04, 0xfc, 0x48, 0x85, 0xe5, 0x1d, 0x95, 0xb9, 0x01, 0x01, 0x65, 0x05,
+  0x61, 0x61, 0x69, 0x4d, 0x10, 0x08, 0x68, 0x82, 0x40, 0x44, 0x1b, 0x82,
+  0x64, 0x03, 0x41, 0x94, 0x81, 0x19, 0x9c, 0xc1, 0x86, 0xc2, 0x22, 0x03,
+  0x00, 0x40, 0x83, 0x2a, 0x6c, 0x6c, 0x76, 0x6d, 0x2e, 0x69, 0x64, 0x65,
+  0x6e, 0x74, 0x53, 0x82, 0xa0, 0x0a, 0x19, 0x9e, 0x8b, 0x5d, 0x99, 0xdc,
+  0x5c, 0xda, 0x9b, 0xdb, 0x94, 0x80, 0x68, 0x42, 0x86, 0xe7, 0x62, 0x17,
+  0xc6, 0x66, 0x57, 0x26, 0x37, 0x25, 0x20, 0xea, 0x90, 0xe1, 0xb9, 0xcc,
+  0xa1, 0x85, 0x91, 0x95, 0xc9, 0x35, 0xbd, 0x91, 0x95, 0xb1, 0x4d, 0x09,
+  0x8e, 0x32, 0x64, 0x78, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
+  0x65, 0x73, 0x53, 0x02, 0xaa, 0x12, 0x19, 0x9e, 0x0b, 0x5d, 0x1e, 0x5c,
+  0x59, 0x90, 0x9b, 0xdb, 0x1b, 0x5d, 0x18, 0x5d, 0xda, 0x9b, 0xdb, 0xdc,
+  0x94, 0x20, 0x2b, 0x46, 0x86, 0xe7, 0x42, 0x86, 0x27, 0x07, 0x15, 0x96,
+  0xc7, 0xf6, 0x16, 0x46, 0x16, 0xe4, 0xe6, 0xf6, 0x46, 0x17, 0x46, 0x97,
+  0xf6, 0xe6, 0x36, 0x37, 0x25, 0xf0, 0xea, 0x90, 0xe1, 0xb9, 0x94, 0xb9,
+  0xd1, 0xc9, 0xe5, 0x41, 0xbd, 0xa5, 0xb9, 0xd1, 0xcd, 0x4d, 0x11, 0xc4,
+  0x00, 0x0d, 0x00, 0x00, 0x79, 0x18, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00,
+  0x33, 0x08, 0x80, 0x1c, 0xc4, 0xe1, 0x1c, 0x66, 0x14, 0x01, 0x3d, 0x88,
+  0x43, 0x38, 0x84, 0xc3, 0x8c, 0x42, 0x80, 0x07, 0x79, 0x78, 0x07, 0x73,
+  0x98, 0x71, 0x0c, 0xe6, 0x00, 0x0f, 0xed, 0x10, 0x0e, 0xf4, 0x80, 0x0e,
+  0x33, 0x0c, 0x42, 0x1e, 0xc2, 0xc1, 0x1d, 0xce, 0xa1, 0x1c, 0x66, 0x30,
+  0x05, 0x3d, 0x88, 0x43, 0x38, 0x84, 0x83, 0x1b, 0xcc, 0x03, 0x3d, 0xc8,
+  0x43, 0x3d, 0x8c, 0x03, 0x3d, 0xcc, 0x78, 0x8c, 0x74, 0x70, 0x07, 0x7b,
+  0x08, 0x07, 0x79, 0x48, 0x87, 0x70, 0x70, 0x07, 0x7a, 0x70, 0x03, 0x76,
+  0x78, 0x87, 0x70, 0x20, 0x87, 0x19, 0xcc, 0x11, 0x0e, 0xec, 0x90, 0x0e,
+  0xe1, 0x30, 0x0f, 0x6e, 0x30, 0x0f, 0xe3, 0xf0, 0x0e, 0xf0, 0x50, 0x0e,
+  0x33, 0x10, 0xc4, 0x1d, 0xde, 0x21, 0x1c, 0xd8, 0x21, 0x1d, 0xc2, 0x61,
+  0x1e, 0x66, 0x30, 0x89, 0x3b, 0xbc, 0x83, 0x3b, 0xd0, 0x43, 0x39, 0xb4,
+  0x03, 0x3c, 0xbc, 0x83, 0x3c, 0x84, 0x03, 0x3b, 0xcc, 0xf0, 0x14, 0x76,
+  0x60, 0x07, 0x7b, 0x68, 0x07, 0x37, 0x68, 0x87, 0x72, 0x68, 0x07, 0x37,
+  0x80, 0x87, 0x70, 0x90, 0x87, 0x70, 0x60, 0x07, 0x76, 0x28, 0x07, 0x76,
+  0xf8, 0x05, 0x76, 0x78, 0x87, 0x77, 0x80, 0x87, 0x5f, 0x08, 0x87, 0x71,
+  0x18, 0x87, 0x72, 0x98, 0x87, 0x79, 0x98, 0x81, 0x2c, 0xee, 0xf0, 0x0e,
+  0xee, 0xe0, 0x0e, 0xf5, 0xc0, 0x0e, 0xec, 0x30, 0x03, 0x62, 0xc8, 0xa1,
+  0x1c, 0xe4, 0xa1, 0x1c, 0xcc, 0xa1, 0x1c, 0xe4, 0xa1, 0x1c, 0xdc, 0x61,
+  0x1c, 0xca, 0x21, 0x1c, 0xc4, 0x81, 0x1d, 0xca, 0x61, 0x06, 0xd6, 0x90,
+  0x43, 0x39, 0xc8, 0x43, 0x39, 0x98, 0x43, 0x39, 0xc8, 0x43, 0x39, 0xb8,
+  0xc3, 0x38, 0x94, 0x43, 0x38, 0x88, 0x03, 0x3b, 0x94, 0xc3, 0x2f, 0xbc,
+  0x83, 0x3c, 0xfc, 0x82, 0x3b, 0xd4, 0x03, 0x3b, 0xb0, 0xc3, 0x8c, 0xc8,
+  0x21, 0x07, 0x7c, 0x70, 0x03, 0x72, 0x10, 0x87, 0x73, 0x70, 0x03, 0x7b,
+  0x08, 0x07, 0x79, 0x60, 0x87, 0x70, 0xc8, 0x87, 0x77, 0xa8, 0x07, 0x7a,
+  0x98, 0x81, 0x3c, 0xe4, 0x80, 0x0f, 0x6e, 0x40, 0x0f, 0xe5, 0xd0, 0x0e,
+  0xf0, 0x00, 0x00, 0x00, 0x71, 0x20, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00,
+  0x35, 0xf0, 0x04, 0x7e, 0xd2, 0x70, 0xfe, 0x58, 0x76, 0x03, 0x81, 0xd9,
+  0x20, 0x16, 0xab, 0x2d, 0x00, 0x37, 0x08, 0xfc, 0xce, 0xcf, 0x3a, 0x1d,
+  0x5e, 0xa7, 0x03, 0x81, 0x33, 0xeb, 0x8f, 0x24, 0xbd, 0x52, 0xcb, 0x78,
+  0x7a, 0x5d, 0x5e, 0x96, 0x11, 0x81, 0xd6, 0x1f, 0xc9, 0x5e, 0x1e, 0xd3,
+  0xdf, 0x72, 0x60, 0x93, 0x04, 0x9b, 0x01, 0x81, 0x40, 0x60, 0xb0, 0x02,
+  0xe2, 0x20, 0xf0, 0x3b, 0xd7, 0xd3, 0xd4, 0x32, 0x9e, 0x5e, 0x97, 0x97,
+  0x81, 0xc0, 0x99, 0xf5, 0x47, 0x92, 0x5e, 0xa9, 0x65, 0x3c, 0xbd, 0x2e,
+  0x2f, 0xcb, 0x88, 0x40, 0xeb, 0x8f, 0x64, 0x2f, 0x8f, 0xe9, 0x6f, 0x39,
+  0xb0, 0x49, 0x82, 0xcd, 0x80, 0x40, 0x20, 0x30, 0x68, 0x02, 0xcc, 0x70,
+  0xf9, 0x8d, 0x33, 0x1d, 0x48, 0x63, 0xf8, 0x80, 0x1d, 0x50, 0xc3, 0xe5,
+  0x3b, 0x8f, 0x0f, 0x34, 0x8d, 0x33, 0x01, 0x13, 0x11, 0x02, 0xcd, 0xb0,
+  0x10, 0x86, 0x80, 0x06, 0xc3, 0xe5, 0x3b, 0x8f, 0x2f, 0x44, 0x04, 0x30,
+  0x11, 0x21, 0xd0, 0x0c, 0x0b, 0xf1, 0x39, 0x51, 0x89, 0x04, 0xfe, 0x70,
+  0xf9, 0x13, 0xf6, 0x10, 0x92, 0x1f, 0x02, 0xcd, 0xb0, 0x10, 0x46, 0xb0,
+  0x0d, 0x97, 0xef, 0x3c, 0xfe, 0x80, 0x48, 0x0f, 0x30, 0x09, 0xc7, 0x0a,
+  0x60, 0x92, 0xd8, 0x0c, 0xc4, 0xe5, 0x23, 0xb7, 0x6d, 0x05, 0xd5, 0x70,
+  0xf9, 0xce, 0xe3, 0x4f, 0xc4, 0x35, 0x51, 0x11, 0x51, 0x3a, 0xc0, 0xe0,
+  0x17, 0xb7, 0x6d, 0x06, 0xd6, 0x70, 0xf9, 0xce, 0xe3, 0x4f, 0xc4, 0x35,
+  0x51, 0x11, 0xc1, 0x4e, 0x4e, 0x44, 0xf8, 0xc5, 0x6d, 0x03, 0x00, 0x00,
+  0x61, 0x20, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x13, 0x04, 0x41, 0x2c,
+  0x10, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x04, 0xca, 0x63, 0x04,
+  0xa0, 0x04, 0x88, 0xcc, 0x00, 0x14, 0xb0, 0x40, 0xc1, 0x0e, 0x94, 0xa8,
+  0x40, 0x19, 0x06, 0x14, 0x21, 0x50, 0x49, 0x42, 0x14, 0x61, 0x00, 0xb1,
+  0x31, 0x02, 0x10, 0x04, 0x41, 0xfc, 0x1b, 0x23, 0x30, 0xe7, 0x9c, 0xb5,
+  0xbf, 0x31, 0x02, 0x9d, 0x35, 0xe7, 0xf8, 0x1b, 0x23, 0x68, 0xcd, 0x39,
+  0x27, 0x3f, 0x92, 0x73, 0x08, 0x60, 0x10, 0x06, 0xe4, 0x87, 0x3a, 0x0a,
+  0x43, 0x20, 0x18, 0x82, 0x01, 0x00, 0x00, 0x00, 0x84, 0x06, 0x02, 0x90,
+  0x1a, 0x08, 0x40, 0x03, 0x01, 0x23, 0x06, 0x06, 0x00, 0x82, 0x60, 0xa0,
+  0xa0, 0x81, 0x33, 0x8d, 0x18, 0x18, 0x00, 0x08, 0x82, 0x81, 0x92, 0x06,
+  0xcf, 0x44, 0x06, 0x01, 0x74, 0x10, 0x30, 0x62, 0x60, 0x00, 0x20, 0x08,
+  0x06, 0x15, 0x1a, 0x50, 0xc7, 0x88, 0xc1, 0x01, 0x80, 0x20, 0x18, 0x4c,
+  0x6a, 0x40, 0x05, 0xca, 0x88, 0x41, 0x03, 0x80, 0x20, 0x18, 0x38, 0x6d,
+  0x00, 0x05, 0x97, 0x51, 0x5c, 0xd7, 0x75, 0x8d, 0x26, 0x04, 0xc0, 0x68,
+  0x82, 0x10, 0x8c, 0x26, 0x0c, 0xc2, 0x68, 0x02, 0x31, 0xd0, 0x43, 0x80,
+  0x55, 0x42, 0x7c, 0xac, 0x0a, 0xe4, 0x63, 0x95, 0x20, 0x1f, 0xab, 0x06,
+  0xf9, 0x58, 0x62, 0xc8, 0xc7, 0x92, 0x43, 0x3e, 0x96, 0x20, 0xf2, 0x31,
+  0x63, 0x80, 0x8f, 0x19, 0x03, 0x7c, 0xcc, 0x18, 0xe0, 0x33, 0x62, 0x60,
+  0x00, 0x20, 0x08, 0x06, 0x95, 0x1e, 0x98, 0x01, 0x36, 0x62, 0x70, 0x00,
+  0x20, 0x08, 0x06, 0x13, 0x1f, 0x98, 0x41, 0xc0, 0x8d, 0x18, 0x38, 0x00,
+  0x08, 0x82, 0x01, 0xe4, 0x07, 0x65, 0x10, 0x60, 0x57, 0x1a, 0x14, 0xc4,
+  0x10, 0x06, 0x6c, 0x30, 0x62, 0x60, 0x00, 0x20, 0x08, 0x06, 0x15, 0x1f,
+  0xa0, 0x81, 0x36, 0x62, 0x70, 0x00, 0x20, 0x08, 0x06, 0x93, 0x1f, 0xa0,
+  0x41, 0xe0, 0x8d, 0x18, 0x38, 0x00, 0x08, 0x82, 0x01, 0x04, 0x0a, 0x67,
+  0x10, 0x68, 0xd9, 0x1a, 0x8c, 0xc1, 0x18, 0x8c, 0xc1, 0x18, 0xb8, 0x01,
+  0x79, 0x04, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00
+};

+ 0 - 184
FactoryCraft/DX11CustomPixelShader.hlsl

@@ -1,184 +0,0 @@
-/////////////                                                                                           
-// GLOBALS //                                                                                           
-/////////////                                                                                           
-Texture2D shaderTexture : register(t0);
-SamplerState SampleType;
-
-// The position of the kamera
-cbuffer Kamera : register(b0)
-{
-	float4 kPosition;
-}
-
-// these values should sum up to 1
-cbuffer Material : register(b1)
-{
-	float ambientFactor;
-	float diffusFactor;
-	float specularFactor;
-};
-
-cbuffer LightCount : register(b2)
-{
-	int diffuseLightCount;
-	int pointLightCount;
-}
-
-// lights
-struct DiffuseLight
-{
-	float3 direction;
-	float3 color;
-};
-
-struct PointLight
-{
-	float3 position;
-	float3 color;
-	float radius;
-};
-
-cbuffer TexturEffect : register(b3)
-{
-    bool effectEnabled;
-	float effectPercentage;
-};
-
-StructuredBuffer< DiffuseLight > difuseLights : register(t1);
-StructuredBuffer< PointLight > pointLights : register(t2);
-Texture2D additionalTexture : register(t3);
-
-//////////////                                                                                          
-// TYPEDEFS //                                                                                          
-//////////////                                                                                          
-struct PixelInputType
-{
-	float4 worldPos : POSITION;
-	float4 position : SV_POSITION;
-	float2 tex : TEXCOORD0;
-	float3 normal : TEXCOORD1;
-    float4 light1 : TEXCOORD2;
-    float4 light2 : TEXCOORD3;
-};
-
-////////////////////////////////////////////////////////////////////////////////                        
-// Pixel Shader                                                                                         
-////////////////////////////////////////////////////////////////////////////////                        
-float4 TexturePixelShader(PixelInputType input) : SV_TARGET
-{
-	float3 diffuseLight = float3(0, 0, 0);
-	float3 specularLight = float3(0, 0, 0);
-	float4 materialColor = shaderTexture.Sample(SampleType, input.tex);
-	if (effectEnabled)
-	{
-        bool effectAlpha = effectPercentage > 1.f;
-        float percentage = effectPercentage;
-        if (effectAlpha) percentage -= 1.f;
-        if (effectEnabled && !effectAlpha) clip(materialColor.a - 0.25);
-		float dist = sqrt((input.tex.x - 0.5f) * (input.tex.x - 0.5f) + (input.tex.y - 0.5f) * (input.tex.y - 0.5f)) / sqrt(0.5f);
-        if (dist < percentage)
-		{
-            float alphaMultiplier = (percentage - dist) / 0.2f;
-			if (alphaMultiplier > 1)
-				alphaMultiplier = 1.f;
-			float4 effectColor = additionalTexture.Sample(SampleType, input.tex);
-            float effectA = effectColor.a;
-			materialColor = effectColor * (effectColor.a * alphaMultiplier) + materialColor * (1 - effectColor.a * alphaMultiplier);
-            if (effectAlpha)
-			{
-                materialColor.a = effectA * alphaMultiplier;
-                if (materialColor.a > 1.0) materialColor.a = 1.0;
-			}
-		}
-    }
-	else
-	{
-        clip(materialColor.a - 0.25);
-        //materialColor.a = 1.0;
-	}
-	if (input.light1.w > 0)
-    {
-        diffuseLight = float3(materialColor.x * input.light1.x,
-            materialColor.y * input.light1.y,
-            materialColor.z * input.light1.z);
-        float4 diffuseLight2 = float4(materialColor.x * input.light2.x,
-						materialColor.y * input.light2.y,
-						materialColor.z * input.light2.z, 0);
-        if (diffuseLightCount > 0)
-        {
-            float factor = dot(input.normal, -difuseLights[0].direction);
-			if (factor < 0)
-				factor = 0;
-            factor = factor * 0.5 + 0.5;
-            diffuseLight = diffuseLight * factor;
-        }
-		else
-        {
-            diffuseLight = diffuseLight * 0.5;
-		}
-
-        if (diffuseLight2.x > diffuseLight.x)
-        {
-            diffuseLight.x = diffuseLight2.x;
-        }
-        if (diffuseLight2.y > diffuseLight.y)
-        {
-            diffuseLight.y = diffuseLight2.y;
-        }
-        if (diffuseLight2.z > diffuseLight.z)
-        {
-            diffuseLight.z = diffuseLight2.z;
-        }
-		// use this return to debug dynamic lightning
-		//return float4(input.light2.x, input.light2.y, input.light2.z, 1.0);
-	}
-	else
-	{
-		for (int j = 0; j < diffuseLightCount; j++)
-		{
-			if (dot(input.normal, -difuseLights[j].direction) < 0)
-				continue;
-			diffuseLight += difuseLights[j].color * dot(input.normal, -difuseLights[j].direction);
-		}
-        diffuseLight = float3(1.0, 1.0, 1.0);
-		/*for (int i = 0; i < pointLightCount; i++)
-		{
-			float3 lightDir = pointLights[i].position - input.worldPos.xyz;
-			float factor;
-			if (length(lightDir) < 1)
-				factor = 1;
-			else
-				factor = pointLights[i].radius / length(lightDir);
-			float f = dot(input.normal, normalize(lightDir));
-			if (f > 0)
-			{
-				diffuseLight += pointLights[i].color * f * factor;
-				f = dot(normalize(reflect(normalize(-lightDir), input.normal)), normalize(kPosition.xyz - input.worldPos.xyz));
-				if (f > 0)
-					specularLight += pointLights[i].color * f * factor;
-			}
-		}*/
-	}
-	//if (!(diffuseLight.x >= 0 && diffuseLight.x <= 1))
-	//	diffuseLight.x = 0;
-	float4 textureColor = saturate((materialColor * ambientFactor) + (float4(diffuseLight.x, diffuseLight.y, diffuseLight.z, 0) * diffusFactor) + (float4(specularLight.x, specularLight.y, specularLight.z, 0) * specularFactor));
-	textureColor.a = materialColor.a;
-    if (isnan(diffuseLight.x * diffusFactor)) clip(-1);
-	//	textureColor = materialColor;
-    if (effectEnabled && effectPercentage == 0)
-	{
-        clip(textureColor.a - 0.5);
-        //textureColor.a = 1.0;
-	}
-	return textureColor;
-	//return textureColor;
-	//if (diffusFactor == 0)
-	//	return float4(1, 1, 0, 1);
-	/*if (isnan(diffuseLight.x) || isnan(diffusFactor) || isinf(diffuseLight.x) || isinf(-diffuseLight.x))
-		return float4(0, 1, 1, 1);
-	if (isnan(diffuseLight.x - diffuseLight.x) && isnan(diffuseLight.x * diffusFactor) )
-		return float4(1, 1, 1, 1);
-	if ((diffuseLight.x * diffusFactor) != 0 && (diffuseLight.x * diffusFactor) != -0)
-		return float4(0, 0, 1, 1);
-	return float4(0, 1, 0, 1);*/
-}

+ 0 - 110
FactoryCraft/DX11CustomVertexShader.hlsl

@@ -1,110 +0,0 @@
-/////////////
-// GLOBALS //
-/////////////
-cbuffer MatrixBuffer : register(b0)
-{
-    matrix knochenMatrix[128];
-};
-
-// The projection and view matrix
-cbuffer Kamera : register(b1)
-{
-    matrix view;
-    matrix projection;
-}
-
-cbuffer LightController : register(b2)
-{
-    uint lightLength;
-    float dayLightFactor;
-}
-
-// stores the light for two verticies
-struct VertexLight
-{
-    uint dayLight1;
-    uint dynamicLight1;
-    uint dayLight2;
-    uint dynamicLight2;
-};
-
-StructuredBuffer<VertexLight> lightBuffer : register(t0);
-
-//////////////
-// TYPEDEFS //
-//////////////
-struct VertexInputType
-{
-    float4 position : POSITION;
-    float2 tex : TEXCOORD0;
-    float3 normal : NORMAL;
-    uint knochen : KNOCHEN_ID0;
-    uint id : VERTEX_ID0;
-};
-
-struct PixelInputType
-{
-    float4 worldPos : POSITION;
-    float4 position : SV_POSITION;
-    float2 tex : TEXCOORD0;
-    float3 normal : TEXCOORD1;
-    float4 light1 : TEXCOORD2;
-    float4 light2 : TEXCOORD3;
-};
-
-////////////////////////////////////////////////////////////////////////////////
-// Vertex Shader
-////////////////////////////////////////////////////////////////////////////////
-PixelInputType TextureVertexShader(VertexInputType input)
-{
-    // return input;
-    PixelInputType output;
-    output.normal
-        = normalize(mul(input.normal, (float3x3)knochenMatrix[input.knochen]));
-
-    // Change the position vector to be 4 units for proper matrix calculations.
-    input.position.w = 1.0f;
-
-    // Store the texture coordinates for the pixel shader.
-    output.tex = input.tex;
-
-    // Calculate the position of the vertex against the world, view, and
-    // projection matrices.
-    output.worldPos = mul(input.position, knochenMatrix[input.knochen]);
-    output.position = mul(output.worldPos, view);
-    output.position = mul(output.position, projection);
-    output.light1 = float4(1.0f, 1.0f, 1.0f, 0.f);
-    output.light2 = float4(0.0f, 0.0f, 0.0f, 0.f);
-    uint dayLight = 0;
-    uint dynamicLight = 0;
-    if (lightLength == 1)
-    {
-        dayLight = lightBuffer[0].dayLight1;
-        dynamicLight = lightBuffer[0].dynamicLight1;
-    }
-    else if (input.id < lightLength)
-    {
-        if (input.id % 2 == 0)
-        {
-            dayLight = lightBuffer[input.id / 2].dayLight1;
-            dynamicLight = lightBuffer[input.id / 2].dynamicLight1;
-        }
-        else
-        {
-            dayLight = lightBuffer[input.id / 2].dayLight2;
-            dynamicLight = lightBuffer[input.id / 2].dynamicLight2;
-        }
-    }
-    if (lightLength > 0 && (input.id < lightLength || lightLength == 1))
-    {
-        output.light1.x = (((dayLight >> 24) & 0xFF) / 255.f) * dayLightFactor;
-        output.light1.y = (((dayLight >> 16) & 0xFF) / 255.f) * dayLightFactor;
-        output.light1.z = (((dayLight >> 8) & 0xFF) / 255.f) * dayLightFactor;
-        output.light2.x = ((dynamicLight >> 24) & 0xFF) / 255.f;
-        output.light2.y = ((dynamicLight >> 16) & 0xFF) / 255.f;
-        output.light2.z = ((dynamicLight >> 8) & 0xFF) / 255.f;
-        output.light1.w = 1.f;
-    }
-
-    return output;
-}

+ 5 - 9
FactoryCraft/Dimension.cpp

@@ -23,19 +23,15 @@ Dimension::~Dimension()
 
 void Dimension::forAll(std::function<void(Model3D*)> f)
 {
-    // handled by render and tick function
+    for (Chunk* chunk : chunkList)
+    {
+        chunk->forAll(f);
+    }
 }
 
 void Dimension::render(std::function<void(Model3D*)> f)
 {
-    for (Chunk* chunk : chunkList)
-    {
-        chunk->renderSolid(f);
-    }
-    for (Chunk* chunk : chunkList)
-    {
-        chunk->renderTransparent(f);
-    }
+    forAll(f);
 }
 
 bool Dimension::tick(std::function<void(Model3D*)> f, double time)

+ 8 - 9
FactoryCraft/FactoryClient.cpp

@@ -1,11 +1,11 @@
 #include "FactoryClient.h"
 
+#include <DX12Texture.h>
 #include <File.h>
 #include <FileSystem.h>
 #include <Image.h>
 #include <M3File.h>
 #include <RenderThread.h>
-#include <Texture.h>
 
 #include "Globals.h"
 #include "Load.h"
@@ -720,8 +720,6 @@ void FactoryClient::loadServerInfo()
     kam->setPosition(Vec3<float>(0, 0, 0));
     kam->setRotation(
         {(float)PI / 2.f, 0.f, std::atan2(0.f, -1.f) + (float)PI / 2});
-    Image* b = new Image();
-    b->newImage(50, 50, 0);
     for (int i = 0; i < itemTypeCount; i++)
     {
         Model3D* mdl = new Model3D();
@@ -745,22 +743,23 @@ void FactoryClient::loadServerInfo()
         mdl->setSize(itemTypes[i]->getSize());
         w->addDrawable(mdl);
         w->tick(0);
-        DX11Texture* t = (DX11Texture*)window->zScreen()
+        Image* b = new Image();
+        b->newImage(50, 50, 0);
+        DX12Texture* t = (DX12Texture*)window->zScreen()
                              ->zGraphicsApi()
                              ->createOrGetTexture(Text("rendered/items/")
                                                       + itemTypes[i]->getId(),
-                                 dynamic_cast<Image*>(b->getThis()));
+                                 b,
+                                 GPU_TO_RAM);
         renderThread->writeLock().lock();
         window->zScreen()->zGraphicsApi()->renderKamera(kam, t);
         renderThread->writeLock().unlock();
-        Image* result = new Image();
-        t->copyToImage(result);
-        itemTypes[i]->setBild(result);
+        t->updateTextur();
+        itemTypes[i]->setBild(dynamic_cast<Image*>(b->getThis()));
         t->release();
         w->removeDrawable(mdl);
         loadMenu->stageProgress(1);
     }
-    b->release();
     kam->release();
     loadMenu->allProgress(1);
 }

+ 30 - 28
FactoryCraft/FactoryCraft.vcxproj

@@ -188,7 +188,7 @@ copy "..\..\..\..\..\Allgemein\Network\x64\Release\Network.dll" "network.dll"</C
     <ClCompile Include="ChunkModelBuilder.cpp" />
     <ClCompile Include="CraftingGrid.cpp" />
     <ClCompile Include="CraftingRecipies.cpp" />
-    <ClCompile Include="CustomDX11API.cpp" />
+    <ClCompile Include="CustomDX12API.cpp" />
     <ClCompile Include="Dialog.cpp" />
     <ClCompile Include="Dimension.cpp" />
     <ClCompile Include="AddServerMenu.cpp" />
@@ -249,7 +249,7 @@ copy "..\..\..\..\..\Allgemein\Network\x64\Release\Network.dll" "network.dll"</C
     <ClInclude Include="Constants.h" />
     <ClInclude Include="CraftingGrid.h" />
     <ClInclude Include="CraftingRecipies.h" />
-    <ClInclude Include="CustomDX11API.h" />
+    <ClInclude Include="CustomDX12API.h" />
     <ClInclude Include="Dialog.h" />
     <ClInclude Include="Dimension.h" />
     <ClInclude Include="AddServerMenu.h" />
@@ -296,33 +296,35 @@ copy "..\..\..\..\..\Allgemein\Network\x64\Release\Network.dll" "network.dll"</C
     <ClInclude Include="World.h" />
   </ItemGroup>
   <ItemGroup>
-    <FxCompile Include="DX11CustomPixelShader.hlsl">
-      <ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Pixel</ShaderType>
-      <ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Pixel</ShaderType>
-      <ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Pixel</ShaderType>
-      <ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Pixel</ShaderType>
-      <EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">TexturePixelShader</EntryPointName>
-      <ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">5.0</ShaderModel>
-      <VariableName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CustomUIDX11PixelShader</VariableName>
-      <HeaderFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CustomUIDX11PixelShader.h</HeaderFileOutput>
-      <EntryPointName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">TexturePixelShader</EntryPointName>
-      <HeaderFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CustomUIDX11PixelShader.h</HeaderFileOutput>
-      <VariableName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CustomUIDX11PixelShader</VariableName>
-      <ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">5.0</ShaderModel>
+    <FxCompile Include="ClosestHit.hlsl">
+      <ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Library</ShaderType>
+      <ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">6.8</ShaderModel>
+      <VariableName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Custom%(Filename)Shader</VariableName>
+      <HeaderFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Custom%(Filename)Shader.h</HeaderFileOutput>
+      <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+      </ObjectFileOutput>
+      <AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">-Fd $(OutDir)%(Filename).pdb %(AdditionalOptions)</AdditionalOptions>
     </FxCompile>
-    <FxCompile Include="DX11CustomVertexShader.hlsl">
-      <ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Vertex</ShaderType>
-      <ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Vertex</ShaderType>
-      <ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Vertex</ShaderType>
-      <ShaderType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Vertex</ShaderType>
-      <EntryPointName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">TextureVertexShader</EntryPointName>
-      <ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">5.0</ShaderModel>
-      <VariableName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CustomUIDX11VertexShader</VariableName>
-      <HeaderFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">CustomUIDX11VertexShader.h</HeaderFileOutput>
-      <EntryPointName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">TextureVertexShader</EntryPointName>
-      <VariableName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CustomUIDX11VertexShader</VariableName>
-      <HeaderFileOutput Condition="'$(Configuration)|$(Platform)'=='Release|x64'">CustomUIDX11VertexShader.h</HeaderFileOutput>
-      <ShaderModel Condition="'$(Configuration)|$(Platform)'=='Release|x64'">5.0</ShaderModel>
+    <None Include="Common.hlsl">
+      <FileType>Document</FileType>
+    </None>
+    <FxCompile Include="Miss.hlsl">
+      <VariableName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Custom%(Filename)Shader</VariableName>
+      <ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Library</ShaderType>
+      <ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">6.8</ShaderModel>
+      <HeaderFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Custom%(Filename)Shader.h</HeaderFileOutput>
+      <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+      </ObjectFileOutput>
+      <AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">-Fd $(OutDir)%(Filename).pdb %(AdditionalOptions)</AdditionalOptions>
+    </FxCompile>
+    <FxCompile Include="RayGen.hlsl">
+      <ShaderType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Library</ShaderType>
+      <ShaderModel Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">6.8</ShaderModel>
+      <VariableName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Custom%(Filename)Shader</VariableName>
+      <HeaderFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Custom%(Filename)Shader.h</HeaderFileOutput>
+      <ObjectFileOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+      </ObjectFileOutput>
+      <AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">-Fd $(OutDir)%(Filename).pdb %(AdditionalOptions)</AdditionalOptions>
     </FxCompile>
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

+ 12 - 4
FactoryCraft/FactoryCraft.vcxproj.filters

@@ -154,7 +154,7 @@
     <ClCompile Include="DragElement.cpp">
       <Filter>Menu\Drag</Filter>
     </ClCompile>
-    <ClCompile Include="CustomDX11API.cpp">
+    <ClCompile Include="CustomDX12API.cpp">
       <Filter>graphics</Filter>
     </ClCompile>
     <ClCompile Include="UIMLToolTip.cpp">
@@ -336,7 +336,7 @@
     <ClInclude Include="DragElement.h">
       <Filter>Menu\Drag</Filter>
     </ClInclude>
-    <ClInclude Include="CustomDX11API.h">
+    <ClInclude Include="CustomDX12API.h">
       <Filter>graphics</Filter>
     </ClInclude>
     <ClInclude Include="UIMLToolTip.h">
@@ -440,11 +440,19 @@
     </ClInclude>
   </ItemGroup>
   <ItemGroup>
-    <FxCompile Include="DX11CustomVertexShader.hlsl">
+    <FxCompile Include="RayGen.hlsl">
       <Filter>graphics\shader</Filter>
     </FxCompile>
-    <FxCompile Include="DX11CustomPixelShader.hlsl">
+    <FxCompile Include="ClosestHit.hlsl">
       <Filter>graphics\shader</Filter>
     </FxCompile>
+    <FxCompile Include="Miss.hlsl">
+      <Filter>graphics\shader</Filter>
+    </FxCompile>
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="Common.hlsl">
+      <Filter>graphics\shader</Filter>
+    </None>
   </ItemGroup>
 </Project>

+ 7 - 21
FactoryCraft/FactoryCraftModel.cpp

@@ -2,7 +2,7 @@
 
 #include <Shader.h>
 
-#include "CustomDX11API.h"
+#include "CustomDX12API.h"
 #include "Globals.h"
 #include "World.h"
 
@@ -22,7 +22,7 @@ FactoryCraftModel::FactoryCraftModel()
     *(int*)averageLight = 0xFFFFFF00;
     fallbackVertexLightBuffer = uiFactory.initParam.bildschirm->zGraphicsApi()
                                     ->createStructuredBuffer(16);
-    fallbackVertexLightBuffer->setData(averageLight);
+    fallbackVertexLightBuffer->setData(averageLight, 1);
 }
 
 FactoryCraftModel::~FactoryCraftModel()
@@ -44,9 +44,11 @@ void FactoryCraftModel::beforeRender(Framework::GraphicsApi* api,
     Framework::Shader* zPixelShader)
 {
     if (!World::INSTANCE) return;
-    CustomDX11API* cApi = dynamic_cast<CustomDX11API*>(api);
+    CustomDX12API* cApi = dynamic_cast<CustomDX12API*>(api);
     if (cApi)
     {
+        /*
+        * TODO: set vertex and index and light buffer in shader binding table
         char buffer[8];
         *(int*)buffer
             = vertexLightBufferCount == 0 ? 1 : vertexLightBufferCount;
@@ -67,23 +69,7 @@ void FactoryCraftModel::beforeRender(Framework::GraphicsApi* api,
         {
             TexturEffect e = {1, 1.f + destroyedState};
             zPixelShader->fillConstBuffer((char*)&e, 3, sizeof(TexturEffect));
-        }
-    }
-}
-
-void FactoryCraftModel::afterRender(Framework::GraphicsApi* api,
-    Framework::Shader* zVertexShader,
-    Framework::Shader* zPixelShader)
-{
-    if (!World::INSTANCE) return;
-    CustomDX11API* cApi = dynamic_cast<CustomDX11API*>(api);
-    if (cApi)
-    {
-        char buffer[8];
-        *(int*)buffer = 0;
-        *(float*)(buffer + 4) = World::INSTANCE->getDayLightFactor();
-        zVertexShader->fillConstBuffer(
-            buffer, cApi->getVertexShaderLightBufferIndex(), 8);
+        }*/
     }
 }
 
@@ -100,7 +86,7 @@ void FactoryCraftModel::setVertexLightBuffer(__int64* data, int vertexCount)
     }
     lightBuffer = data;
     vertexLightBufferCount = vertexCount;
-    vertexLightBuffer->setData(data);
+    vertexLightBuffer->setData(data, 1);
     vertexLightBuffer->setLength(vertexCount * 8);
     vertexLightBuffer->setChanged();
 }

+ 0 - 3
FactoryCraft/FactoryCraftModel.h

@@ -22,9 +22,6 @@ protected:
     void beforeRender(Framework::GraphicsApi* api,
         Framework::Shader* zVertexShader,
         Framework::Shader* zPixelShader) override;
-    void afterRender(Framework::GraphicsApi* api,
-        Framework::Shader* zVertexShader,
-        Framework::Shader* zPixelShader) override;
 
 public:
     FactoryCraftModel();

+ 2 - 2
FactoryCraft/Main.cpp

@@ -11,7 +11,7 @@
 #include <Texture.h>
 #include <Window.h>
 
-#include "CustomDX11API.h"
+#include "CustomDX12API.h"
 #include "Globals.h"
 #include "Initialization.h"
 
@@ -183,7 +183,7 @@ int KSGStart Framework::Start(Framework::Startparam p)
     window.setMouseAction(_ret1ME);
     window.setKeyboardAction(_ret1TE);
     Screen3D screen(
-        dynamic_cast<NativeWindow*>(window.getThis()), new CustomDX11API());
+        dynamic_cast<NativeWindow*>(window.getThis()), new CustomDX12API());
     screen.setHandleUserInputsOnTick(0);
     window.setScreen(dynamic_cast<Screen*>(screen.getThis()));
     screen.setFillColor(0);

+ 7 - 0
FactoryCraft/Miss.hlsl

@@ -0,0 +1,7 @@
+#include "Common.hlsl"
+
+[shader("miss")]
+void Miss(inout HitInfo payload : SV_RayPayload)
+{
+    payload.colorAndDistance = float4(0.2f, 0.2f, 0.8f, -1.f);
+}

+ 26 - 0
FactoryCraft/RayGen.hlsl

@@ -0,0 +1,26 @@
+#include "Common.hlsl"
+
+// Raytracing output texture, accessed as a UAV
+RWTexture2D<float4> gOutput : register(u0);
+
+RWTexture2D<float4> guiTexture : register(u1);
+
+// Raytracing acceleration structure, accessed as a SRV
+RaytracingAccelerationStructure SceneBVH : register(t0);
+
+[shader("raygeneration")]
+void RayGen()
+{
+  // Initialize the ray payload
+    HitInfo payload;
+    payload.colorAndDistance = float4(0.9, 0.6, 0.2, 1.0);
+
+  // Get the location within the dispatched 2D grid of work items
+  // (often maps to pixels, so this could represent a pixel coordinate).
+    uint2 launchIndex = DispatchRaysIndex().xy;
+  
+    float4 guiColor = guiTexture[launchIndex];
+    gOutput[launchIndex] = float4(payload.colorAndDistance.rgb * (1 - guiColor.a) + guiColor.rgb * guiColor.a, 1.f);
+    gOutput[launchIndex] = float4(1.0, 1.0, 1.0, 1.0);
+
+}