Go to the documentation of this file.00001 "// #########################################################\n" \
00002 "// # Direct3D11 Default Basic Shader 2D (Shader Model 4.0) #\n" \
00003 "// #########################################################\n" \
00004 "//\n" \
00005 "// ========== Copyright (c) 2010 - Lukas Hermanns ==========\n" \
00006 "//\n" \
00007 "\n" \
00008 "Texture2D Texture : register(t0);\n" \
00009 "SamplerState Sampler : register(s0);\n" \
00010 "\n" \
00011 "cbuffer BufferBasic : register(b0)\n" \
00012 "{\n" \
00013 " float4x4 ProjectionMatrix;\n" \
00014 " float4 ImageRect;\n" \
00015 "};\n" \
00016 "\n" \
00017 "struct VertexInput\n" \
00018 "{\n" \
00019 " uint Index : SV_VertexID;\n" \
00020 " float4 Position : POSITION;\n" \
00021 " float4 Color : COLOR;\n" \
00022 " float2 TexCoord : TEXCOORD0;\n" \
00023 "};\n" \
00024 "\n" \
00025 "struct VertexPixelExchange\n" \
00026 "{\n" \
00027 " float4 Position : SV_Position;\n" \
00028 " float4 Color : COLOR;\n" \
00029 " float2 TexCoord : TEXCOORD0;\n" \
00030 "};\n" \
00031 "\n" \
00032 "VertexPixelExchange VertexMain(VertexInput Input)\n" \
00033 "{\n" \
00034 " VertexPixelExchange Output = (VertexPixelExchange)0;\n" \
00035 " \n" \
00036 " switch (Input.Index)\n" \
00037 " {\n" \
00038 " case 0: Output.Position = float4(ImageRect.x, ImageRect.y, 0.0, 1.0); break;\n" \
00039 " case 1: Output.Position = float4(ImageRect.z, ImageRect.y, 0.0, 1.0); break;\n" \
00040 " case 2: Output.Position = float4(ImageRect.z, ImageRect.w, 0.0, 1.0); break;\n" \
00041 " case 3: Output.Position = float4(ImageRect.x, ImageRect.y, 0.0, 1.0); break;\n" \
00042 " case 4: Output.Position = float4(ImageRect.z, ImageRect.w, 0.0, 1.0); break;\n" \
00043 " case 5: Output.Position = float4(ImageRect.x, ImageRect.w, 0.0, 1.0); break;\n" \
00044 " }\n" \
00045 " \n" \
00046 " Output.Position = mul(ProjectionMatrix, Output.Position);\n" \
00047 " Output.Color = Input.Color;\n" \
00048 " Output.TexCoord = Input.TexCoord;\n" \
00049 " \n" \
00050 " return Output;\n" \
00051 "}\n" \
00052 "\n" \
00053 "float4 PixelMain(VertexPixelExchange Input) : SV_Target\n" \
00054 "{\n" \
00055 " return Texture.Sample(Sampler, Input.TexCoord) * Input.Color;\n" \
00056 "}\n" \
00057 "\n" \