diff options
| author | Miles Macklin <[email protected]> | 2017-06-09 13:41:15 +1200 |
|---|---|---|
| committer | Miles Macklin <[email protected]> | 2017-06-09 13:41:15 +1200 |
| commit | 688b5f42e9bfe498d7af7075d4d8f4429867f3a3 (patch) | |
| tree | 7e0d0e7c95298f0418723abd92f61ac6e16b055e /demo/d3d | |
| parent | Update README.md (diff) | |
| download | flex-1.2.0.beta.1.tar.xz flex-1.2.0.beta.1.zip | |
1.2.0.beta.11.2.0.beta.1
Diffstat (limited to 'demo/d3d')
57 files changed, 15859 insertions, 0 deletions
diff --git a/demo/d3d/appGraphCtx.h b/demo/d3d/appGraphCtx.h new file mode 100644 index 0000000..2c6300d --- /dev/null +++ b/demo/d3d/appGraphCtx.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#pragma once + +#define APP_GRAPH_CTX_API extern "C" __declspec(dllexport) + +struct SDL_Window; + +struct AppGraphCtx; + +struct AppGraphColor +{ + float r, g, b, a; +}; + +APP_GRAPH_CTX_API AppGraphCtx* AppGraphCtxCreate(int deviceID); + +APP_GRAPH_CTX_API bool AppGraphCtxUpdateSize(AppGraphCtx* context, SDL_Window* window, bool fullscreen, int numMSAASamples); + +APP_GRAPH_CTX_API void AppGraphCtxReleaseRenderTarget(AppGraphCtx* context); + +APP_GRAPH_CTX_API void AppGraphCtxRelease(AppGraphCtx* context); + +APP_GRAPH_CTX_API void AppGraphCtxFrameStart(AppGraphCtx* context, AppGraphColor clearColor); + +APP_GRAPH_CTX_API void AppGraphCtxFramePresent(AppGraphCtx* context, bool fullsync); + +APP_GRAPH_CTX_API void AppGraphCtxWaitForFrames(AppGraphCtx* context, unsigned int maxFramesInFlight); + +APP_GRAPH_CTX_API void AppGraphCtxProfileEnable(AppGraphCtx* context, bool enabled); + +APP_GRAPH_CTX_API void AppGraphCtxProfileBegin(AppGraphCtx* context, const char* label); + +APP_GRAPH_CTX_API void AppGraphCtxProfileEnd(AppGraphCtx* context, const char* label); + +APP_GRAPH_CTX_API bool AppGraphCtxProfileGet(AppGraphCtx* context, const char** plabel, float* cpuTime, float* gpuTime, int index); + +APP_GRAPH_CTX_API size_t AppGraphCtxDedicatedVideoMemory(AppGraphCtx* context); + diff --git a/demo/d3d/appGraphCtxLoader.cpp b/demo/d3d/appGraphCtxLoader.cpp new file mode 100644 index 0000000..07375b8 --- /dev/null +++ b/demo/d3d/appGraphCtxLoader.cpp @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#include <SDL.h> + +#include "loader.h" +#include "loaderMacros.h" + +#include "appGraphCtx.h" + +#include <stdio.h> + +#define LOADER_APPC_CTX_FUNCTIONS(op, inst, inst_func) \ + op(inst, inst_func, AppGraphCtx*, AppGraphCtxCreate, 1, ((int, deviceID)) ) \ + op(inst, inst_func, bool, AppGraphCtxUpdateSize, 4, ((AppGraphCtx*, context), (SDL_Window*, window), (bool, fullscreen), (int, numMSAASamples)) ) \ + op(inst, inst_func, void, AppGraphCtxReleaseRenderTarget, 1, ((AppGraphCtx*, context)) ) \ + op(inst, inst_func, void, AppGraphCtxRelease, 1, ((AppGraphCtx*, context)) ) \ + op(inst, inst_func, void, AppGraphCtxFrameStart, 2, ((AppGraphCtx*, context), (AppGraphColor, clearColor)) ) \ + op(inst, inst_func, void, AppGraphCtxFramePresent, 2, ((AppGraphCtx*, context), (bool, fullsync)) ) \ + op(inst, inst_func, void, AppGraphCtxWaitForFrames, 2, ((AppGraphCtx*, context), (unsigned int, maxFramesInFlight)) ) \ + op(inst, inst_func, void, AppGraphCtxProfileEnable, 2, ((AppGraphCtx*, context), (bool, enabled)) ) \ + op(inst, inst_func, void, AppGraphCtxProfileBegin, 2, ((AppGraphCtx*, context), (const char*, label)) ) \ + op(inst, inst_func, void, AppGraphCtxProfileEnd, 2, ((AppGraphCtx*, context), (const char*, label)) ) \ + op(inst, inst_func, bool, AppGraphCtxProfileGet, 5, ((AppGraphCtx*, context), (const char**, plabel), (float*, cpuTime), (float*, gpuTime), (int, index)) ) \ + op(inst, inst_func, size_t, AppGraphCtxDedicatedVideoMemory, 1, ((AppGraphCtx*, context)) ) + +LOADER_APPC_CTX_FUNCTIONS(LOADER_DECLARE_FUNCTION_PTR, (), ()) + +struct AppCtxFunctionSet +{ + LOADER_APPC_CTX_FUNCTIONS(LOADER_DECLARE_FUNCTION_VAR, (), ()) +}; + +// Declare D3D11/D3D12 versions +#define APP_CTX_D3D11_FUNCTION_NAME(x) x##D3D11 +#define APP_CTX_D3D12_FUNCTION_NAME(x) x##D3D12 + +extern "C" { + +LOADER_APPC_CTX_FUNCTIONS(LOADER_DECLARE_FUNCTION_NAME, (), APP_CTX_D3D11_FUNCTION_NAME) +LOADER_APPC_CTX_FUNCTIONS(LOADER_DECLARE_FUNCTION_NAME, (), APP_CTX_D3D12_FUNCTION_NAME) + +} // extern "C" + +static AppCtxFunctionSet g_functionSet; + +void loadAppGraphCtx(AppGraphCtxType type) +{ + if (type == APP_CONTEXT_D3D11) + { + LOADER_APPC_CTX_FUNCTIONS(LOADER_SET_FUNCTION, g_functionSet, APP_CTX_D3D11_FUNCTION_NAME) + } + if (type == APP_CONTEXT_D3D12) + { + LOADER_APPC_CTX_FUNCTIONS(LOADER_SET_FUNCTION, g_functionSet, APP_CTX_D3D12_FUNCTION_NAME) + } +} + +void unloadAppGraphCtx() +{ + g_functionSet = AppCtxFunctionSet{}; +} + +// Generate the patches +LOADER_APPC_CTX_FUNCTIONS(LOADER_FUNCTION_PTR_CALL, g_functionSet, ()) diff --git a/demo/d3d/demoContext.h b/demo/d3d/demoContext.h new file mode 100644 index 0000000..bca41f0 --- /dev/null +++ b/demo/d3d/demoContext.h @@ -0,0 +1,93 @@ +/* +* Copyright (c) 2008-2016, NVIDIA CORPORATION. All rights reserved. +* +* NVIDIA CORPORATION and its licensors retain all intellectual property +* and proprietary rights in and to this software, related documentation +* and any modifications thereto. Any use, reproduction, disclosure or +* distribution of this software and related documentation without an express +* license agreement from NVIDIA CORPORATION is strictly prohibited. +*/ + +#ifndef DEMO_CONTEXT_H +#define DEMO_CONTEXT_H + +#include "shaders.h" + +//#include "../d3d/imguiGraph.h" + +class DemoContext +{ + public: + /// Returns false if couldn't start up + virtual bool initialize(const RenderInitOptions& options) = 0; + + virtual void startFrame(Vec4 colorIn) = 0; + virtual void endFrame() = 0; + virtual void presentFrame(bool fullsync) = 0; + + virtual void getViewRay(int x, int y, Vec3& origin, Vec3& dir) = 0; + virtual void setView(Matrix44 view, Matrix44 projection) = 0; + virtual void renderEllipsoids(FluidRenderer* renderer, FluidRenderBuffers* buffers, int n, int offset, float radius, float screenWidth, float screenAspect, float fov, Vec3 lightPos, Vec3 lightTarget, Matrix44 lightTransform, ::ShadowMap* shadowMap, Vec4 color, float blur, float ior, bool debug) = 0; + + virtual void drawMesh(const Mesh* m, Vec3 color) = 0; + virtual void drawCloth(const Vec4* positions, const Vec4* normals, const float* uvs, const int* indices, int numTris, int numPositions, int colorIndex, float expand, bool twosided, bool smooth) = 0; + virtual void drawRope(Vec4* positions, int* indices, int numIndices, float radius, int color) = 0; + virtual void drawPlane(const Vec4& p, bool color) = 0; + virtual void drawPlanes(Vec4* planes, int n, float bias) = 0; + + virtual void graphicsTimerBegin() = 0; + virtual void graphicsTimerEnd() = 0; + + virtual float rendererGetDeviceTimestamps(unsigned long long* begin, unsigned long long* end, unsigned long long* freq) = 0; + + virtual void bindSolidShader(Vec3 lightPos, Vec3 lightTarget, Matrix44 lightTransform, ::ShadowMap* shadowMap, float bias, Vec4 fogColor) = 0; + virtual void unbindSolidShader() = 0; + + virtual ShadowMap* shadowCreate() = 0; + virtual void shadowDestroy(ShadowMap* map) = 0; + virtual void shadowBegin(ShadowMap* map) = 0; + virtual void shadowEnd() = 0; + + virtual FluidRenderer* createFluidRenderer(uint32_t width, uint32_t height) = 0; + virtual void destroyFluidRenderer(FluidRenderer* renderer) = 0; + + virtual FluidRenderBuffers* createFluidRenderBuffers(int numParticles, bool enableInterop) = 0; + virtual void drawPoints(FluidRenderBuffers* buffers, int n, int offset, float radius, float screenWidth, float screenAspect, float fov, Vec3 lightPos, Vec3 lightTarget, Matrix44 lightTransform, ::ShadowMap* shadowTex, bool showDensity) = 0; + virtual void updateFluidRenderBuffers(FluidRenderBuffers* buffers, NvFlexSolver* flex, bool anisotropy, bool density) = 0; + virtual void updateFluidRenderBuffers(FluidRenderBuffers* buffers, Vec4* particles, float* densities, Vec4* anisotropy1, Vec4* anisotropy2, Vec4* anisotropy3, int numParticles, int* indices, int numIndices) = 0; + virtual void destroyFluidRenderBuffers(FluidRenderBuffers* buffers) = 0; + + virtual GpuMesh* createGpuMesh(const Mesh* m) = 0; + virtual void destroyGpuMesh(GpuMesh* mesh) = 0; + virtual void drawGpuMesh(GpuMesh* m, const Matrix44& xform, const Vec3& color) = 0; + virtual void drawGpuMeshInstances(GpuMesh* m, const Matrix44* xforms, int n, const Vec3& color) = 0; + + virtual DiffuseRenderBuffers* createDiffuseRenderBuffers(int numDiffuseParticles, bool& enableInterop) = 0; + virtual void destroyDiffuseRenderBuffers(DiffuseRenderBuffers* buffers) = 0; + virtual void updateDiffuseRenderBuffers(DiffuseRenderBuffers* buffers, Vec4* diffusePositions, Vec4* diffuseVelocities, int numDiffuseParticles) = 0; + virtual void updateDiffuseRenderBuffers(DiffuseRenderBuffers* buffers, NvFlexSolver* solver) = 0; + virtual int getNumDiffuseRenderParticles(DiffuseRenderBuffers* buffers) = 0; + + virtual void drawDiffuse(FluidRenderer* render, const DiffuseRenderBuffers* buffers, int n, float radius, float screenWidth, float screenAspect, float fov, Vec4 color, Vec3 lightPos, Vec3 lightTarget, Matrix44 lightTransform, ::ShadowMap* shadowMap, float motionBlur, float inscatter, float outscatter, bool shadowEnabled, bool front) = 0; + + virtual void beginLines() = 0; + virtual void drawLine(const Vec3& p, const Vec3& q, const Vec4& color) = 0; + virtual void endLines() = 0; + + virtual void onSizeChanged(int width, int height, bool minimized) = 0; + + virtual void startGpuWork() = 0; + virtual void endGpuWork() = 0; + virtual void flushGraphicsAndWait() = 0; + + virtual void setFillMode(bool wire) = 0; + virtual void setCullMode(bool enabled) = 0; + + virtual void drawImguiGraph() = 0; + virtual void* getGraphicsCommandQueue() { return nullptr; } + virtual void getRenderDevice(void** device, void** context) = 0; + + virtual ~DemoContext() {} +}; + +#endif // DEMO_CONTEXT_H
\ No newline at end of file diff --git a/demo/d3d/imguiGraph.cpp b/demo/d3d/imguiGraph.cpp new file mode 100644 index 0000000..7babb96 --- /dev/null +++ b/demo/d3d/imguiGraph.cpp @@ -0,0 +1,471 @@ +/* + * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#define _USE_MATH_DEFINES +#include <math.h> +#include "imgui.h" + +#include <stdio.h> +#include <stdint.h> + +#include "imguiGraph.h" + +// Some math headers don't have PI defined. +static const float PI = 3.14159265f; + +void imguifree(void* ptr, void* userptr); +void* imguimalloc(size_t size, void* userptr); + +#define STBTT_malloc(x,y) imguimalloc(x,y) +#define STBTT_free(x,y) imguifree(x,y) +#define STB_TRUETYPE_IMPLEMENTATION +#include "stb_truetype.h" + +void imguifree(void* ptr, void* /*userptr*/) +{ + free(ptr); +} + +void* imguimalloc(size_t size, void* /*userptr*/) +{ + return malloc(size); +} + +static const unsigned TEMP_COORD_COUNT = 100; +static float g_tempCoords[TEMP_COORD_COUNT * 2]; +static float g_tempNormals[TEMP_COORD_COUNT * 2]; + +static const int CIRCLE_VERTS = 8 * 4; +static float g_circleVerts[CIRCLE_VERTS * 2]; + +static stbtt_bakedchar g_cdata[96]; // ASCII 32..126 is 95 glyphs + +inline unsigned int RGBA(unsigned char r, unsigned char g, unsigned char b, unsigned char a) +{ + return (r) | (g << 8) | (b << 16) | (a << 24); +} + +static void drawPolygon(const float* coords, unsigned numCoords, float r, unsigned int col) +{ + if (numCoords > TEMP_COORD_COUNT) numCoords = TEMP_COORD_COUNT; + + for (unsigned i = 0, j = numCoords - 1; i < numCoords; j = i++) + { + const float* v0 = &coords[j * 2]; + const float* v1 = &coords[i * 2]; + float dx = v1[0] - v0[0]; + float dy = v1[1] - v0[1]; + float d = sqrtf(dx*dx + dy*dy); + if (d > 0) + { + d = 1.0f / d; + dx *= d; + dy *= d; + } + g_tempNormals[j * 2 + 0] = dy; + g_tempNormals[j * 2 + 1] = -dx; + } + + for (unsigned i = 0, j = numCoords - 1; i < numCoords; j = i++) + { + float dlx0 = g_tempNormals[j * 2 + 0]; + float dly0 = g_tempNormals[j * 2 + 1]; + float dlx1 = g_tempNormals[i * 2 + 0]; + float dly1 = g_tempNormals[i * 2 + 1]; + float dmx = (dlx0 + dlx1) * 0.5f; + float dmy = (dly0 + dly1) * 0.5f; + float dmr2 = dmx*dmx + dmy*dmy; + if (dmr2 > 0.000001f) + { + float scale = 1.0f / dmr2; + if (scale > 10.0f) scale = 10.0f; + dmx *= scale; + dmy *= scale; + } + g_tempCoords[i * 2 + 0] = coords[i * 2 + 0] + dmx*r; + g_tempCoords[i * 2 + 1] = coords[i * 2 + 1] + dmy*r; + } + + unsigned int colTrans = RGBA(col & 0xff, (col >> 8) & 0xff, (col >> 16) & 0xff, 0); + + imguiGraphColor4ubv((uint8_t*)&col); + + for (unsigned i = 0, j = numCoords - 1; i < numCoords; j = i++) + { + imguiGraphVertex2fv(&coords[i * 2]); + imguiGraphVertex2fv(&coords[j * 2]); + imguiGraphColor4ubv((uint8_t*)&colTrans); + imguiGraphVertex2fv(&g_tempCoords[j * 2]); + + imguiGraphVertex2fv(&g_tempCoords[j * 2]); + imguiGraphVertex2fv(&g_tempCoords[i * 2]); + + imguiGraphColor4ubv((uint8_t*)&col); + imguiGraphVertex2fv(&coords[i * 2]); + } + + imguiGraphColor4ubv((uint8_t*)&col); + for (unsigned i = 2; i < numCoords; ++i) + { + imguiGraphVertex2fv(&coords[0]); + imguiGraphVertex2fv(&coords[(i - 1) * 2]); + imguiGraphVertex2fv(&coords[i * 2]); + } +} + +static void drawRect(float x, float y, float w, float h, float fth, unsigned int col) +{ + float verts[4 * 2] = + { + x + 0.5f, y + 0.5f, + x + w - 0.5f, y + 0.5f, + x + w - 0.5f, y + h - 0.5f, + x + 0.5f, y + h - 0.5f, + }; + drawPolygon(verts, 4, fth, col); +} + +/* +static void drawEllipse(float x, float y, float w, float h, float fth, unsigned int col) +{ +float verts[CIRCLE_VERTS*2]; +const float* cverts = g_circleVerts; +float* v = verts; + +for (int i = 0; i < CIRCLE_VERTS; ++i) +{ +*v++ = x + cverts[i*2]*w; +*v++ = y + cverts[i*2+1]*h; +} + +drawPolygon(verts, CIRCLE_VERTS, fth, col); +} +*/ + +static void drawRoundedRect(float x, float y, float w, float h, float r, float fth, unsigned int col) +{ + const unsigned n = CIRCLE_VERTS / 4; + float verts[(n + 1) * 4 * 2]; + const float* cverts = g_circleVerts; + float* v = verts; + + for (unsigned i = 0; i <= n; ++i) + { + *v++ = x + w - r + cverts[i * 2] * r; + *v++ = y + h - r + cverts[i * 2 + 1] * r; + } + + for (unsigned i = n; i <= n * 2; ++i) + { + *v++ = x + r + cverts[i * 2] * r; + *v++ = y + h - r + cverts[i * 2 + 1] * r; + } + + for (unsigned i = n * 2; i <= n * 3; ++i) + { + *v++ = x + r + cverts[i * 2] * r; + *v++ = y + r + cverts[i * 2 + 1] * r; + } + + for (unsigned i = n * 3; i < n * 4; ++i) + { + *v++ = x + w - r + cverts[i * 2] * r; + *v++ = y + r + cverts[i * 2 + 1] * r; + } + *v++ = x + w - r + cverts[0] * r; + *v++ = y + r + cverts[1] * r; + + drawPolygon(verts, (n + 1) * 4, fth, col); +} + + +static void drawLine(float x0, float y0, float x1, float y1, float r, float fth, unsigned int col) +{ + float dx = x1 - x0; + float dy = y1 - y0; + float d = sqrtf(dx*dx + dy*dy); + if (d > 0.0001f) + { + d = 1.0f / d; + dx *= d; + dy *= d; + } + float nx = dy; + float ny = -dx; + float verts[4 * 2]; + r -= fth; + r *= 0.5f; + if (r < 0.01f) r = 0.01f; + dx *= r; + dy *= r; + nx *= r; + ny *= r; + + verts[0] = x0 - dx - nx; + verts[1] = y0 - dy - ny; + + verts[2] = x0 - dx + nx; + verts[3] = y0 - dy + ny; + + verts[4] = x1 + dx + nx; + verts[5] = y1 + dy + ny; + + verts[6] = x1 + dx - nx; + verts[7] = y1 + dy - ny; + + drawPolygon(verts, 4, fth, col); +} + +bool imguiGraphInit(const char* fontpath, float defaultFontHeight, const ImguiGraphDesc* desc) +{ + imguiGraphContextInit(desc); + + for (int i = 0; i < CIRCLE_VERTS; ++i) + { + float a = (float)i / (float)CIRCLE_VERTS * PI * 2; + g_circleVerts[i * 2 + 0] = cosf(a); + g_circleVerts[i * 2 + 1] = sinf(a); + } + + // Load font. + FILE* fp = fopen(fontpath, "rb"); + if (!fp) return false; + fseek(fp, 0, SEEK_END); + int size = ftell(fp); + fseek(fp, 0, SEEK_SET); + + unsigned char* ttfBuffer = (unsigned char*)malloc(size); + if (!ttfBuffer) + { + fclose(fp); + return false; + } + + size_t len = fread(ttfBuffer, 1, size, fp); + (void)len; + + fclose(fp); + fp = 0; + + unsigned char* bmap = (unsigned char*)malloc(512 * 512); + if (!bmap) + { + free(ttfBuffer); + return false; + } + + defaultFontHeight = (defaultFontHeight <= 0.0f) ? 15.0f : defaultFontHeight; + + stbtt_BakeFontBitmap(ttfBuffer, 0, defaultFontHeight, bmap, 512, 512, 32, 96, g_cdata); + + // can free ttf_buffer at this point + imguiGraphFontTextureInit(bmap); + + free(ttfBuffer); + free(bmap); + + return true; +} + +void imguiGraphUpdate(const ImguiGraphDesc* desc) +{ + imguiGraphContextUpdate(desc); +} + +void imguiGraphDestroy() +{ + imguiGraphFontTextureRelease(); + + imguiGraphContextDestroy(); +} + +static void getBakedQuad(stbtt_bakedchar *chardata, int pw, int ph, int char_index, + float *xpos, float *ypos, stbtt_aligned_quad *q) +{ + stbtt_bakedchar *b = chardata + char_index; + int round_x = STBTT_ifloor(*xpos + b->xoff); + int round_y = STBTT_ifloor(*ypos - b->yoff); + + q->x0 = (float)round_x; + q->y0 = (float)round_y; + q->x1 = (float)round_x + b->x1 - b->x0; + q->y1 = (float)round_y - b->y1 + b->y0; + + q->s0 = b->x0 / (float)pw; + q->t0 = b->y0 / (float)pw; + q->s1 = b->x1 / (float)ph; + q->t1 = b->y1 / (float)ph; + + *xpos += b->xadvance; +} + +static const float g_tabStops[4] = { 150, 210, 270, 330 }; + +static float getTextLength(stbtt_bakedchar *chardata, const char* text) +{ + float xpos = 0; + float len = 0; + while (*text) + { + int c = (unsigned char)*text; + if (c == '\t') + { + for (int i = 0; i < 4; ++i) + { + if (xpos < g_tabStops[i]) + { + xpos = g_tabStops[i]; + break; + } + } + } + else if (c >= 32 && c < 128) + { + stbtt_bakedchar *b = chardata + c - 32; + int round_x = STBTT_ifloor((xpos + b->xoff) + 0.5); + len = round_x + b->x1 - b->x0 + 0.5f; + xpos += b->xadvance; + } + ++text; + } + return len; +} + +static void drawText(float x, float y, const char *text, int align, unsigned int col) +{ + if (!text) return; + + if (align == IMGUI_ALIGN_CENTER) + x -= getTextLength(g_cdata, text) / 2; + else if (align == IMGUI_ALIGN_RIGHT) + x -= getTextLength(g_cdata, text); + + imguiGraphColor4ub(col & 0xff, (col >> 8) & 0xff, (col >> 16) & 0xff, (col >> 24) & 0xff); + + imguiGraphFontTextureEnable(); + + // assume orthographic projection with units = screen pixels, origin at top left + const float ox = x; + + while (*text) + { + int c = (unsigned char)*text; + if (c == '\t') + { + for (int i = 0; i < 4; ++i) + { + if (x < g_tabStops[i] + ox) + { + x = g_tabStops[i] + ox; + break; + } + } + } + else if (c >= 32 && c < 128) + { + stbtt_aligned_quad q; + getBakedQuad(g_cdata, 512, 512, c - 32, &x, &y, &q); + + imguiGraphTexCoord2f(q.s0, q.t0); + imguiGraphVertex2f(q.x0, q.y0); + imguiGraphTexCoord2f(q.s1, q.t1); + imguiGraphVertex2f(q.x1, q.y1); + imguiGraphTexCoord2f(q.s1, q.t0); + imguiGraphVertex2f(q.x1, q.y0); + + imguiGraphTexCoord2f(q.s0, q.t0); + imguiGraphVertex2f(q.x0, q.y0); + imguiGraphTexCoord2f(q.s0, q.t1); + imguiGraphVertex2f(q.x0, q.y1); + imguiGraphTexCoord2f(q.s1, q.t1); + imguiGraphVertex2f(q.x1, q.y1); + } + ++text; + } + + imguiGraphFontTextureDisable(); +} + + +void imguiGraphDraw() +{ + const imguiGfxCmd* q = imguiGetRenderQueue(); + int nq = imguiGetRenderQueueSize(); + + const float s = 1.0f / 8.0f; + + imguiGraphRecordBegin(); + + imguiGraphDisableScissor(); + for (int i = 0; i < nq; ++i) + { + const imguiGfxCmd& cmd = q[i]; + if (cmd.type == IMGUI_GFXCMD_RECT) + { + if (cmd.rect.r == 0) + { + drawRect((float)cmd.rect.x*s + 0.5f, (float)cmd.rect.y*s + 0.5f, + (float)cmd.rect.w*s - 1, (float)cmd.rect.h*s - 1, + 1.0f, cmd.col); + } + else + { + drawRoundedRect((float)cmd.rect.x*s + 0.5f, (float)cmd.rect.y*s + 0.5f, + (float)cmd.rect.w*s - 1, (float)cmd.rect.h*s - 1, + (float)cmd.rect.r*s, 1.0f, cmd.col); + } + } + else if (cmd.type == IMGUI_GFXCMD_LINE) + { + drawLine(cmd.line.x0*s, cmd.line.y0*s, cmd.line.x1*s, cmd.line.y1*s, cmd.line.r*s, 1.0f, cmd.col); + } + else if (cmd.type == IMGUI_GFXCMD_TRIANGLE) + { + if (cmd.flags == 1) + { + const float verts[3 * 2] = + { + (float)cmd.rect.x*s + 0.5f, (float)cmd.rect.y*s + 0.5f, + (float)cmd.rect.x*s + 0.5f + (float)cmd.rect.w*s - 1, (float)cmd.rect.y*s + 0.5f + (float)cmd.rect.h*s / 2 - 0.5f, + (float)cmd.rect.x*s + 0.5f, (float)cmd.rect.y*s + 0.5f + (float)cmd.rect.h*s - 1, + }; + drawPolygon(verts, 3, 1.0f, cmd.col); + } + if (cmd.flags == 2) + { + const float verts[3 * 2] = + { + (float)cmd.rect.x*s + 0.5f, (float)cmd.rect.y*s + 0.5f + (float)cmd.rect.h*s - 1, + (float)cmd.rect.x*s + 0.5f + (float)cmd.rect.w*s / 2 - 0.5f, (float)cmd.rect.y*s + 0.5f, + (float)cmd.rect.x*s + 0.5f + (float)cmd.rect.w*s - 1, (float)cmd.rect.y*s + 0.5f + (float)cmd.rect.h*s - 1, + }; + drawPolygon(verts, 3, 1.0f, cmd.col); + } + } + else if (cmd.type == IMGUI_GFXCMD_TEXT) + { + drawText(cmd.text.x, cmd.text.y, cmd.text.text, cmd.text.align, cmd.col); + } + else if (cmd.type == IMGUI_GFXCMD_SCISSOR) + { + if (cmd.flags) + { + imguiGraphEnableScissor(cmd.rect.x, cmd.rect.y, cmd.rect.w, cmd.rect.h); + } + else + { + imguiGraphDisableScissor(); + } + } + } + imguiGraphDisableScissor(); + + imguiGraphRecordEnd(); +} diff --git a/demo/d3d/imguiGraph.h b/demo/d3d/imguiGraph.h new file mode 100644 index 0000000..361fa7b --- /dev/null +++ b/demo/d3d/imguiGraph.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#pragma once + +#include <stdint.h> + +#define IMGUI_GRAPH_API extern "C" __declspec(dllexport) + +struct ImguiGraphDesc; + +typedef bool (*imguiGraphInit_t)(const char* fontpath, const ImguiGraphDesc* desc); + +typedef void (*imguiGraphUpdate_t)(const ImguiGraphDesc* desc); + +bool imguiGraphInit(const char* fontpath, float defaultFontHeight, const ImguiGraphDesc* desc); + +void imguiGraphUpdate(const ImguiGraphDesc* desc); + +void imguiGraphDestroy(); + +void imguiGraphDraw(); + +// Below are the functions that must be implemented per graphics API + +IMGUI_GRAPH_API void imguiGraphContextInit(const ImguiGraphDesc* desc); + +IMGUI_GRAPH_API void imguiGraphContextUpdate(const ImguiGraphDesc* desc); + +IMGUI_GRAPH_API void imguiGraphContextDestroy(); + +IMGUI_GRAPH_API void imguiGraphRecordBegin(); + +IMGUI_GRAPH_API void imguiGraphRecordEnd(); + +IMGUI_GRAPH_API void imguiGraphVertex2f(float x, float y); + +IMGUI_GRAPH_API void imguiGraphVertex2fv(const float* v); + +IMGUI_GRAPH_API void imguiGraphTexCoord2f(float u, float v); + +IMGUI_GRAPH_API void imguiGraphColor4ub(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha); + +IMGUI_GRAPH_API void imguiGraphColor4ubv(const uint8_t* v); + +IMGUI_GRAPH_API void imguiGraphFontTextureEnable(); + +IMGUI_GRAPH_API void imguiGraphFontTextureDisable(); + +IMGUI_GRAPH_API void imguiGraphEnableScissor(int x, int y, int width, int height); + +IMGUI_GRAPH_API void imguiGraphDisableScissor(); + +IMGUI_GRAPH_API void imguiGraphFontTextureInit(unsigned char* data); + +IMGUI_GRAPH_API void imguiGraphFontTextureRelease();
\ No newline at end of file diff --git a/demo/d3d/imguiGraphLoader.cpp b/demo/d3d/imguiGraphLoader.cpp new file mode 100644 index 0000000..6c5dbce --- /dev/null +++ b/demo/d3d/imguiGraphLoader.cpp @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +//#include <SDL.h> + +#include "loader.h" + +#include "imguiGraph.h" +#include "loaderMacros.h" + +#include <stdio.h> + +#include "imguiGraph.h" + +struct AppGraphCtx; + +#define LOADER_IMGUI_GRAPH_FUNCTIONS(op, inst, inst_func) \ + op(inst, inst_func, void, imguiGraphContextInit, 1, ((const ImguiGraphDesc*, desc)) ) \ + op(inst, inst_func, void, imguiGraphContextUpdate, 1, ((const ImguiGraphDesc*, desc)) ) \ + op(inst, inst_func, void, imguiGraphContextDestroy, 0, (()) ) \ + op(inst, inst_func, void, imguiGraphRecordBegin, 0, (()) ) \ + op(inst, inst_func, void, imguiGraphRecordEnd, 0, (()) ) \ + op(inst, inst_func, void, imguiGraphVertex2f, 2, ((float, x), (float, y)) ) \ + op(inst, inst_func, void, imguiGraphVertex2fv, 1, ((const float*, v)) ) \ + op(inst, inst_func, void, imguiGraphTexCoord2f, 2, ((float, u), (float, v)) ) \ + op(inst, inst_func, void, imguiGraphColor4ub, 4, ((uint8_t, red), (uint8_t, green), (uint8_t, blue), (uint8_t, alpha)) ) \ + op(inst, inst_func, void, imguiGraphColor4ubv, 1, ((const uint8_t*, v)) ) \ + op(inst, inst_func, void, imguiGraphFontTextureEnable, 0, (()) ) \ + op(inst, inst_func, void, imguiGraphFontTextureDisable, 0, (()) ) \ + op(inst, inst_func, void, imguiGraphEnableScissor, 4, ((int, x), (int, y), (int, width), (int, height)) ) \ + op(inst, inst_func, void, imguiGraphDisableScissor, 0, (()) ) \ + op(inst, inst_func, void, imguiGraphFontTextureInit, 1, ((unsigned char*, data)) ) \ + op(inst, inst_func, void, imguiGraphFontTextureRelease, 0, (()) ) \ + op(inst, inst_func, bool, imguiInteropGraphInit, 3, ((imguiGraphInit_t, func), (const char*, fontpath), (AppGraphCtx*, appctx)) ) \ + op(inst, inst_func, void, imguiInteropGraphUpdate, 2, ((imguiGraphUpdate_t, func), (AppGraphCtx*, appctx)) ) + +LOADER_IMGUI_GRAPH_FUNCTIONS(LOADER_DECLARE_FUNCTION_PTR, (), ()) + +struct ImguiFunctionSet +{ +LOADER_IMGUI_GRAPH_FUNCTIONS(LOADER_DECLARE_FUNCTION_VAR, (), ()) +}; + +// Declare D3D11/D3D12 versions +#define IMGUI_D3D11_FUNCTION_NAME(x) x##D3D11 +#define IMGUI_D3D12_FUNCTION_NAME(x) x##D3D12 + +extern "C" { + +LOADER_IMGUI_GRAPH_FUNCTIONS(LOADER_DECLARE_FUNCTION_NAME, (), IMGUI_D3D11_FUNCTION_NAME) +LOADER_IMGUI_GRAPH_FUNCTIONS(LOADER_DECLARE_FUNCTION_NAME, (), IMGUI_D3D12_FUNCTION_NAME) + +} // extern "C" + +static ImguiFunctionSet g_functionSet; + +void loadImgui(AppGraphCtxType type) +{ + if (type == APP_CONTEXT_D3D11) + { + LOADER_IMGUI_GRAPH_FUNCTIONS(LOADER_SET_FUNCTION, g_functionSet, IMGUI_D3D11_FUNCTION_NAME) + } + if (type == APP_CONTEXT_D3D12) + { + LOADER_IMGUI_GRAPH_FUNCTIONS(LOADER_SET_FUNCTION, g_functionSet, IMGUI_D3D12_FUNCTION_NAME) + } +} + +void unloadImgui() +{ + g_functionSet = ImguiFunctionSet{}; +} + +// Generate the patches +LOADER_IMGUI_GRAPH_FUNCTIONS(LOADER_FUNCTION_PTR_CALL, g_functionSet, ()) + + diff --git a/demo/d3d/loader.cpp b/demo/d3d/loader.cpp new file mode 100644 index 0000000..2ade2be --- /dev/null +++ b/demo/d3d/loader.cpp @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#include "loader.h" + +//#include <SDL.h> + +#include "imgui.h" + +void loadModules(AppGraphCtxType type) +{ + loadAppGraphCtx(type); + loadImgui(type); +} + +void unloadModules() +{ + unloadImgui(); + unloadAppGraphCtx(); +}
\ No newline at end of file diff --git a/demo/d3d/loader.h b/demo/d3d/loader.h new file mode 100644 index 0000000..1696001 --- /dev/null +++ b/demo/d3d/loader.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +enum AppGraphCtxType +{ + APP_CONTEXT_D3D11 = 1, + APP_CONTEXT_D3D12 = 2 +}; + +void loadModules(AppGraphCtxType type); +void unloadModules(); + +extern void loadImgui(AppGraphCtxType type); +extern void unloadImgui(); + +extern void loadAppGraphCtx(AppGraphCtxType type); +extern void unloadAppGraphCtx(); diff --git a/demo/d3d/loaderMacros.h b/demo/d3d/loaderMacros.h new file mode 100644 index 0000000..24b4999 --- /dev/null +++ b/demo/d3d/loaderMacros.h @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + #pragma once + +/// ----------------------------- Module Loader ----------------------------- + +#define LOADER_ESC_N(...) __VA_ARGS__ + +#define LOADER_PARAM_DECLARE(a, b) a b +#define LOADER_PARAM_NAME(a, b) b + +#define LOADER_ESC_PARAM0(PARAM, p0) +#define LOADER_ESC_PARAM1(PARAM, p0) PARAM p0 +#define LOADER_ESC_PARAM2(PARAM, p0, p1) PARAM p0, LOADER_ESC_PARAM1(PARAM, p1) +#define LOADER_ESC_PARAM3(PARAM, p0, p1, p2) PARAM p0, LOADER_ESC_PARAM2(PARAM, p1, p2) +#define LOADER_ESC_PARAM4(PARAM, p0, p1, p2, p3) PARAM p0, LOADER_ESC_PARAM3(PARAM, p1, p2, p3) +#define LOADER_ESC_PARAM5(PARAM, p0, p1, p2, p3, p4) PARAM p0, LOADER_ESC_PARAM4(PARAM, p1, p2, p3, p4) +#define LOADER_ESC_PARAM6(PARAM, p0, p1, p2, p3, p4, p5) PARAM p0, LOADER_ESC_PARAM5(PARAM, p1, p2, p3, p4, p5) +#define LOADER_ESC_PARAM7(PARAM, p0, p1, p2, p3, p4, p5, p6) PARAM p0, LOADER_ESC_PARAM6(PARAM, p1, p2, p3, p4, p5, p6) + +#define LOADER_ESC_MERGE(a, b) (a, b) + +#define LOADER_ESC(mode, numParams, params) \ + LOADER_ESC_PARAM##numParams LOADER_ESC_MERGE(mode, LOADER_ESC_N params) + +#define LOADER_DECLARE_FUNCTION_PTR(inst, inst_func, retType, method, numParams, params) \ + typedef retType (*method##_ptr_t)( LOADER_ESC (LOADER_PARAM_DECLARE, numParams, params) ); + +#define LOADER_DECLARE_FUNCTION_VAR(inst, inst_func, retType, method, numParams, params) \ + method##_ptr_t method##_ptr; + +#define LOADER_DECLARE_FUNCTION_NAME(inst, inst_func, retType, method, numParams, params) \ + extern retType inst_func(method) (LOADER_ESC (LOADER_PARAM_DECLARE, numParams, params) ); + +#define LOADER_SET_FUNCTION(inst, inst_func, retType, method, numParams, params) \ + inst.method##_ptr = inst_func(method); + + +#define LOADER_FUNCTION_PTR_CALL(inst, inst_func, retType, method, numParams, params) \ + retType method( LOADER_ESC (LOADER_PARAM_DECLARE, numParams, params) ) { \ + return inst.method##_ptr( LOADER_ESC (LOADER_PARAM_NAME, numParams, params) ); \ + } + +#define LOADER_LOAD_FUNCTION_PTR(inst, inst_func, retType, method, numParams, params) \ + inst->method##_ptr = (retType (*)( LOADER_ESC (LOADER_PARAM_DECLARE, numParams, params) ))(inst_func(inst, #method)); + +#define LOADER_CLEAR_FUNCTION_PTR(inst, inst_func, retType, method, numParams, params) \ + inst->method##_ptr = nullptr; + +#define LOADER_DECLARE_FUNCTION(inst, inst_func, retType, method, numParams, params) \ + retType method( LOADER_ESC (LOADER_PARAM_DECLARE, numParams, params) ); + +#define LOADER_FUNCTION_IMPL(inst, inst_func, retType, method, numParams, params) \ + retType method( LOADER_ESC (LOADER_PARAM_DECLARE, numParams, params) ) { \ + return method##Impl( LOADER_ESC (LOADER_PARAM_NAME, numParams, params) ); \ + } + diff --git a/demo/d3d/renderParamsD3D.cpp b/demo/d3d/renderParamsD3D.cpp new file mode 100644 index 0000000..22962ba --- /dev/null +++ b/demo/d3d/renderParamsD3D.cpp @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2008-2017, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#include "renderParamsD3D.h" + +/* static */void RenderParamsUtilD3D::calcShadowParams(Vec3 lightPos, Vec3 lightTarget, Matrix44 lightTransform, float shadowBias, ShadowParamsD3D* paramsOut) +{ + paramsOut->lightTransform = (DirectX::XMMATRIX&)(convertGLToD3DProjection(lightTransform)); + paramsOut->lightPos = (float3&)lightPos; + paramsOut->lightDir = (float3&)Normalize(lightTarget - lightPos); + paramsOut->bias = shadowBias; + + const Vec4 taps[] = + { + Vec2(-0.326212f,-0.40581f), Vec2(-0.840144f,-0.07358f), + Vec2(-0.695914f,0.457137f), Vec2(-0.203345f,0.620716f), + Vec2(0.96234f,-0.194983f), Vec2(0.473434f,-0.480026f), + Vec2(0.519456f,0.767022f), Vec2(0.185461f,-0.893124f), + Vec2(0.507431f,0.064425f), Vec2(0.89642f,0.412458f), + Vec2(-0.32194f,-0.932615f), Vec2(-0.791559f,-0.59771f) + }; + memcpy(paramsOut->shadowTaps, taps, sizeof(taps)); +} + +Matrix44 RenderParamsUtilD3D::convertGLToD3DProjection(const Matrix44& proj) +{ + Matrix44 scale = Matrix44::kIdentity; + scale.columns[2][2] = 0.5f; + + Matrix44 bias = Matrix44::kIdentity; + bias.columns[3][2] = 1.0f; + + return scale*bias*proj; +} + +/* static */void RenderParamsUtilD3D::calcMeshConstantBuffer(const MeshDrawParamsD3D& params, Hlsl::MeshShaderConst& constBuf) +{ + constBuf.modelViewProjection = (float4x4&)(XMMatrixMultiply(XMMatrixMultiply(params.model, params.view), params.projection)); + + constBuf.modelView = (float4x4&)XMMatrixMultiply(params.model, params.view); + + constBuf.objectTransform = (float4x4&)params.objectTransform; + constBuf.lightTransform = (float4x4&)params.lightTransform; + + constBuf.clipPlane = params.clipPlane; + constBuf.fogColor = params.fogColor; + constBuf.color = params.color; + constBuf.secondaryColor = params.secondaryColor; + + constBuf.lightPos = params.lightPos; + constBuf.lightDir = params.lightDir; + + constBuf.bias = params.bias; + constBuf.expand = params.expand; + constBuf.spotMin = params.spotMin; + constBuf.spotMax = params.spotMax; + + constBuf.grid = params.grid; + constBuf.tex = params.tex; + constBuf.colorArray = params.colorArray; + + memcpy(constBuf.shadowTaps, params.shadowTaps, sizeof(constBuf.shadowTaps)); +} + +/* static */void RenderParamsUtilD3D::calcFluidConstantBuffer(const FluidDrawParamsD3D& params, Hlsl::FluidShaderConst& constBuf) +{ + constBuf.modelViewProjection = (Hlsl::float4x4&)(XMMatrixMultiply(XMMatrixMultiply(params.model, params.view), params.projection)); + constBuf.projection = (Hlsl::float4x4&)params.projection; + constBuf.inverseModelView = (Hlsl::float4x4&)XMMatrixInverse(nullptr, XMMatrixMultiply(params.model, params.view)); + constBuf.inverseProjection = (Hlsl::float4x4&)XMMatrixInverse(nullptr, params.projection); + + //constBuf.invTexScale = invTexScale; + //constBuf.invProjection = invProjection; + constBuf.invViewport = params.invViewport; + + constBuf.blurRadiusWorld = params.blurRadiusWorld; + constBuf.blurScale = params.blurScale; + constBuf.blurFalloff = params.blurFalloff; + constBuf.debug = params.debug; +} + +/* static */void RenderParamsUtilD3D::calcDiffuseConstantBuffer(const DiffuseDrawParamsD3D& params, Hlsl::DiffuseShaderConst& constBuf) +{ + using namespace DirectX; + + XMMATRIX modelViewProj = XMMatrixMultiply(XMMatrixMultiply(params.model, params.view), params.projection); + constBuf.modelViewProjection = (Hlsl::float4x4&)modelViewProj; + XMMATRIX modelView = XMMatrixMultiply(params.model, params.view); + constBuf.modelView = (Hlsl::float4x4&)modelView; + constBuf.projection = (Hlsl::float4x4&)params.projection; + + constBuf.motionBlurScale = params.motionScale; + constBuf.diffuseRadius = params.diffuseRadius; + constBuf.diffuseScale = params.diffuseScale; + constBuf.spotMin = params.spotMin; + constBuf.spotMax = params.spotMax; + + constBuf.lightTransform = (Hlsl::float4x4&)params.lightTransform; + constBuf.lightPos = params.lightPos; + constBuf.lightDir = params.lightDir; + constBuf.color = params.color; + + memcpy(constBuf.shadowTaps, params.shadowTaps, sizeof(constBuf.shadowTaps)); +} + +/* static */void RenderParamsUtilD3D::calcFluidCompositeConstantBuffer(const FluidDrawParamsD3D& params, Hlsl::FluidShaderConst& constBuf) +{ + constBuf.modelViewProjection = (Hlsl::float4x4&)(XMMatrixMultiply(XMMatrixMultiply(params.model, params.view), params.projection)); + constBuf.modelView = (Hlsl::float4x4&)XMMatrixMultiply(params.model, params.view); + constBuf.projection = (Hlsl::float4x4&)params.projection; + constBuf.inverseModelView = (Hlsl::float4x4&)XMMatrixInverse(nullptr, XMMatrixMultiply(params.model, params.view)); + constBuf.inverseProjection = (Hlsl::float4x4&)XMMatrixInverse(nullptr, params.projection); + + constBuf.lightTransform = (Hlsl::float4x4&)params.lightTransform; + + constBuf.invTexScale = params.invTexScale; + + //constBuf.invViewport = params.invViewport; + //constBuf.invProjection = params.invProjection; + + constBuf.blurRadiusWorld = params.blurRadiusWorld; + constBuf.blurScale = params.blurScale; + constBuf.blurFalloff = params.blurFalloff; + constBuf.debug = params.debug; + + constBuf.clipPosToEye = params.clipPosToEye; + constBuf.color = params.color; + constBuf.ior = params.ior; + constBuf.spotMin = params.spotMin; + constBuf.spotMax = params.spotMax; + + constBuf.lightPos = params.lightPos; + constBuf.lightDir = params.lightDir; + + typedef DirectX::XMFLOAT2 float2; + const float2 taps[] = + { + float2(-0.326212f,-0.40581f), float2(-0.840144f,-0.07358f), + float2(-0.695914f,0.457137f), float2(-0.203345f,0.620716f), + float2(0.96234f,-0.194983f), float2(0.473434f,-0.480026f), + float2(0.519456f,0.767022f), float2(0.185461f,-0.893124f), + float2(0.507431f,0.064425f), float2(0.89642f,0.412458f), + float2(-0.32194f,-0.932615f), float2(-0.791559f,-0.59771f) + }; + memcpy(constBuf.shadowTaps, taps, sizeof(taps)); +} + +/* static */void RenderParamsUtilD3D::calcPointConstantBuffer(const PointDrawParamsD3D& params, Hlsl::PointShaderConst& constBuf) +{ + using namespace DirectX; + + constBuf.modelView = (float4x4&)XMMatrixMultiply(params.model, params.view); + constBuf.projection = (float4x4&)params.projection; + + constBuf.pointRadius = params.pointRadius; + constBuf.pointScale = params.pointScale; + constBuf.spotMin = params.spotMin; + constBuf.spotMax = params.spotMax; + + constBuf.lightTransform = (float4x4&)params.lightTransform; + constBuf.lightPos = params.lightPos; + constBuf.lightDir = params.lightDir; + + for (int i = 0; i < 8; i++) + constBuf.colors[i] = params.colors[i]; + + memcpy(constBuf.shadowTaps, params.shadowTaps, sizeof(constBuf.shadowTaps)); + + constBuf.mode = params.mode; +}
\ No newline at end of file diff --git a/demo/d3d/renderParamsD3D.h b/demo/d3d/renderParamsD3D.h new file mode 100644 index 0000000..0c730bc --- /dev/null +++ b/demo/d3d/renderParamsD3D.h @@ -0,0 +1,248 @@ +/* + * Copyright (c) 2008-2017, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#pragma once + +#define NOMINMAX + +#include "core/maths.h" +#include <DirectXMath.h> + +#include "shaderCommonD3D.h" + +struct ShadowMapD3D; + +typedef DirectX::XMFLOAT3 float3; +typedef DirectX::XMFLOAT4 float4; +typedef DirectX::XMFLOAT4X4 float4x4; + +struct DiffuseDrawParamsD3D +{ + DirectX::XMMATRIX projection; + DirectX::XMMATRIX view; + DirectX::XMMATRIX model; + + float diffuseRadius; // point size in world space + float diffuseScale; // scale to calculate size in pixels + float spotMin; + float spotMax; + float motionScale; + + DirectX::XMMATRIX lightTransform; + float3 lightPos; + float3 lightDir; + + float4 color; + + float4 shadowTaps[12]; + ShadowMapD3D* shadowMap; + + int mode; +}; + +enum FluidRenderMode +{ + FLUID_RENDER_WIREFRAME, + FLUID_RENDER_SOLID, + NUM_FLUID_RENDER_MODES +}; + +enum FluidCullMode +{ + FLUID_CULL_NONE, + FLUID_CULL_FRONT, + FLUID_CULL_BACK, + NUM_FLUID_CULL_MODES +}; + +enum FluidDrawStage +{ + FLUID_DRAW_NULL, + FLUID_DRAW_SHADOW, + FLUID_DRAW_REFLECTION, + FLUID_DRAW_LIGHT +}; + +struct FluidDrawParamsD3D +{ + FluidRenderMode renderMode; + FluidCullMode cullMode; + FluidDrawStage renderStage; + + int offset; + int n; + + DirectX::XMMATRIX projection; + DirectX::XMMATRIX view; + DirectX::XMMATRIX model; + + float4 invTexScale; + + float3 invViewport; + float3 invProjection; + + float blurRadiusWorld; + float blurScale; + float blurFalloff; + int debug; + + float3 lightPos; + float3 lightDir; + DirectX::XMMATRIX lightTransform; + + float4 color; + float4 clipPosToEye; + + float spotMin; + float spotMax; + float ior; + + ShadowMapD3D* shadowMap; + + // Used on D3D12 + int m_srvDescriptorBase; + int m_sampleDescriptorBase; +}; + +enum MeshRenderMode +{ + MESH_RENDER_WIREFRAME, + MESH_RENDER_SOLID, + NUM_MESH_RENDER_MODES +}; + +enum MeshCullMode +{ + MESH_CULL_NONE, + MESH_CULL_FRONT, + MESH_CULL_BACK, + NUM_MESH_CULL_MODES +}; + +enum MeshDrawStage +{ + MESH_DRAW_NULL, + MESH_DRAW_SHADOW, + MESH_DRAW_REFLECTION, + MESH_DRAW_LIGHT +}; + +struct MeshDrawParamsD3D +{ + MeshRenderMode renderMode; + MeshCullMode cullMode; + MeshDrawStage renderStage; + + DirectX::XMMATRIX projection; + DirectX::XMMATRIX view; + DirectX::XMMATRIX model; + + float4x4 objectTransform; + + DirectX::XMMATRIX lightTransform; + float3 lightPos; + float3 lightDir; + + float4 clipPlane; + float4 fogColor; + float4 color; + float4 secondaryColor; + + float bias; + float expand; + float spotMin; + float spotMax; + + int grid; + int tex; + int colorArray; + + float4 shadowTaps[12]; + ShadowMapD3D* shadowMap; +}; + +enum PointRenderMode +{ + POINT_RENDER_WIREFRAME, + POINT_RENDER_SOLID, + NUM_POINT_RENDER_MODES +}; + +enum PointCullMode +{ + POINT_CULL_NONE, + POINT_CULL_FRONT, + POINT_CULL_BACK, + NUM_POINT_CULL_MODES +}; + +enum PointDrawStage +{ + POINT_DRAW_NULL, + POINT_DRAW_SHADOW, + POINT_DRAW_REFLECTION, + POINT_DRAW_LIGHT +}; + +struct PointDrawParamsD3D +{ + PointRenderMode renderMode; + PointCullMode cullMode; + PointDrawStage renderStage; + + DirectX::XMMATRIX projection; + DirectX::XMMATRIX view; + DirectX::XMMATRIX model; + + float pointRadius; // point size in world space + float pointScale; // scale to calculate size in pixels + float spotMin; + float spotMax; + + DirectX::XMMATRIX lightTransform; + float3 lightPos; + float3 lightDir; + + float4 colors[8]; + + float4 shadowTaps[12]; + ShadowMapD3D* shadowMap; + + int mode; +}; + +struct ShadowParamsD3D +{ + DirectX::XMMATRIX lightTransform; + float3 lightPos; + float3 lightDir; + float bias; + float4 shadowTaps[12]; +}; + +struct RenderParamsUtilD3D +{ + /// Assumes the lightTransform is in OpenGl projection format + static void calcShadowParams(Vec3 lightPos, Vec3 lightTarget, Matrix44 lightTransform, float shadowBias, ShadowParamsD3D* paramsOut); + + /// Convert a projection from GL into the same projection as can be used by Direct3D + /// D3D has clip z range [0, 1], GL -1 to 1 (as is unit cube) + static Matrix44 convertGLToD3DProjection(const Matrix44& proj); + + static void calcMeshConstantBuffer(const MeshDrawParamsD3D& params, Hlsl::MeshShaderConst& constBufOut); + + static void calcFluidConstantBuffer(const FluidDrawParamsD3D& params, Hlsl::FluidShaderConst& constBuf); + + static void calcFluidCompositeConstantBuffer(const FluidDrawParamsD3D& params, Hlsl::FluidShaderConst& constBuf); + + static void calcDiffuseConstantBuffer(const DiffuseDrawParamsD3D& params, Hlsl::DiffuseShaderConst& constBuf); + + static void calcPointConstantBuffer(const PointDrawParamsD3D& params, Hlsl::PointShaderConst& constBuf); +}; diff --git a/demo/d3d/shaderCommonD3D.h b/demo/d3d/shaderCommonD3D.h new file mode 100644 index 0000000..e143d18 --- /dev/null +++ b/demo/d3d/shaderCommonD3D.h @@ -0,0 +1,19 @@ +#ifndef SHADER_COMMON_D3D_H +#define SHADER_COMMON_D3D_H + +#include <DirectXMath.h> + +struct ShadowMap; + +namespace Hlsl { + +typedef DirectX::XMFLOAT3 float3; +typedef DirectX::XMFLOAT4 float4; +typedef DirectX::XMFLOAT4X4 float4x4; + +#define EXCLUDE_SHADER_STRUCTS 1 +#include "../d3d/shaders/shaderCommon.h" + +} // namespace Shader + +#endif // SHADER_COMMON_D3D_H diff --git a/demo/d3d/shaders/blurDepthPS.hlsl b/demo/d3d/shaders/blurDepthPS.hlsl new file mode 100644 index 0000000..c08d7f5 --- /dev/null +++ b/demo/d3d/shaders/blurDepthPS.hlsl @@ -0,0 +1,84 @@ +#include "shaderCommon.h" + +cbuffer constBuf : register(b0) +{ + FluidShaderConst gParams; +}; + +Texture2D<float> depthTex : register(t0); + +float sqr(float x) { return x*x; } + +float blurDepthPS(PassthroughVertexOut input) : SV_TARGET +{ + float4 inPosition = input.position; + + // debug: return the center depth sample + //return depthTex.Load(int3(inPosition.xy, 0)).x; + + const float blurRadiusWorld = gParams.blurRadiusWorld; + const float blurScale = gParams.blurScale; + const float blurFalloff = gParams.blurFalloff; + + // eye-space depth of center sample + float depth = depthTex.Load(int3(inPosition.xy, 0)).x; + float thickness = 0.0f; //texture2D(thicknessTex, gl_TexCoord[0].xy).x; + + /* + // threshold on thickness to create nice smooth silhouettes + if (depth == 0.0) + { + return 0.0f; + } + */ + + float blurDepthFalloff = 5.5; + float maxBlurRadius = 5.0; + + //discontinuities between different tap counts are visible. to avoid this we + //use fractional contributions between #taps = ceil(radius) and floor(radius) + float radius = min(maxBlurRadius, blurScale * (blurRadiusWorld / -depth)); + float radiusInv = 1.0 / radius; + float taps = ceil(radius); + float frac = taps - radius; + + float sum = 0.0; + float wsum = 0.0; + float count = 0.0; + + for (float y = -taps; y <= taps; y += 1.0) + { + for (float x = -taps; x <= taps; x += 1.0) + { + float2 offset = float2(x, y); + float sample = depthTex.Load(int3(inPosition.xy + offset, 0)).x; + + //if (sample < -10000.0 * 0.5) + //continue; + + // spatial domain + float r1 = length(float2(x, y))*radiusInv; + float w = exp(-(r1*r1)); + + // range domain (based on depth difference) + float r2 = (sample - depth) * blurDepthFalloff; + float g = exp(-(r2*r2)); + + //fractional radius contributions + float wBoundary = step(radius, max(abs(x), abs(y))); + float wFrac = 1.0 - wBoundary*frac; + + sum += sample * w * g * wFrac; + wsum += w * g * wFrac; + count += g * wFrac; + } + } + + if (wsum > 0.0) + { + sum /= wsum; + } + + float blend = count / sqr(2.0 * radius + 1.0); + return lerp(depth, sum, blend); +} diff --git a/demo/d3d/shaders/blurDepthPS.hlsl.h b/demo/d3d/shaders/blurDepthPS.hlsl.h new file mode 100644 index 0000000..ce5eec9 --- /dev/null +++ b/demo/d3d/shaders/blurDepthPS.hlsl.h @@ -0,0 +1,657 @@ +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// Buffer Definitions: +// +// cbuffer constBuf +// { +// +// struct FluidShaderConst +// { +// +// float4x4 modelViewProjection; // Offset: 0 +// float4x4 modelView; // Offset: 64 +// float4x4 projection; // Offset: 128 +// float4x4 inverseModelView; // Offset: 192 +// float4x4 inverseProjection; // Offset: 256 +// float4 invTexScale; // Offset: 320 +// float3 invViewport; // Offset: 336 +// float _pad0; // Offset: 348 +// float blurRadiusWorld; // Offset: 352 +// float blurScale; // Offset: 356 +// float blurFalloff; // Offset: 360 +// int debug; // Offset: 364 +// float3 lightPos; // Offset: 368 +// float _pad1; // Offset: 380 +// float3 lightDir; // Offset: 384 +// float _pad2; // Offset: 396 +// float4x4 lightTransform; // Offset: 400 +// float4 color; // Offset: 464 +// float4 clipPosToEye; // Offset: 480 +// float spotMin; // Offset: 496 +// float spotMax; // Offset: 500 +// float ior; // Offset: 504 +// float _pad3; // Offset: 508 +// float4 shadowTaps[12]; // Offset: 512 +// +// } gParams; // Offset: 0 Size: 704 +// +// } +// +// +// Resource Bindings: +// +// Name Type Format Dim Slot Elements +// ------------------------------ ---------- ------- ----------- ---- -------- +// depthTex texture float 2d 0 1 +// constBuf cbuffer NA NA 0 1 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_POSITION 0 xyzw 0 POS float xy +// TEXCOORD 0 xy 1 NONE float +// +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_TARGET 0 x 0 TARGET float x +// +ps_5_0 +dcl_globalFlags refactoringAllowed +dcl_constantbuffer cb0[23], immediateIndexed +dcl_resource_texture2d (float,float,float,float) t0 +dcl_input_ps_siv linear noperspective v0.xy, position +dcl_output o0.x +dcl_temps 5 +ftoi r0.xy, v0.xyxx +mov r0.zw, l(0,0,0,0) +ld_indexable(texture2d)(float,float,float,float) r0.x, r0.xyzw, t0.xyzw +div r0.y, cb0[22].x, -r0.x +mul r0.y, r0.y, cb0[22].y +min r0.y, r0.y, l(5.000000) +div r0.z, l(1.000000, 1.000000, 1.000000, 1.000000), r0.y +round_pi r0.w, r0.y +add r1.x, -r0.y, r0.w +mov r2.zw, l(0,0,0,0) +mov r1.yzw, l(0,0,0,0) +mov r3.y, -r0.w +loop + lt r3.z, r0.w, r3.y + breakc_nz r3.z + mov r4.xyz, r1.yzwy + mov r4.w, -r0.w + loop + lt r3.z, r0.w, r4.w + breakc_nz r3.z + mov r3.x, r4.w + add r3.zw, r3.xxxy, v0.xxxy + ftoi r2.xy, r3.zwzz + ld_indexable(texture2d)(float,float,float,float) r2.x, r2.xyzw, t0.xyzw + dp2 r2.y, r3.xyxx, r3.xyxx + sqrt r2.y, r2.y + mul r2.y, r0.z, r2.y + mul r2.y, r2.y, r2.y + mul r2.y, r2.y, l(-1.442695) + exp r2.y, r2.y + add r3.x, -r0.x, r2.x + mul r3.x, r3.x, l(5.500000) + mul r3.x, r3.x, r3.x + mul r3.x, r3.x, l(-1.442695) + exp r3.x, r3.x + max r3.z, |r3.y|, |r4.w| + ge r3.z, r3.z, r0.y + and r3.z, r3.z, l(0x3f800000) + mad r3.z, -r3.z, r1.x, l(1.000000) + mul r2.x, r2.y, r2.x + mul r2.x, r3.x, r2.x + mad r4.x, r2.x, r3.z, r4.x + mul r2.x, r2.y, r3.x + mad r4.y, r2.x, r3.z, r4.y + mad r4.z, r3.x, r3.z, r4.z + add r4.w, r4.w, l(1.000000) + endloop + mov r1.yzw, r4.xxyz + add r3.y, r3.y, l(1.000000) +endloop +lt r0.z, l(0.000000), r1.z +div r0.w, r1.y, r1.z +movc r0.z, r0.z, r0.w, r1.y +mad r0.y, r0.y, l(2.000000), l(1.000000) +mul r0.y, r0.y, r0.y +div r0.y, r1.w, r0.y +add r0.z, -r0.x, r0.z +mad o0.x, r0.y, r0.z, r0.x +ret +// Approximately 59 instruction slots used +#endif + +const BYTE g_blurDepthPS[] = +{ + 68, 88, 66, 67, 25, 16, + 90, 102, 178, 215, 22, 204, + 41, 91, 183, 73, 123, 5, + 153, 37, 1, 0, 0, 0, + 40, 12, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, + 152, 4, 0, 0, 240, 4, + 0, 0, 36, 5, 0, 0, + 140, 11, 0, 0, 82, 68, + 69, 70, 92, 4, 0, 0, + 1, 0, 0, 0, 144, 0, + 0, 0, 2, 0, 0, 0, + 60, 0, 0, 0, 0, 5, + 255, 255, 0, 1, 0, 0, + 40, 4, 0, 0, 82, 68, + 49, 49, 60, 0, 0, 0, + 24, 0, 0, 0, 32, 0, + 0, 0, 40, 0, 0, 0, + 36, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 124, 0, 0, 0, 2, 0, + 0, 0, 5, 0, 0, 0, + 4, 0, 0, 0, 255, 255, + 255, 255, 0, 0, 0, 0, + 1, 0, 0, 0, 1, 0, + 0, 0, 133, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 1, 0, 0, 0, 100, 101, + 112, 116, 104, 84, 101, 120, + 0, 99, 111, 110, 115, 116, + 66, 117, 102, 0, 171, 171, + 133, 0, 0, 0, 1, 0, + 0, 0, 168, 0, 0, 0, + 192, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 208, 0, 0, 0, 0, 0, + 0, 0, 192, 2, 0, 0, + 2, 0, 0, 0, 4, 4, + 0, 0, 0, 0, 0, 0, + 255, 255, 255, 255, 0, 0, + 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 103, 80, + 97, 114, 97, 109, 115, 0, + 70, 108, 117, 105, 100, 83, + 104, 97, 100, 101, 114, 67, + 111, 110, 115, 116, 0, 109, + 111, 100, 101, 108, 86, 105, + 101, 119, 80, 114, 111, 106, + 101, 99, 116, 105, 111, 110, + 0, 102, 108, 111, 97, 116, + 52, 120, 52, 0, 171, 171, + 3, 0, 3, 0, 4, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 253, 0, 0, 0, + 109, 111, 100, 101, 108, 86, + 105, 101, 119, 0, 112, 114, + 111, 106, 101, 99, 116, 105, + 111, 110, 0, 105, 110, 118, + 101, 114, 115, 101, 77, 111, + 100, 101, 108, 86, 105, 101, + 119, 0, 105, 110, 118, 101, + 114, 115, 101, 80, 114, 111, + 106, 101, 99, 116, 105, 111, + 110, 0, 105, 110, 118, 84, + 101, 120, 83, 99, 97, 108, + 101, 0, 102, 108, 111, 97, + 116, 52, 0, 171, 1, 0, + 3, 0, 1, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 112, 1, 0, 0, 105, 110, + 118, 86, 105, 101, 119, 112, + 111, 114, 116, 0, 102, 108, + 111, 97, 116, 51, 0, 171, + 1, 0, 3, 0, 1, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 168, 1, 0, 0, + 95, 112, 97, 100, 48, 0, + 102, 108, 111, 97, 116, 0, + 0, 0, 3, 0, 1, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 218, 1, 0, 0, + 98, 108, 117, 114, 82, 97, + 100, 105, 117, 115, 87, 111, + 114, 108, 100, 0, 98, 108, + 117, 114, 83, 99, 97, 108, + 101, 0, 98, 108, 117, 114, + 70, 97, 108, 108, 111, 102, + 102, 0, 100, 101, 98, 117, + 103, 0, 105, 110, 116, 0, + 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 48, 2, 0, 0, + 108, 105, 103, 104, 116, 80, + 111, 115, 0, 95, 112, 97, + 100, 49, 0, 108, 105, 103, + 104, 116, 68, 105, 114, 0, + 95, 112, 97, 100, 50, 0, + 108, 105, 103, 104, 116, 84, + 114, 97, 110, 115, 102, 111, + 114, 109, 0, 99, 111, 108, + 111, 114, 0, 99, 108, 105, + 112, 80, 111, 115, 84, 111, + 69, 121, 101, 0, 115, 112, + 111, 116, 77, 105, 110, 0, + 115, 112, 111, 116, 77, 97, + 120, 0, 105, 111, 114, 0, + 95, 112, 97, 100, 51, 0, + 115, 104, 97, 100, 111, 119, + 84, 97, 112, 115, 0, 171, + 171, 171, 1, 0, 3, 0, + 1, 0, 4, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 112, 1, + 0, 0, 233, 0, 0, 0, + 8, 1, 0, 0, 0, 0, + 0, 0, 44, 1, 0, 0, + 8, 1, 0, 0, 64, 0, + 0, 0, 54, 1, 0, 0, + 8, 1, 0, 0, 128, 0, + 0, 0, 65, 1, 0, 0, + 8, 1, 0, 0, 192, 0, + 0, 0, 82, 1, 0, 0, + 8, 1, 0, 0, 0, 1, + 0, 0, 100, 1, 0, 0, + 120, 1, 0, 0, 64, 1, + 0, 0, 156, 1, 0, 0, + 176, 1, 0, 0, 80, 1, + 0, 0, 212, 1, 0, 0, + 224, 1, 0, 0, 92, 1, + 0, 0, 4, 2, 0, 0, + 224, 1, 0, 0, 96, 1, + 0, 0, 20, 2, 0, 0, + 224, 1, 0, 0, 100, 1, + 0, 0, 30, 2, 0, 0, + 224, 1, 0, 0, 104, 1, + 0, 0, 42, 2, 0, 0, + 52, 2, 0, 0, 108, 1, + 0, 0, 88, 2, 0, 0, + 176, 1, 0, 0, 112, 1, + 0, 0, 97, 2, 0, 0, + 224, 1, 0, 0, 124, 1, + 0, 0, 103, 2, 0, 0, + 176, 1, 0, 0, 128, 1, + 0, 0, 112, 2, 0, 0, + 224, 1, 0, 0, 140, 1, + 0, 0, 118, 2, 0, 0, + 8, 1, 0, 0, 144, 1, + 0, 0, 133, 2, 0, 0, + 120, 1, 0, 0, 208, 1, + 0, 0, 139, 2, 0, 0, + 120, 1, 0, 0, 224, 1, + 0, 0, 152, 2, 0, 0, + 224, 1, 0, 0, 240, 1, + 0, 0, 160, 2, 0, 0, + 224, 1, 0, 0, 244, 1, + 0, 0, 168, 2, 0, 0, + 224, 1, 0, 0, 248, 1, + 0, 0, 172, 2, 0, 0, + 224, 1, 0, 0, 252, 1, + 0, 0, 178, 2, 0, 0, + 192, 2, 0, 0, 0, 2, + 0, 0, 5, 0, 0, 0, + 1, 0, 176, 0, 0, 0, + 24, 0, 228, 2, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 216, 0, + 0, 0, 77, 105, 99, 114, + 111, 115, 111, 102, 116, 32, + 40, 82, 41, 32, 72, 76, + 83, 76, 32, 83, 104, 97, + 100, 101, 114, 32, 67, 111, + 109, 112, 105, 108, 101, 114, + 32, 54, 46, 51, 46, 57, + 54, 48, 48, 46, 49, 54, + 51, 56, 52, 0, 171, 171, + 73, 83, 71, 78, 80, 0, + 0, 0, 2, 0, 0, 0, + 8, 0, 0, 0, 56, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 15, 3, 0, 0, 68, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 1, 0, 0, 0, + 3, 0, 0, 0, 83, 86, + 95, 80, 79, 83, 73, 84, + 73, 79, 78, 0, 84, 69, + 88, 67, 79, 79, 82, 68, + 0, 171, 171, 171, 79, 83, + 71, 78, 44, 0, 0, 0, + 1, 0, 0, 0, 8, 0, + 0, 0, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 1, 14, + 0, 0, 83, 86, 95, 84, + 65, 82, 71, 69, 84, 0, + 171, 171, 83, 72, 69, 88, + 96, 6, 0, 0, 80, 0, + 0, 0, 152, 1, 0, 0, + 106, 8, 0, 1, 89, 0, + 0, 4, 70, 142, 32, 0, + 0, 0, 0, 0, 23, 0, + 0, 0, 88, 24, 0, 4, + 0, 112, 16, 0, 0, 0, + 0, 0, 85, 85, 0, 0, + 100, 32, 0, 4, 50, 16, + 16, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 101, 0, + 0, 3, 18, 32, 16, 0, + 0, 0, 0, 0, 104, 0, + 0, 2, 5, 0, 0, 0, + 27, 0, 0, 5, 50, 0, + 16, 0, 0, 0, 0, 0, + 70, 16, 16, 0, 0, 0, + 0, 0, 54, 0, 0, 8, + 194, 0, 16, 0, 0, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 45, 0, + 0, 137, 194, 0, 0, 128, + 67, 85, 21, 0, 18, 0, + 16, 0, 0, 0, 0, 0, + 70, 14, 16, 0, 0, 0, + 0, 0, 70, 126, 16, 0, + 0, 0, 0, 0, 14, 0, + 0, 9, 34, 0, 16, 0, + 0, 0, 0, 0, 10, 128, + 32, 0, 0, 0, 0, 0, + 22, 0, 0, 0, 10, 0, + 16, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 56, 0, + 0, 8, 34, 0, 16, 0, + 0, 0, 0, 0, 26, 0, + 16, 0, 0, 0, 0, 0, + 26, 128, 32, 0, 0, 0, + 0, 0, 22, 0, 0, 0, + 51, 0, 0, 7, 34, 0, + 16, 0, 0, 0, 0, 0, + 26, 0, 16, 0, 0, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 160, 64, 14, 0, + 0, 10, 66, 0, 16, 0, + 0, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 128, 63, + 0, 0, 128, 63, 0, 0, + 128, 63, 0, 0, 128, 63, + 26, 0, 16, 0, 0, 0, + 0, 0, 66, 0, 0, 5, + 130, 0, 16, 0, 0, 0, + 0, 0, 26, 0, 16, 0, + 0, 0, 0, 0, 0, 0, + 0, 8, 18, 0, 16, 0, + 1, 0, 0, 0, 26, 0, + 16, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 58, 0, + 16, 0, 0, 0, 0, 0, + 54, 0, 0, 8, 194, 0, + 16, 0, 2, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 54, 0, 0, 8, + 226, 0, 16, 0, 1, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 54, 0, + 0, 6, 34, 0, 16, 0, + 3, 0, 0, 0, 58, 0, + 16, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 48, 0, + 0, 1, 49, 0, 0, 7, + 66, 0, 16, 0, 3, 0, + 0, 0, 58, 0, 16, 0, + 0, 0, 0, 0, 26, 0, + 16, 0, 3, 0, 0, 0, + 3, 0, 4, 3, 42, 0, + 16, 0, 3, 0, 0, 0, + 54, 0, 0, 5, 114, 0, + 16, 0, 4, 0, 0, 0, + 150, 7, 16, 0, 1, 0, + 0, 0, 54, 0, 0, 6, + 130, 0, 16, 0, 4, 0, + 0, 0, 58, 0, 16, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 48, 0, 0, 1, + 49, 0, 0, 7, 66, 0, + 16, 0, 3, 0, 0, 0, + 58, 0, 16, 0, 0, 0, + 0, 0, 58, 0, 16, 0, + 4, 0, 0, 0, 3, 0, + 4, 3, 42, 0, 16, 0, + 3, 0, 0, 0, 54, 0, + 0, 5, 18, 0, 16, 0, + 3, 0, 0, 0, 58, 0, + 16, 0, 4, 0, 0, 0, + 0, 0, 0, 7, 194, 0, + 16, 0, 3, 0, 0, 0, + 6, 4, 16, 0, 3, 0, + 0, 0, 6, 20, 16, 0, + 0, 0, 0, 0, 27, 0, + 0, 5, 50, 0, 16, 0, + 2, 0, 0, 0, 230, 10, + 16, 0, 3, 0, 0, 0, + 45, 0, 0, 137, 194, 0, + 0, 128, 67, 85, 21, 0, + 18, 0, 16, 0, 2, 0, + 0, 0, 70, 14, 16, 0, + 2, 0, 0, 0, 70, 126, + 16, 0, 0, 0, 0, 0, + 15, 0, 0, 7, 34, 0, + 16, 0, 2, 0, 0, 0, + 70, 0, 16, 0, 3, 0, + 0, 0, 70, 0, 16, 0, + 3, 0, 0, 0, 75, 0, + 0, 5, 34, 0, 16, 0, + 2, 0, 0, 0, 26, 0, + 16, 0, 2, 0, 0, 0, + 56, 0, 0, 7, 34, 0, + 16, 0, 2, 0, 0, 0, + 42, 0, 16, 0, 0, 0, + 0, 0, 26, 0, 16, 0, + 2, 0, 0, 0, 56, 0, + 0, 7, 34, 0, 16, 0, + 2, 0, 0, 0, 26, 0, + 16, 0, 2, 0, 0, 0, + 26, 0, 16, 0, 2, 0, + 0, 0, 56, 0, 0, 7, + 34, 0, 16, 0, 2, 0, + 0, 0, 26, 0, 16, 0, + 2, 0, 0, 0, 1, 64, + 0, 0, 59, 170, 184, 191, + 25, 0, 0, 5, 34, 0, + 16, 0, 2, 0, 0, 0, + 26, 0, 16, 0, 2, 0, + 0, 0, 0, 0, 0, 8, + 18, 0, 16, 0, 3, 0, + 0, 0, 10, 0, 16, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 10, 0, 16, 0, + 2, 0, 0, 0, 56, 0, + 0, 7, 18, 0, 16, 0, + 3, 0, 0, 0, 10, 0, + 16, 0, 3, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 176, 64, 56, 0, 0, 7, + 18, 0, 16, 0, 3, 0, + 0, 0, 10, 0, 16, 0, + 3, 0, 0, 0, 10, 0, + 16, 0, 3, 0, 0, 0, + 56, 0, 0, 7, 18, 0, + 16, 0, 3, 0, 0, 0, + 10, 0, 16, 0, 3, 0, + 0, 0, 1, 64, 0, 0, + 59, 170, 184, 191, 25, 0, + 0, 5, 18, 0, 16, 0, + 3, 0, 0, 0, 10, 0, + 16, 0, 3, 0, 0, 0, + 52, 0, 0, 9, 66, 0, + 16, 0, 3, 0, 0, 0, + 26, 0, 16, 128, 129, 0, + 0, 0, 3, 0, 0, 0, + 58, 0, 16, 128, 129, 0, + 0, 0, 4, 0, 0, 0, + 29, 0, 0, 7, 66, 0, + 16, 0, 3, 0, 0, 0, + 42, 0, 16, 0, 3, 0, + 0, 0, 26, 0, 16, 0, + 0, 0, 0, 0, 1, 0, + 0, 7, 66, 0, 16, 0, + 3, 0, 0, 0, 42, 0, + 16, 0, 3, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 50, 0, 0, 10, + 66, 0, 16, 0, 3, 0, + 0, 0, 42, 0, 16, 128, + 65, 0, 0, 0, 3, 0, + 0, 0, 10, 0, 16, 0, + 1, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 56, 0, 0, 7, 18, 0, + 16, 0, 2, 0, 0, 0, + 26, 0, 16, 0, 2, 0, + 0, 0, 10, 0, 16, 0, + 2, 0, 0, 0, 56, 0, + 0, 7, 18, 0, 16, 0, + 2, 0, 0, 0, 10, 0, + 16, 0, 3, 0, 0, 0, + 10, 0, 16, 0, 2, 0, + 0, 0, 50, 0, 0, 9, + 18, 0, 16, 0, 4, 0, + 0, 0, 10, 0, 16, 0, + 2, 0, 0, 0, 42, 0, + 16, 0, 3, 0, 0, 0, + 10, 0, 16, 0, 4, 0, + 0, 0, 56, 0, 0, 7, + 18, 0, 16, 0, 2, 0, + 0, 0, 26, 0, 16, 0, + 2, 0, 0, 0, 10, 0, + 16, 0, 3, 0, 0, 0, + 50, 0, 0, 9, 34, 0, + 16, 0, 4, 0, 0, 0, + 10, 0, 16, 0, 2, 0, + 0, 0, 42, 0, 16, 0, + 3, 0, 0, 0, 26, 0, + 16, 0, 4, 0, 0, 0, + 50, 0, 0, 9, 66, 0, + 16, 0, 4, 0, 0, 0, + 10, 0, 16, 0, 3, 0, + 0, 0, 42, 0, 16, 0, + 3, 0, 0, 0, 42, 0, + 16, 0, 4, 0, 0, 0, + 0, 0, 0, 7, 130, 0, + 16, 0, 4, 0, 0, 0, + 58, 0, 16, 0, 4, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 22, 0, + 0, 1, 54, 0, 0, 5, + 226, 0, 16, 0, 1, 0, + 0, 0, 6, 9, 16, 0, + 4, 0, 0, 0, 0, 0, + 0, 7, 34, 0, 16, 0, + 3, 0, 0, 0, 26, 0, + 16, 0, 3, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 22, 0, 0, 1, + 49, 0, 0, 7, 66, 0, + 16, 0, 0, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 1, 0, 0, 0, 14, 0, + 0, 7, 130, 0, 16, 0, + 0, 0, 0, 0, 26, 0, + 16, 0, 1, 0, 0, 0, + 42, 0, 16, 0, 1, 0, + 0, 0, 55, 0, 0, 9, + 66, 0, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 0, 0, 0, 0, 58, 0, + 16, 0, 0, 0, 0, 0, + 26, 0, 16, 0, 1, 0, + 0, 0, 50, 0, 0, 9, + 34, 0, 16, 0, 0, 0, + 0, 0, 26, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 64, + 1, 64, 0, 0, 0, 0, + 128, 63, 56, 0, 0, 7, + 34, 0, 16, 0, 0, 0, + 0, 0, 26, 0, 16, 0, + 0, 0, 0, 0, 26, 0, + 16, 0, 0, 0, 0, 0, + 14, 0, 0, 7, 34, 0, + 16, 0, 0, 0, 0, 0, + 58, 0, 16, 0, 1, 0, + 0, 0, 26, 0, 16, 0, + 0, 0, 0, 0, 0, 0, + 0, 8, 66, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 42, 0, + 16, 0, 0, 0, 0, 0, + 50, 0, 0, 9, 18, 32, + 16, 0, 0, 0, 0, 0, + 26, 0, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 0, 0, 0, 0, + 62, 0, 0, 1, 83, 84, + 65, 84, 148, 0, 0, 0, + 59, 0, 0, 0, 5, 0, + 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 38, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 1, 0, + 0, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 8, 0, + 0, 0, 1, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0 +}; diff --git a/demo/d3d/shaders/compositePS.hlsl b/demo/d3d/shaders/compositePS.hlsl new file mode 100644 index 0000000..6e8bb6a --- /dev/null +++ b/demo/d3d/shaders/compositePS.hlsl @@ -0,0 +1,182 @@ +#include "shaderCommon.h" + +#define ENABLE_SIMPLE_FLUID 1 + +cbuffer constBuf : register(b0) +{ + FluidShaderConst gParams; +}; + +Texture2D<float> depthTex : register(t0); +Texture2D<float3> sceneTex : register(t1); +Texture2D<float> shadowTex : register(t2); // shadow map + +SamplerState texSampler : register(s0); +SamplerComparisonState shadowSampler : register(s1); // texture sample used to sample depth from shadow texture in this sample + +// sample shadow map +float shadowSample(float3 worldPos, out float attenuation) +{ +#if 0 + attenuation = 0.0f; + return 0.5; +#else + + float4 pos = mul(gParams.lightTransform, float4(worldPos + gParams.lightDir*0.15, 1.0)); + pos /= pos.w; + float3 uvw = (pos.xyz * float3(0.5, 0.5, 1.0)) + float3(0.5, 0.5, 0.0); + + attenuation = 1.0;//max(smoothstep(spotMax, spotMin, dot(pos.xy, pos.xy)), 0.05); + + // user clip + if (uvw.x < 0.0 || uvw.x > 1.0) + return 1.0; + if (uvw.y < 0.0 || uvw.y > 1.0) + return 1.0; + + float s = 0.0; + float radius = 0.002; + + uvw.y = 1.0f - uvw.y; + + [unroll] + for (int i = 0; i < 8; i++) + { + float2 shadowTaps = gParams.shadowTaps[i].xy; + shadowTaps.y = 1.0f - shadowTaps.y; + s += shadowTex.SampleCmp(shadowSampler, uvw.xy + shadowTaps * radius, uvw.z); + } + + s /= 8.0; + return s; +#endif +} + +float3 viewportToEyeSpace(float2 coord, float eyeZ) +{ + float2 clipPosToEye = gParams.clipPosToEye.xy; + + // find position at z=1 plane + //float2 uv = (coord * 2.0 - float2(1.0, 1.0)) * clipPosToEye; + float2 uv = float2(coord.x*2.0f-1.0f, (1.0f-coord.y)*2.0f - 1.0f)*clipPosToEye; + + return float3(-uv * eyeZ, eyeZ); +} + +float3 srgbToLinear(float3 c) { const float v = 2.2; return pow(c, float3(v, v, v)); } +float3 linearToSrgb(float3 c) { const float v = 1.0 / 2.2; return pow(c, float3(v, v, v)); } + +float sqr(float x) { return x*x; } +float cube(float x) { return x*x*x; } + +float4 compositePS(PassthroughVertexOut input, out float depthOut : SV_DEPTH) : SV_TARGET +{ + const float4x4 projectionMatrix = gParams.projection; + const float4x4 modelViewMatrix = gParams.modelView; + const float4x4 modelViewMatrixInverse = gParams.inverseModelView; + + const float2 invTexScale = gParams.invTexScale.xy; + + const float3 lightDir = gParams.lightDir; + const float3 lightPos = gParams.lightPos; + const float spotMin = gParams.spotMin; + const float spotMax = gParams.spotMax; + const float ior = gParams.ior; + const float4 color = gParams.color; + + // flip uv y-coordinate + float2 uvCoord = float2(input.texCoord.x, 1.0f-input.texCoord.y); + + float eyeZ = depthTex.Sample(texSampler, uvCoord).x; + + if (eyeZ == 0.0) + discard; + + // reconstruct eye space pos from depth + float3 eyePos = viewportToEyeSpace(uvCoord, eyeZ); + + // finite difference approx for normals, can't take dFdx because + // the one-sided difference is incorrect at shape boundaries + float3 zl = eyePos - viewportToEyeSpace(uvCoord - float2(invTexScale.x, 0.0), depthTex.Sample(texSampler, uvCoord - float2(invTexScale.x, 0.0)).x); + float3 zr = viewportToEyeSpace(uvCoord + float2(invTexScale.x, 0.0), depthTex.Sample(texSampler, uvCoord + float2(invTexScale.x, 0.0)).x) - eyePos; + float3 zt = viewportToEyeSpace(uvCoord + float2(0.0, invTexScale.y), depthTex.Sample(texSampler, uvCoord + float2(0.0, invTexScale.y)).x) - eyePos; + float3 zb = eyePos - viewportToEyeSpace(uvCoord - float2(0.0, invTexScale.y), depthTex.Sample(texSampler, uvCoord - float2(0.0, invTexScale.y)).x); + + float3 dx = zl; + float3 dy = zt; + + if (abs(zr.z) < abs(zl.z)) + dx = zr; + + if (abs(zb.z) < abs(zt.z)) + dy = zb; + + //float3 dx = ddx(eyePos.xyz); + //float3 dy = -ddy(eyePos.xyz); + + float4 worldPos = mul(modelViewMatrixInverse, float4(eyePos, 1.0)); + + float attenuation; + float shadow = shadowSample(worldPos.xyz, attenuation); + + float3 l = mul(modelViewMatrix, float4(lightDir, 0.0)).xyz; + float3 v = -normalize(eyePos); + + float3 n = -normalize(cross(dx, dy)); // sign difference from texcoord coordinate difference between OpenGL + float3 h = normalize(v + l); + + float3 skyColor = float3(0.1, 0.2, 0.4)*1.2; + float3 groundColor = float3(0.1, 0.1, 0.2); + + float fresnel = 0.1 + (1.0 - 0.1)*cube(1.0 - max(dot(n, v), 0.0)); + + float3 lVec = normalize(worldPos.xyz - lightPos); + + float ln = dot(l, n)*attenuation; + + float3 rEye = reflect(-v, n).xyz; + float3 rWorld = mul(modelViewMatrixInverse, float4(rEye, 0.0)).xyz; + + float2 texScale = float2(0.75, 1.0); // to account for backbuffer aspect ratio (todo: pass in) + + float refractScale = ior*0.025; + float reflectScale = ior*0.1; + + // attenuate refraction near ground (hack) + refractScale *= smoothstep(0.1, 0.4, worldPos.y); + + float2 refractCoord = uvCoord + n.xy*refractScale*texScale; + + // read thickness from refracted coordinate otherwise we get halos around objectsw + float thickness = 0.8f;//max(texture2D(thicknessTex, refractCoord).x, 0.3); + + //vec3 transmission = exp(-(vec3(1.0)-color.xyz)*thickness); + float3 transmission = (1.0 - (1.0 - color.xyz)*thickness*0.8)*color.w; + float3 refract = sceneTex.Sample(texSampler, refractCoord).xyz*transmission; + + float2 sceneReflectCoord = uvCoord - rEye.xy*texScale*reflectScale / eyePos.z; + float3 sceneReflect = sceneTex.Sample(texSampler, sceneReflectCoord).xyz*shadow; + //vec3 planarReflect = texture2D(reflectTex, gl_TexCoord[0].xy).xyz; + float3 planarReflect = float3(0.0, 0.0, 0.0); + + // fade out planar reflections above the ground + //float3 reflect = lerp(planarReflect, sceneReflect, smoothstep(0.05, 0.3, worldPos.y)) + lerp(groundColor, skyColor, smoothstep(0.15, 0.25, rWorld.y)*shadow); + float3 reflect = sceneReflect + lerp(groundColor, skyColor, smoothstep(0.15, 0.25, rWorld.y)*shadow); + + // lighting + float3 diffuse = color.xyz * lerp(float3(0.29, 0.379, 0.59), float3(1.0, 1.0, 1.0), (ln*0.5 + 0.5)*max(shadow, 0.4))*(1.0 - color.w); + float specular = 1.2*pow(max(dot(h, n), 0.0), 400.0); + + // write valid z + float4 clipPos = mul(projectionMatrix, float4(0.0, 0.0, eyeZ, 1.0)); + clipPos.z /= clipPos.w; + depthOut = clipPos.z; + + // visualize normals + //return float4(n*0.5 + 0.5, 1.0); + //return float4(fresnel, fresnel, fresnel, 0); + //return float4(n, 1); + + // Color + return float4(diffuse + (lerp(refract, reflect, fresnel) + specular)*color.w, 1.0); +} diff --git a/demo/d3d/shaders/compositePS.hlsl.h b/demo/d3d/shaders/compositePS.hlsl.h new file mode 100644 index 0000000..76f4c49 --- /dev/null +++ b/demo/d3d/shaders/compositePS.hlsl.h @@ -0,0 +1,1642 @@ +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// Buffer Definitions: +// +// cbuffer constBuf +// { +// +// struct FluidShaderConst +// { +// +// float4x4 modelViewProjection; // Offset: 0 +// float4x4 modelView; // Offset: 64 +// float4x4 projection; // Offset: 128 +// float4x4 inverseModelView; // Offset: 192 +// float4x4 inverseProjection; // Offset: 256 +// float4 invTexScale; // Offset: 320 +// float3 invViewport; // Offset: 336 +// float _pad0; // Offset: 348 +// float blurRadiusWorld; // Offset: 352 +// float blurScale; // Offset: 356 +// float blurFalloff; // Offset: 360 +// int debug; // Offset: 364 +// float3 lightPos; // Offset: 368 +// float _pad1; // Offset: 380 +// float3 lightDir; // Offset: 384 +// float _pad2; // Offset: 396 +// float4x4 lightTransform; // Offset: 400 +// float4 color; // Offset: 464 +// float4 clipPosToEye; // Offset: 480 +// float spotMin; // Offset: 496 +// float spotMax; // Offset: 500 +// float ior; // Offset: 504 +// float _pad3; // Offset: 508 +// float4 shadowTaps[12]; // Offset: 512 +// +// } gParams; // Offset: 0 Size: 704 +// +// } +// +// +// Resource Bindings: +// +// Name Type Format Dim Slot Elements +// ------------------------------ ---------- ------- ----------- ---- -------- +// texSampler sampler NA NA 0 1 +// shadowSampler sampler_c NA NA 1 1 +// depthTex texture float 2d 0 1 +// sceneTex texture float3 2d 1 1 +// shadowTex texture float 2d 2 1 +// constBuf cbuffer NA NA 0 1 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_POSITION 0 xyzw 0 POS float +// TEXCOORD 0 xy 1 NONE float xy +// +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_TARGET 0 xyzw 0 TARGET float xyzw +// SV_DEPTH 0 N/A oDepth DEPTH float YES +// +ps_5_0 +dcl_globalFlags refactoringAllowed +dcl_constantbuffer cb0[40], immediateIndexed +dcl_sampler s0, mode_default +dcl_sampler s1, mode_comparison +dcl_resource_texture2d (float,float,float,float) t0 +dcl_resource_texture2d (float,float,float,float) t1 +dcl_resource_texture2d (float,float,float,float) t2 +dcl_input_ps linear v1.xy +dcl_output o0.xyzw +dcl_output oDepth +dcl_temps 8 +mad r0.xy, v1.xyxx, l(1.000000, -1.000000, 0.000000, 0.000000), l(0.000000, 1.000000, 0.000000, 0.000000) +sample_indexable(texture2d)(float,float,float,float) r1.z, r0.xyxx, t0.yzxw, s0 +eq r0.z, r1.z, l(0.000000) +discard_nz r0.z +mad r0.zw, v1.xxxy, l(0.000000, 0.000000, 2.000000, 2.000000), l(0.000000, 0.000000, -1.000000, -1.000000) +mul r0.zw, r0.zzzw, cb0[30].xxxy +mul r1.xy, r1.zzzz, -r0.zwzz +mov r2.y, cb0[20].x +mov r2.z, l(0) +add r0.zw, r0.xxxy, -r2.yyyz +sample_indexable(texture2d)(float,float,float,float) r2.x, r0.zwzz, t0.xyzw, s0 +mad r0.zw, r0.zzzw, l(0.000000, 0.000000, 2.000000, -2.000000), l(0.000000, 0.000000, -1.000000, 1.000000) +mul r0.zw, r0.zzzw, cb0[30].xxxy +mul r2.yz, r2.xxxx, -r0.zzwz +add r2.xyz, r1.zxyz, -r2.xyzx +mov r3.y, cb0[20].x +mov r3.z, l(1.000000) +mad r0.zw, v1.xxxy, l(0.000000, 0.000000, 1.000000, -1.000000), r3.yyyz +sample_indexable(texture2d)(float,float,float,float) r3.x, r0.zwzz, t0.xyzw, s0 +mad r0.zw, r0.zzzw, l(0.000000, 0.000000, 2.000000, -2.000000), l(0.000000, 0.000000, -1.000000, 1.000000) +mul r0.zw, r0.zzzw, cb0[30].xxxy +mul r3.yz, r3.xxxx, -r0.zzwz +add r3.xyz, -r1.zxyz, r3.xyzx +mov r4.z, l(0) +mov r4.x, cb0[20].y +add r0.zw, r0.yyyx, r4.xxxz +sample_indexable(texture2d)(float,float,float,float) r5.y, r0.wzww, t0.yxzw, s0 +mad r0.zw, r0.zzzw, l(0.000000, 0.000000, -2.000000, 2.000000), l(0.000000, 0.000000, 1.000000, -1.000000) +mul r0.zw, r0.zzzw, cb0[30].yyyx +mul r5.xz, r5.yyyy, -r0.zzwz +add r5.xyz, -r1.yzxy, r5.xyzx +add r0.zw, r0.yyyx, -r4.xxxz +sample_indexable(texture2d)(float,float,float,float) r4.y, r0.wzww, t0.yxzw, s0 +mad r0.zw, r0.zzzw, l(0.000000, 0.000000, -2.000000, 2.000000), l(0.000000, 0.000000, 1.000000, -1.000000) +mul r0.zw, r0.zzzw, cb0[30].yyyx +mul r4.xz, r4.yyyy, -r0.zzwz +add r4.xyz, r1.yzxy, -r4.xyzx +lt r0.z, |r3.x|, |r2.x| +movc r2.xyz, r0.zzzz, r3.xyzx, r2.xyzx +lt r0.z, |r4.y|, |r5.y| +movc r3.xyz, r0.zzzz, r4.xyzx, r5.xyzx +mul r4.xyz, r1.yyyy, cb0[13].xyzx +mad r4.xyz, cb0[12].xyzx, r1.xxxx, r4.xyzx +mad r4.xyz, cb0[14].xyzx, r1.zzzz, r4.xyzx +add r4.xyz, r4.xyzx, cb0[15].xyzx +mad r4.xzw, cb0[24].xxyz, l(0.150000, 0.000000, 0.150000, 0.150000), r4.xxyz +mul r5.xyzw, r4.zzzz, cb0[26].xyzw +mad r5.xyzw, cb0[25].xyzw, r4.xxxx, r5.xyzw +mad r5.xyzw, cb0[27].xyzw, r4.wwww, r5.xyzw +add r5.xyzw, r5.xyzw, cb0[28].xyzw +div r4.xzw, r5.xxyz, r5.wwww +mad r5.xyz, r4.xzwx, l(0.500000, 0.500000, 1.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000) +lt r0.z, r5.x, l(0.000000) +lt r0.w, l(1.000000), r5.x +or r0.z, r0.w, r0.z +add r0.w, -cb0[32].y, l(1.000000) +mul r6.x, cb0[32].x, l(0.002000) +mul r6.y, r0.w, l(0.002000) +add r5.w, -r5.y, l(1.000000) +add r4.xz, r5.xxwx, r6.xxyx +sample_c_indexable(texture2d)(float,float,float,float) r0.w, r4.xzxx, t2.xxxx, s1, r5.z +add r1.w, -cb0[33].y, l(1.000000) +mul r6.x, cb0[33].x, l(0.002000) +mul r6.y, r1.w, l(0.002000) +add r4.xz, r5.xxwx, r6.xxyx +sample_c_indexable(texture2d)(float,float,float,float) r1.w, r4.xzxx, t2.xxxx, s1, r5.z +add r2.w, -cb0[34].y, l(1.000000) +mul r6.x, cb0[34].x, l(0.002000) +mul r6.y, r2.w, l(0.002000) +add r4.xz, r5.xxwx, r6.xxyx +sample_c_indexable(texture2d)(float,float,float,float) r2.w, r4.xzxx, t2.xxxx, s1, r5.z +add r3.w, -cb0[35].y, l(1.000000) +mul r6.x, cb0[35].x, l(0.002000) +mul r6.y, r3.w, l(0.002000) +add r4.xz, r5.xxwx, r6.xxyx +sample_c_indexable(texture2d)(float,float,float,float) r3.w, r4.xzxx, t2.xxxx, s1, r5.z +add r4.x, -cb0[36].y, l(1.000000) +mul r6.x, cb0[36].x, l(0.002000) +mul r6.y, r4.x, l(0.002000) +add r4.xz, r5.xxwx, r6.xxyx +sample_c_indexable(texture2d)(float,float,float,float) r4.x, r4.xzxx, t2.xxxx, s1, r5.z +add r4.z, -cb0[37].y, l(1.000000) +mul r6.x, cb0[37].x, l(0.002000) +mul r6.y, r4.z, l(0.002000) +add r4.zw, r5.xxxw, r6.xxxy +sample_c_indexable(texture2d)(float,float,float,float) r4.z, r4.zwzz, t2.xxxx, s1, r5.z +add r4.w, -cb0[38].y, l(1.000000) +mul r6.x, cb0[38].x, l(0.002000) +mul r6.y, r4.w, l(0.002000) +add r6.xy, r5.xwxx, r6.xyxx +sample_c_indexable(texture2d)(float,float,float,float) r4.w, r6.xyxx, t2.xxxx, s1, r5.z +add r6.x, -cb0[39].y, l(1.000000) +mul r7.x, cb0[39].x, l(0.002000) +mul r7.y, r6.x, l(0.002000) +add r5.xw, r5.xxxw, r7.xxxy +sample_c_indexable(texture2d)(float,float,float,float) r5.x, r5.xwxx, t2.xxxx, s1, r5.z +if_z r0.z + lt r0.z, r5.y, l(0.000000) + lt r5.y, l(1.000000), r5.y + or r0.z, r0.z, r5.y + if_z r0.z + add r0.z, r0.w, r1.w + add r0.z, r2.w, r0.z + add r0.z, r3.w, r0.z + add r0.z, r4.x, r0.z + add r0.z, r4.z, r0.z + add r0.z, r4.w, r0.z + add r0.z, r5.x, r0.z + mul r0.z, r0.z, l(0.125000) + else + mov r0.z, l(1.000000) + endif +else + mov r0.z, l(1.000000) +endif +mul r4.xzw, cb0[5].xxyz, cb0[24].yyyy +mad r4.xzw, cb0[4].xxyz, cb0[24].xxxx, r4.xxzw +mad r4.xzw, cb0[6].xxyz, cb0[24].zzzz, r4.xxzw +dp3 r0.w, r1.xyzx, r1.xyzx +rsq r0.w, r0.w +mul r5.xyz, r0.wwww, r1.xyzx +mul r6.xyz, r2.xyzx, r3.xyzx +mad r2.xyz, r2.zxyz, r3.yzxy, -r6.xyzx +dp3 r1.w, r2.xyzx, r2.xyzx +rsq r1.w, r1.w +mul r2.xyz, r1.wwww, r2.xyzx +mad r1.xyw, -r1.xyxz, r0.wwww, r4.xzxw +dp3 r0.w, r1.xywx, r1.xywx +rsq r0.w, r0.w +mul r1.xyw, r0.wwww, r1.xyxw +dp3 r0.w, -r2.xyzx, -r5.xyzx +max r0.w, r0.w, l(0.000000) +add r0.w, -r0.w, l(1.000000) +mul r2.w, r0.w, r0.w +mul r0.w, r0.w, r2.w +mad r0.w, r0.w, l(0.900000), l(0.100000) +dp3 r2.w, r4.xzwx, -r2.xyzx +dp3 r3.x, r5.xyzx, -r2.xyzx +add r3.x, r3.x, r3.x +mad r3.xyz, r2.xyzx, r3.xxxx, r5.xyzx +mul r3.w, r3.y, cb0[13].y +mad r3.w, cb0[12].y, r3.x, r3.w +mad r3.z, cb0[14].y, r3.z, r3.w +mul r5.xy, cb0[31].zzzz, l(0.025000, 0.100000, 0.000000, 0.000000) +add r3.w, r4.y, l(-0.100000) +mul_sat r3.w, r3.w, l(3.333333) +mad r4.x, r3.w, l(-2.000000), l(3.000000) +mul r3.w, r3.w, r3.w +mul r3.w, r3.w, r4.x +mul r3.w, r3.w, r5.x +mul r4.xy, -r2.xyxx, r3.wwww +mad r4.xy, r4.xyxx, l(0.750000, 1.000000, 0.000000, 0.000000), r0.xyxx +add r6.xyzw, -cb0[29].xyzw, l(1.000000, 1.000000, 1.000000, 1.000000) +mad r6.xyz, -r6.xyzx, l(0.640000, 0.640000, 0.640000, 0.000000), l(1.000000, 1.000000, 1.000000, 0.000000) +mul r6.xyz, r6.xyzx, cb0[29].wwww +sample_indexable(texture2d)(float,float,float,float) r4.xyz, r4.xyxx, t1.xyzw, s0 +mul r7.xyz, r6.xyzx, r4.xyzx +mov r5.xz, l(0.750000,0,1.000000,0) +mul r3.xy, r3.xyxx, r5.yzyy +mul r5.y, cb0[31].z, l(0.100000) +mul r3.xy, r3.xyxx, r5.xyxx +div r3.xy, r3.xyxx, r1.zzzz +add r0.xy, r0.xyxx, -r3.xyxx +sample_indexable(texture2d)(float,float,float,float) r3.xyw, r0.xyxx, t1.xywz, s0 +add r0.x, r3.z, l(-0.150000) +mul_sat r0.x, r0.x, l(10.000001) +mad r0.y, r0.x, l(-2.000000), l(3.000000) +mul r0.x, r0.x, r0.x +mul r0.x, r0.x, r0.y +mul r0.x, r0.z, r0.x +mul r5.xyz, r0.xxxx, l(0.020000, 0.140000, 0.280000, 0.000000) +mad r3.xyz, r3.xywx, r0.zzzz, r5.xyzx +add r3.xyz, r3.xyzx, l(0.100000, 0.100000, 0.200000, 0.000000) +mad r0.x, r2.w, l(0.500000), l(0.500000) +max r0.y, r0.z, l(0.400000) +mul r0.x, r0.y, r0.x +mad r0.xyz, r0.xxxx, l(0.710000, 0.621000, 0.410000, 0.000000), l(0.290000, 0.379000, 0.590000, 0.000000) +mul r0.xyz, r0.xyzx, cb0[29].xyzx +dp3 r1.x, r1.xywx, -r2.xyzx +max r1.x, r1.x, l(0.000000) +log r1.x, r1.x +mul r1.x, r1.x, l(400.000000) +exp r1.x, r1.x +mad r1.yz, cb0[10].zzwz, r1.zzzz, cb0[11].zzwz +div oDepth, r1.y, r1.z +mad r1.yzw, -r4.xxyz, r6.xxyz, r3.xxyz +mad r1.yzw, r0.wwww, r1.yyzw, r7.xxyz +mad r1.xyz, r1.xxxx, l(1.200000, 1.200000, 1.200000, 0.000000), r1.yzwy +mul r1.xyz, r1.xyzx, cb0[29].wwww +mad o0.xyz, r0.xyzx, r6.wwww, r1.xyzx +mov o0.w, l(1.000000) +ret +// Approximately 192 instruction slots used +#endif + +const BYTE g_compositePS[] = +{ + 68, 88, 66, 67, 88, 43, + 70, 135, 189, 112, 158, 157, + 120, 182, 250, 215, 210, 92, + 57, 163, 1, 0, 0, 0, + 228, 31, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, + 68, 5, 0, 0, 156, 5, + 0, 0, 240, 5, 0, 0, + 72, 31, 0, 0, 82, 68, + 69, 70, 8, 5, 0, 0, + 1, 0, 0, 0, 60, 1, + 0, 0, 6, 0, 0, 0, + 60, 0, 0, 0, 0, 5, + 255, 255, 0, 1, 0, 0, + 212, 4, 0, 0, 82, 68, + 49, 49, 60, 0, 0, 0, + 24, 0, 0, 0, 32, 0, + 0, 0, 40, 0, 0, 0, + 36, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 252, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 1, 0, + 0, 0, 7, 1, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 1, 0, 0, 0, + 3, 0, 0, 0, 21, 1, + 0, 0, 2, 0, 0, 0, + 5, 0, 0, 0, 4, 0, + 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 1, 0, + 0, 0, 1, 0, 0, 0, + 30, 1, 0, 0, 2, 0, + 0, 0, 5, 0, 0, 0, + 4, 0, 0, 0, 255, 255, + 255, 255, 1, 0, 0, 0, + 1, 0, 0, 0, 9, 0, + 0, 0, 39, 1, 0, 0, + 2, 0, 0, 0, 5, 0, + 0, 0, 4, 0, 0, 0, + 255, 255, 255, 255, 2, 0, + 0, 0, 1, 0, 0, 0, + 1, 0, 0, 0, 49, 1, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 1, 0, 0, 0, + 116, 101, 120, 83, 97, 109, + 112, 108, 101, 114, 0, 115, + 104, 97, 100, 111, 119, 83, + 97, 109, 112, 108, 101, 114, + 0, 100, 101, 112, 116, 104, + 84, 101, 120, 0, 115, 99, + 101, 110, 101, 84, 101, 120, + 0, 115, 104, 97, 100, 111, + 119, 84, 101, 120, 0, 99, + 111, 110, 115, 116, 66, 117, + 102, 0, 171, 171, 49, 1, + 0, 0, 1, 0, 0, 0, + 84, 1, 0, 0, 192, 2, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 124, 1, + 0, 0, 0, 0, 0, 0, + 192, 2, 0, 0, 2, 0, + 0, 0, 176, 4, 0, 0, + 0, 0, 0, 0, 255, 255, + 255, 255, 0, 0, 0, 0, + 255, 255, 255, 255, 0, 0, + 0, 0, 103, 80, 97, 114, + 97, 109, 115, 0, 70, 108, + 117, 105, 100, 83, 104, 97, + 100, 101, 114, 67, 111, 110, + 115, 116, 0, 109, 111, 100, + 101, 108, 86, 105, 101, 119, + 80, 114, 111, 106, 101, 99, + 116, 105, 111, 110, 0, 102, + 108, 111, 97, 116, 52, 120, + 52, 0, 171, 171, 3, 0, + 3, 0, 4, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 169, 1, 0, 0, 109, 111, + 100, 101, 108, 86, 105, 101, + 119, 0, 112, 114, 111, 106, + 101, 99, 116, 105, 111, 110, + 0, 105, 110, 118, 101, 114, + 115, 101, 77, 111, 100, 101, + 108, 86, 105, 101, 119, 0, + 105, 110, 118, 101, 114, 115, + 101, 80, 114, 111, 106, 101, + 99, 116, 105, 111, 110, 0, + 105, 110, 118, 84, 101, 120, + 83, 99, 97, 108, 101, 0, + 102, 108, 111, 97, 116, 52, + 0, 171, 1, 0, 3, 0, + 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 28, 2, + 0, 0, 105, 110, 118, 86, + 105, 101, 119, 112, 111, 114, + 116, 0, 102, 108, 111, 97, + 116, 51, 0, 171, 1, 0, + 3, 0, 1, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 84, 2, 0, 0, 95, 112, + 97, 100, 48, 0, 102, 108, + 111, 97, 116, 0, 0, 0, + 3, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 134, 2, 0, 0, 98, 108, + 117, 114, 82, 97, 100, 105, + 117, 115, 87, 111, 114, 108, + 100, 0, 98, 108, 117, 114, + 83, 99, 97, 108, 101, 0, + 98, 108, 117, 114, 70, 97, + 108, 108, 111, 102, 102, 0, + 100, 101, 98, 117, 103, 0, + 105, 110, 116, 0, 0, 0, + 2, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 220, 2, 0, 0, 108, 105, + 103, 104, 116, 80, 111, 115, + 0, 95, 112, 97, 100, 49, + 0, 108, 105, 103, 104, 116, + 68, 105, 114, 0, 95, 112, + 97, 100, 50, 0, 108, 105, + 103, 104, 116, 84, 114, 97, + 110, 115, 102, 111, 114, 109, + 0, 99, 111, 108, 111, 114, + 0, 99, 108, 105, 112, 80, + 111, 115, 84, 111, 69, 121, + 101, 0, 115, 112, 111, 116, + 77, 105, 110, 0, 115, 112, + 111, 116, 77, 97, 120, 0, + 105, 111, 114, 0, 95, 112, + 97, 100, 51, 0, 115, 104, + 97, 100, 111, 119, 84, 97, + 112, 115, 0, 171, 171, 171, + 1, 0, 3, 0, 1, 0, + 4, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 28, 2, 0, 0, + 149, 1, 0, 0, 180, 1, + 0, 0, 0, 0, 0, 0, + 216, 1, 0, 0, 180, 1, + 0, 0, 64, 0, 0, 0, + 226, 1, 0, 0, 180, 1, + 0, 0, 128, 0, 0, 0, + 237, 1, 0, 0, 180, 1, + 0, 0, 192, 0, 0, 0, + 254, 1, 0, 0, 180, 1, + 0, 0, 0, 1, 0, 0, + 16, 2, 0, 0, 36, 2, + 0, 0, 64, 1, 0, 0, + 72, 2, 0, 0, 92, 2, + 0, 0, 80, 1, 0, 0, + 128, 2, 0, 0, 140, 2, + 0, 0, 92, 1, 0, 0, + 176, 2, 0, 0, 140, 2, + 0, 0, 96, 1, 0, 0, + 192, 2, 0, 0, 140, 2, + 0, 0, 100, 1, 0, 0, + 202, 2, 0, 0, 140, 2, + 0, 0, 104, 1, 0, 0, + 214, 2, 0, 0, 224, 2, + 0, 0, 108, 1, 0, 0, + 4, 3, 0, 0, 92, 2, + 0, 0, 112, 1, 0, 0, + 13, 3, 0, 0, 140, 2, + 0, 0, 124, 1, 0, 0, + 19, 3, 0, 0, 92, 2, + 0, 0, 128, 1, 0, 0, + 28, 3, 0, 0, 140, 2, + 0, 0, 140, 1, 0, 0, + 34, 3, 0, 0, 180, 1, + 0, 0, 144, 1, 0, 0, + 49, 3, 0, 0, 36, 2, + 0, 0, 208, 1, 0, 0, + 55, 3, 0, 0, 36, 2, + 0, 0, 224, 1, 0, 0, + 68, 3, 0, 0, 140, 2, + 0, 0, 240, 1, 0, 0, + 76, 3, 0, 0, 140, 2, + 0, 0, 244, 1, 0, 0, + 84, 3, 0, 0, 140, 2, + 0, 0, 248, 1, 0, 0, + 88, 3, 0, 0, 140, 2, + 0, 0, 252, 1, 0, 0, + 94, 3, 0, 0, 108, 3, + 0, 0, 0, 2, 0, 0, + 5, 0, 0, 0, 1, 0, + 176, 0, 0, 0, 24, 0, + 144, 3, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 132, 1, 0, 0, + 77, 105, 99, 114, 111, 115, + 111, 102, 116, 32, 40, 82, + 41, 32, 72, 76, 83, 76, + 32, 83, 104, 97, 100, 101, + 114, 32, 67, 111, 109, 112, + 105, 108, 101, 114, 32, 54, + 46, 51, 46, 57, 54, 48, + 48, 46, 49, 54, 51, 56, + 52, 0, 171, 171, 73, 83, + 71, 78, 80, 0, 0, 0, + 2, 0, 0, 0, 8, 0, + 0, 0, 56, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 15, 0, + 0, 0, 68, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 3, 3, + 0, 0, 83, 86, 95, 80, + 79, 83, 73, 84, 73, 79, + 78, 0, 84, 69, 88, 67, + 79, 79, 82, 68, 0, 171, + 171, 171, 79, 83, 71, 78, + 76, 0, 0, 0, 2, 0, + 0, 0, 8, 0, 0, 0, + 56, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 15, 0, 0, 0, + 66, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 255, 255, + 255, 255, 1, 14, 0, 0, + 83, 86, 95, 84, 65, 82, + 71, 69, 84, 0, 83, 86, + 95, 68, 69, 80, 84, 72, + 0, 171, 83, 72, 69, 88, + 80, 25, 0, 0, 80, 0, + 0, 0, 84, 6, 0, 0, + 106, 8, 0, 1, 89, 0, + 0, 4, 70, 142, 32, 0, + 0, 0, 0, 0, 40, 0, + 0, 0, 90, 0, 0, 3, + 0, 96, 16, 0, 0, 0, + 0, 0, 90, 8, 0, 3, + 0, 96, 16, 0, 1, 0, + 0, 0, 88, 24, 0, 4, + 0, 112, 16, 0, 0, 0, + 0, 0, 85, 85, 0, 0, + 88, 24, 0, 4, 0, 112, + 16, 0, 1, 0, 0, 0, + 85, 85, 0, 0, 88, 24, + 0, 4, 0, 112, 16, 0, + 2, 0, 0, 0, 85, 85, + 0, 0, 98, 16, 0, 3, + 50, 16, 16, 0, 1, 0, + 0, 0, 101, 0, 0, 3, + 242, 32, 16, 0, 0, 0, + 0, 0, 101, 0, 0, 2, + 1, 192, 0, 0, 104, 0, + 0, 2, 8, 0, 0, 0, + 50, 0, 0, 15, 50, 0, + 16, 0, 0, 0, 0, 0, + 70, 16, 16, 0, 1, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 128, 63, 0, 0, + 128, 191, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 128, 63, 0, 0, + 0, 0, 0, 0, 0, 0, + 69, 0, 0, 139, 194, 0, + 0, 128, 67, 85, 21, 0, + 66, 0, 16, 0, 1, 0, + 0, 0, 70, 0, 16, 0, + 0, 0, 0, 0, 150, 124, + 16, 0, 0, 0, 0, 0, + 0, 96, 16, 0, 0, 0, + 0, 0, 24, 0, 0, 7, + 66, 0, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 1, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 0, + 13, 0, 4, 3, 42, 0, + 16, 0, 0, 0, 0, 0, + 50, 0, 0, 15, 194, 0, + 16, 0, 0, 0, 0, 0, + 6, 20, 16, 0, 1, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 64, + 0, 0, 0, 64, 2, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 128, 191, 0, 0, 128, 191, + 56, 0, 0, 8, 194, 0, + 16, 0, 0, 0, 0, 0, + 166, 14, 16, 0, 0, 0, + 0, 0, 6, 132, 32, 0, + 0, 0, 0, 0, 30, 0, + 0, 0, 56, 0, 0, 8, + 50, 0, 16, 0, 1, 0, + 0, 0, 166, 10, 16, 0, + 1, 0, 0, 0, 230, 10, + 16, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 54, 0, + 0, 6, 34, 0, 16, 0, + 2, 0, 0, 0, 10, 128, + 32, 0, 0, 0, 0, 0, + 20, 0, 0, 0, 54, 0, + 0, 5, 66, 0, 16, 0, + 2, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 8, 194, 0, + 16, 0, 0, 0, 0, 0, + 6, 4, 16, 0, 0, 0, + 0, 0, 86, 9, 16, 128, + 65, 0, 0, 0, 2, 0, + 0, 0, 69, 0, 0, 139, + 194, 0, 0, 128, 67, 85, + 21, 0, 18, 0, 16, 0, + 2, 0, 0, 0, 230, 10, + 16, 0, 0, 0, 0, 0, + 70, 126, 16, 0, 0, 0, + 0, 0, 0, 96, 16, 0, + 0, 0, 0, 0, 50, 0, + 0, 15, 194, 0, 16, 0, + 0, 0, 0, 0, 166, 14, + 16, 0, 0, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 64, 0, 0, + 0, 192, 2, 64, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 128, 191, + 0, 0, 128, 63, 56, 0, + 0, 8, 194, 0, 16, 0, + 0, 0, 0, 0, 166, 14, + 16, 0, 0, 0, 0, 0, + 6, 132, 32, 0, 0, 0, + 0, 0, 30, 0, 0, 0, + 56, 0, 0, 8, 98, 0, + 16, 0, 2, 0, 0, 0, + 6, 0, 16, 0, 2, 0, + 0, 0, 166, 11, 16, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 8, + 114, 0, 16, 0, 2, 0, + 0, 0, 38, 9, 16, 0, + 1, 0, 0, 0, 70, 2, + 16, 128, 65, 0, 0, 0, + 2, 0, 0, 0, 54, 0, + 0, 6, 34, 0, 16, 0, + 3, 0, 0, 0, 10, 128, + 32, 0, 0, 0, 0, 0, + 20, 0, 0, 0, 54, 0, + 0, 5, 66, 0, 16, 0, + 3, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 50, 0, 0, 12, 194, 0, + 16, 0, 0, 0, 0, 0, + 6, 20, 16, 0, 1, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 128, 63, + 0, 0, 128, 191, 86, 9, + 16, 0, 3, 0, 0, 0, + 69, 0, 0, 139, 194, 0, + 0, 128, 67, 85, 21, 0, + 18, 0, 16, 0, 3, 0, + 0, 0, 230, 10, 16, 0, + 0, 0, 0, 0, 70, 126, + 16, 0, 0, 0, 0, 0, + 0, 96, 16, 0, 0, 0, + 0, 0, 50, 0, 0, 15, + 194, 0, 16, 0, 0, 0, + 0, 0, 166, 14, 16, 0, + 0, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 64, 0, 0, 0, 192, + 2, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 128, 191, 0, 0, + 128, 63, 56, 0, 0, 8, + 194, 0, 16, 0, 0, 0, + 0, 0, 166, 14, 16, 0, + 0, 0, 0, 0, 6, 132, + 32, 0, 0, 0, 0, 0, + 30, 0, 0, 0, 56, 0, + 0, 8, 98, 0, 16, 0, + 3, 0, 0, 0, 6, 0, + 16, 0, 3, 0, 0, 0, + 166, 11, 16, 128, 65, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 8, 114, 0, + 16, 0, 3, 0, 0, 0, + 38, 9, 16, 128, 65, 0, + 0, 0, 1, 0, 0, 0, + 70, 2, 16, 0, 3, 0, + 0, 0, 54, 0, 0, 5, + 66, 0, 16, 0, 4, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 0, 0, 54, 0, + 0, 6, 18, 0, 16, 0, + 4, 0, 0, 0, 26, 128, + 32, 0, 0, 0, 0, 0, + 20, 0, 0, 0, 0, 0, + 0, 7, 194, 0, 16, 0, + 0, 0, 0, 0, 86, 1, + 16, 0, 0, 0, 0, 0, + 6, 8, 16, 0, 4, 0, + 0, 0, 69, 0, 0, 139, + 194, 0, 0, 128, 67, 85, + 21, 0, 34, 0, 16, 0, + 5, 0, 0, 0, 182, 15, + 16, 0, 0, 0, 0, 0, + 22, 126, 16, 0, 0, 0, + 0, 0, 0, 96, 16, 0, + 0, 0, 0, 0, 50, 0, + 0, 15, 194, 0, 16, 0, + 0, 0, 0, 0, 166, 14, + 16, 0, 0, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 192, 0, 0, + 0, 64, 2, 64, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 128, 63, + 0, 0, 128, 191, 56, 0, + 0, 8, 194, 0, 16, 0, + 0, 0, 0, 0, 166, 14, + 16, 0, 0, 0, 0, 0, + 86, 129, 32, 0, 0, 0, + 0, 0, 30, 0, 0, 0, + 56, 0, 0, 8, 82, 0, + 16, 0, 5, 0, 0, 0, + 86, 5, 16, 0, 5, 0, + 0, 0, 166, 11, 16, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 8, + 114, 0, 16, 0, 5, 0, + 0, 0, 150, 4, 16, 128, + 65, 0, 0, 0, 1, 0, + 0, 0, 70, 2, 16, 0, + 5, 0, 0, 0, 0, 0, + 0, 8, 194, 0, 16, 0, + 0, 0, 0, 0, 86, 1, + 16, 0, 0, 0, 0, 0, + 6, 8, 16, 128, 65, 0, + 0, 0, 4, 0, 0, 0, + 69, 0, 0, 139, 194, 0, + 0, 128, 67, 85, 21, 0, + 34, 0, 16, 0, 4, 0, + 0, 0, 182, 15, 16, 0, + 0, 0, 0, 0, 22, 126, + 16, 0, 0, 0, 0, 0, + 0, 96, 16, 0, 0, 0, + 0, 0, 50, 0, 0, 15, + 194, 0, 16, 0, 0, 0, + 0, 0, 166, 14, 16, 0, + 0, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 192, 0, 0, 0, 64, + 2, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 128, 63, 0, 0, + 128, 191, 56, 0, 0, 8, + 194, 0, 16, 0, 0, 0, + 0, 0, 166, 14, 16, 0, + 0, 0, 0, 0, 86, 129, + 32, 0, 0, 0, 0, 0, + 30, 0, 0, 0, 56, 0, + 0, 8, 82, 0, 16, 0, + 4, 0, 0, 0, 86, 5, + 16, 0, 4, 0, 0, 0, + 166, 11, 16, 128, 65, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 8, 114, 0, + 16, 0, 4, 0, 0, 0, + 150, 4, 16, 0, 1, 0, + 0, 0, 70, 2, 16, 128, + 65, 0, 0, 0, 4, 0, + 0, 0, 49, 0, 0, 9, + 66, 0, 16, 0, 0, 0, + 0, 0, 10, 0, 16, 128, + 129, 0, 0, 0, 3, 0, + 0, 0, 10, 0, 16, 128, + 129, 0, 0, 0, 2, 0, + 0, 0, 55, 0, 0, 9, + 114, 0, 16, 0, 2, 0, + 0, 0, 166, 10, 16, 0, + 0, 0, 0, 0, 70, 2, + 16, 0, 3, 0, 0, 0, + 70, 2, 16, 0, 2, 0, + 0, 0, 49, 0, 0, 9, + 66, 0, 16, 0, 0, 0, + 0, 0, 26, 0, 16, 128, + 129, 0, 0, 0, 4, 0, + 0, 0, 26, 0, 16, 128, + 129, 0, 0, 0, 5, 0, + 0, 0, 55, 0, 0, 9, + 114, 0, 16, 0, 3, 0, + 0, 0, 166, 10, 16, 0, + 0, 0, 0, 0, 70, 2, + 16, 0, 4, 0, 0, 0, + 70, 2, 16, 0, 5, 0, + 0, 0, 56, 0, 0, 8, + 114, 0, 16, 0, 4, 0, + 0, 0, 86, 5, 16, 0, + 1, 0, 0, 0, 70, 130, + 32, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 50, 0, + 0, 10, 114, 0, 16, 0, + 4, 0, 0, 0, 70, 130, + 32, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 6, 0, + 16, 0, 1, 0, 0, 0, + 70, 2, 16, 0, 4, 0, + 0, 0, 50, 0, 0, 10, + 114, 0, 16, 0, 4, 0, + 0, 0, 70, 130, 32, 0, + 0, 0, 0, 0, 14, 0, + 0, 0, 166, 10, 16, 0, + 1, 0, 0, 0, 70, 2, + 16, 0, 4, 0, 0, 0, + 0, 0, 0, 8, 114, 0, + 16, 0, 4, 0, 0, 0, + 70, 2, 16, 0, 4, 0, + 0, 0, 70, 130, 32, 0, + 0, 0, 0, 0, 15, 0, + 0, 0, 50, 0, 0, 13, + 210, 0, 16, 0, 4, 0, + 0, 0, 6, 137, 32, 0, + 0, 0, 0, 0, 24, 0, + 0, 0, 2, 64, 0, 0, + 154, 153, 25, 62, 0, 0, + 0, 0, 154, 153, 25, 62, + 154, 153, 25, 62, 6, 9, + 16, 0, 4, 0, 0, 0, + 56, 0, 0, 8, 242, 0, + 16, 0, 5, 0, 0, 0, + 166, 10, 16, 0, 4, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 26, 0, + 0, 0, 50, 0, 0, 10, + 242, 0, 16, 0, 5, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 25, 0, + 0, 0, 6, 0, 16, 0, + 4, 0, 0, 0, 70, 14, + 16, 0, 5, 0, 0, 0, + 50, 0, 0, 10, 242, 0, + 16, 0, 5, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 27, 0, 0, 0, + 246, 15, 16, 0, 4, 0, + 0, 0, 70, 14, 16, 0, + 5, 0, 0, 0, 0, 0, + 0, 8, 242, 0, 16, 0, + 5, 0, 0, 0, 70, 14, + 16, 0, 5, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 28, 0, 0, 0, + 14, 0, 0, 7, 210, 0, + 16, 0, 4, 0, 0, 0, + 6, 9, 16, 0, 5, 0, + 0, 0, 246, 15, 16, 0, + 5, 0, 0, 0, 50, 0, + 0, 15, 114, 0, 16, 0, + 5, 0, 0, 0, 134, 3, + 16, 0, 4, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 63, 0, 0, 0, 63, + 0, 0, 128, 63, 0, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 63, 0, 0, + 0, 63, 0, 0, 0, 0, + 0, 0, 0, 0, 49, 0, + 0, 7, 66, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 5, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 0, 0, 49, 0, 0, 7, + 130, 0, 16, 0, 0, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 10, 0, + 16, 0, 5, 0, 0, 0, + 60, 0, 0, 7, 66, 0, + 16, 0, 0, 0, 0, 0, + 58, 0, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 0, 0, 0, 0, 0, 0, + 0, 9, 130, 0, 16, 0, + 0, 0, 0, 0, 26, 128, + 32, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 32, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 56, 0, + 0, 8, 18, 0, 16, 0, + 6, 0, 0, 0, 10, 128, + 32, 0, 0, 0, 0, 0, + 32, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 3, 59, + 56, 0, 0, 7, 34, 0, + 16, 0, 6, 0, 0, 0, + 58, 0, 16, 0, 0, 0, + 0, 0, 1, 64, 0, 0, + 111, 18, 3, 59, 0, 0, + 0, 8, 130, 0, 16, 0, + 5, 0, 0, 0, 26, 0, + 16, 128, 65, 0, 0, 0, + 5, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 0, 0, 0, 7, 82, 0, + 16, 0, 4, 0, 0, 0, + 6, 3, 16, 0, 5, 0, + 0, 0, 6, 1, 16, 0, + 6, 0, 0, 0, 70, 0, + 0, 141, 194, 0, 0, 128, + 67, 85, 21, 0, 130, 0, + 16, 0, 0, 0, 0, 0, + 134, 0, 16, 0, 4, 0, + 0, 0, 6, 112, 16, 0, + 2, 0, 0, 0, 0, 96, + 16, 0, 1, 0, 0, 0, + 42, 0, 16, 0, 5, 0, + 0, 0, 0, 0, 0, 9, + 130, 0, 16, 0, 1, 0, + 0, 0, 26, 128, 32, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 33, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 56, 0, 0, 8, + 18, 0, 16, 0, 6, 0, + 0, 0, 10, 128, 32, 0, + 0, 0, 0, 0, 33, 0, + 0, 0, 1, 64, 0, 0, + 111, 18, 3, 59, 56, 0, + 0, 7, 34, 0, 16, 0, + 6, 0, 0, 0, 58, 0, + 16, 0, 1, 0, 0, 0, + 1, 64, 0, 0, 111, 18, + 3, 59, 0, 0, 0, 7, + 82, 0, 16, 0, 4, 0, + 0, 0, 6, 3, 16, 0, + 5, 0, 0, 0, 6, 1, + 16, 0, 6, 0, 0, 0, + 70, 0, 0, 141, 194, 0, + 0, 128, 67, 85, 21, 0, + 130, 0, 16, 0, 1, 0, + 0, 0, 134, 0, 16, 0, + 4, 0, 0, 0, 6, 112, + 16, 0, 2, 0, 0, 0, + 0, 96, 16, 0, 1, 0, + 0, 0, 42, 0, 16, 0, + 5, 0, 0, 0, 0, 0, + 0, 9, 130, 0, 16, 0, + 2, 0, 0, 0, 26, 128, + 32, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 34, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 56, 0, + 0, 8, 18, 0, 16, 0, + 6, 0, 0, 0, 10, 128, + 32, 0, 0, 0, 0, 0, + 34, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 3, 59, + 56, 0, 0, 7, 34, 0, + 16, 0, 6, 0, 0, 0, + 58, 0, 16, 0, 2, 0, + 0, 0, 1, 64, 0, 0, + 111, 18, 3, 59, 0, 0, + 0, 7, 82, 0, 16, 0, + 4, 0, 0, 0, 6, 3, + 16, 0, 5, 0, 0, 0, + 6, 1, 16, 0, 6, 0, + 0, 0, 70, 0, 0, 141, + 194, 0, 0, 128, 67, 85, + 21, 0, 130, 0, 16, 0, + 2, 0, 0, 0, 134, 0, + 16, 0, 4, 0, 0, 0, + 6, 112, 16, 0, 2, 0, + 0, 0, 0, 96, 16, 0, + 1, 0, 0, 0, 42, 0, + 16, 0, 5, 0, 0, 0, + 0, 0, 0, 9, 130, 0, + 16, 0, 3, 0, 0, 0, + 26, 128, 32, 128, 65, 0, + 0, 0, 0, 0, 0, 0, + 35, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 56, 0, 0, 8, 18, 0, + 16, 0, 6, 0, 0, 0, + 10, 128, 32, 0, 0, 0, + 0, 0, 35, 0, 0, 0, + 1, 64, 0, 0, 111, 18, + 3, 59, 56, 0, 0, 7, + 34, 0, 16, 0, 6, 0, + 0, 0, 58, 0, 16, 0, + 3, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 3, 59, + 0, 0, 0, 7, 82, 0, + 16, 0, 4, 0, 0, 0, + 6, 3, 16, 0, 5, 0, + 0, 0, 6, 1, 16, 0, + 6, 0, 0, 0, 70, 0, + 0, 141, 194, 0, 0, 128, + 67, 85, 21, 0, 130, 0, + 16, 0, 3, 0, 0, 0, + 134, 0, 16, 0, 4, 0, + 0, 0, 6, 112, 16, 0, + 2, 0, 0, 0, 0, 96, + 16, 0, 1, 0, 0, 0, + 42, 0, 16, 0, 5, 0, + 0, 0, 0, 0, 0, 9, + 18, 0, 16, 0, 4, 0, + 0, 0, 26, 128, 32, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 36, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 56, 0, 0, 8, + 18, 0, 16, 0, 6, 0, + 0, 0, 10, 128, 32, 0, + 0, 0, 0, 0, 36, 0, + 0, 0, 1, 64, 0, 0, + 111, 18, 3, 59, 56, 0, + 0, 7, 34, 0, 16, 0, + 6, 0, 0, 0, 10, 0, + 16, 0, 4, 0, 0, 0, + 1, 64, 0, 0, 111, 18, + 3, 59, 0, 0, 0, 7, + 82, 0, 16, 0, 4, 0, + 0, 0, 6, 3, 16, 0, + 5, 0, 0, 0, 6, 1, + 16, 0, 6, 0, 0, 0, + 70, 0, 0, 141, 194, 0, + 0, 128, 67, 85, 21, 0, + 18, 0, 16, 0, 4, 0, + 0, 0, 134, 0, 16, 0, + 4, 0, 0, 0, 6, 112, + 16, 0, 2, 0, 0, 0, + 0, 96, 16, 0, 1, 0, + 0, 0, 42, 0, 16, 0, + 5, 0, 0, 0, 0, 0, + 0, 9, 66, 0, 16, 0, + 4, 0, 0, 0, 26, 128, + 32, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 37, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 56, 0, + 0, 8, 18, 0, 16, 0, + 6, 0, 0, 0, 10, 128, + 32, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 3, 59, + 56, 0, 0, 7, 34, 0, + 16, 0, 6, 0, 0, 0, + 42, 0, 16, 0, 4, 0, + 0, 0, 1, 64, 0, 0, + 111, 18, 3, 59, 0, 0, + 0, 7, 194, 0, 16, 0, + 4, 0, 0, 0, 6, 12, + 16, 0, 5, 0, 0, 0, + 6, 4, 16, 0, 6, 0, + 0, 0, 70, 0, 0, 141, + 194, 0, 0, 128, 67, 85, + 21, 0, 66, 0, 16, 0, + 4, 0, 0, 0, 230, 10, + 16, 0, 4, 0, 0, 0, + 6, 112, 16, 0, 2, 0, + 0, 0, 0, 96, 16, 0, + 1, 0, 0, 0, 42, 0, + 16, 0, 5, 0, 0, 0, + 0, 0, 0, 9, 130, 0, + 16, 0, 4, 0, 0, 0, + 26, 128, 32, 128, 65, 0, + 0, 0, 0, 0, 0, 0, + 38, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 56, 0, 0, 8, 18, 0, + 16, 0, 6, 0, 0, 0, + 10, 128, 32, 0, 0, 0, + 0, 0, 38, 0, 0, 0, + 1, 64, 0, 0, 111, 18, + 3, 59, 56, 0, 0, 7, + 34, 0, 16, 0, 6, 0, + 0, 0, 58, 0, 16, 0, + 4, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 3, 59, + 0, 0, 0, 7, 50, 0, + 16, 0, 6, 0, 0, 0, + 198, 0, 16, 0, 5, 0, + 0, 0, 70, 0, 16, 0, + 6, 0, 0, 0, 70, 0, + 0, 141, 194, 0, 0, 128, + 67, 85, 21, 0, 130, 0, + 16, 0, 4, 0, 0, 0, + 70, 0, 16, 0, 6, 0, + 0, 0, 6, 112, 16, 0, + 2, 0, 0, 0, 0, 96, + 16, 0, 1, 0, 0, 0, + 42, 0, 16, 0, 5, 0, + 0, 0, 0, 0, 0, 9, + 18, 0, 16, 0, 6, 0, + 0, 0, 26, 128, 32, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 39, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 56, 0, 0, 8, + 18, 0, 16, 0, 7, 0, + 0, 0, 10, 128, 32, 0, + 0, 0, 0, 0, 39, 0, + 0, 0, 1, 64, 0, 0, + 111, 18, 3, 59, 56, 0, + 0, 7, 34, 0, 16, 0, + 7, 0, 0, 0, 10, 0, + 16, 0, 6, 0, 0, 0, + 1, 64, 0, 0, 111, 18, + 3, 59, 0, 0, 0, 7, + 146, 0, 16, 0, 5, 0, + 0, 0, 6, 12, 16, 0, + 5, 0, 0, 0, 6, 4, + 16, 0, 7, 0, 0, 0, + 70, 0, 0, 141, 194, 0, + 0, 128, 67, 85, 21, 0, + 18, 0, 16, 0, 5, 0, + 0, 0, 198, 0, 16, 0, + 5, 0, 0, 0, 6, 112, + 16, 0, 2, 0, 0, 0, + 0, 96, 16, 0, 1, 0, + 0, 0, 42, 0, 16, 0, + 5, 0, 0, 0, 31, 0, + 0, 3, 42, 0, 16, 0, + 0, 0, 0, 0, 49, 0, + 0, 7, 66, 0, 16, 0, + 0, 0, 0, 0, 26, 0, + 16, 0, 5, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 0, 0, 49, 0, 0, 7, + 34, 0, 16, 0, 5, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 26, 0, + 16, 0, 5, 0, 0, 0, + 60, 0, 0, 7, 66, 0, + 16, 0, 0, 0, 0, 0, + 42, 0, 16, 0, 0, 0, + 0, 0, 26, 0, 16, 0, + 5, 0, 0, 0, 31, 0, + 0, 3, 42, 0, 16, 0, + 0, 0, 0, 0, 0, 0, + 0, 7, 66, 0, 16, 0, + 0, 0, 0, 0, 58, 0, + 16, 0, 0, 0, 0, 0, + 58, 0, 16, 0, 1, 0, + 0, 0, 0, 0, 0, 7, + 66, 0, 16, 0, 0, 0, + 0, 0, 58, 0, 16, 0, + 2, 0, 0, 0, 42, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 0, 7, 66, 0, + 16, 0, 0, 0, 0, 0, + 58, 0, 16, 0, 3, 0, + 0, 0, 42, 0, 16, 0, + 0, 0, 0, 0, 0, 0, + 0, 7, 66, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 4, 0, 0, 0, + 42, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 7, + 66, 0, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 4, 0, 0, 0, 42, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 0, 7, 66, 0, + 16, 0, 0, 0, 0, 0, + 58, 0, 16, 0, 4, 0, + 0, 0, 42, 0, 16, 0, + 0, 0, 0, 0, 0, 0, + 0, 7, 66, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 5, 0, 0, 0, + 42, 0, 16, 0, 0, 0, + 0, 0, 56, 0, 0, 7, + 66, 0, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 62, + 18, 0, 0, 1, 54, 0, + 0, 5, 66, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 21, 0, 0, 1, 18, 0, + 0, 1, 54, 0, 0, 5, + 66, 0, 16, 0, 0, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 21, 0, + 0, 1, 56, 0, 0, 9, + 210, 0, 16, 0, 4, 0, + 0, 0, 6, 137, 32, 0, + 0, 0, 0, 0, 5, 0, + 0, 0, 86, 133, 32, 0, + 0, 0, 0, 0, 24, 0, + 0, 0, 50, 0, 0, 11, + 210, 0, 16, 0, 4, 0, + 0, 0, 6, 137, 32, 0, + 0, 0, 0, 0, 4, 0, + 0, 0, 6, 128, 32, 0, + 0, 0, 0, 0, 24, 0, + 0, 0, 6, 14, 16, 0, + 4, 0, 0, 0, 50, 0, + 0, 11, 210, 0, 16, 0, + 4, 0, 0, 0, 6, 137, + 32, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 166, 138, + 32, 0, 0, 0, 0, 0, + 24, 0, 0, 0, 6, 14, + 16, 0, 4, 0, 0, 0, + 16, 0, 0, 7, 130, 0, + 16, 0, 0, 0, 0, 0, + 70, 2, 16, 0, 1, 0, + 0, 0, 70, 2, 16, 0, + 1, 0, 0, 0, 68, 0, + 0, 5, 130, 0, 16, 0, + 0, 0, 0, 0, 58, 0, + 16, 0, 0, 0, 0, 0, + 56, 0, 0, 7, 114, 0, + 16, 0, 5, 0, 0, 0, + 246, 15, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 1, 0, 0, 0, 56, 0, + 0, 7, 114, 0, 16, 0, + 6, 0, 0, 0, 70, 2, + 16, 0, 2, 0, 0, 0, + 70, 2, 16, 0, 3, 0, + 0, 0, 50, 0, 0, 10, + 114, 0, 16, 0, 2, 0, + 0, 0, 38, 9, 16, 0, + 2, 0, 0, 0, 150, 4, + 16, 0, 3, 0, 0, 0, + 70, 2, 16, 128, 65, 0, + 0, 0, 6, 0, 0, 0, + 16, 0, 0, 7, 130, 0, + 16, 0, 1, 0, 0, 0, + 70, 2, 16, 0, 2, 0, + 0, 0, 70, 2, 16, 0, + 2, 0, 0, 0, 68, 0, + 0, 5, 130, 0, 16, 0, + 1, 0, 0, 0, 58, 0, + 16, 0, 1, 0, 0, 0, + 56, 0, 0, 7, 114, 0, + 16, 0, 2, 0, 0, 0, + 246, 15, 16, 0, 1, 0, + 0, 0, 70, 2, 16, 0, + 2, 0, 0, 0, 50, 0, + 0, 10, 178, 0, 16, 0, + 1, 0, 0, 0, 70, 8, + 16, 128, 65, 0, 0, 0, + 1, 0, 0, 0, 246, 15, + 16, 0, 0, 0, 0, 0, + 134, 12, 16, 0, 4, 0, + 0, 0, 16, 0, 0, 7, + 130, 0, 16, 0, 0, 0, + 0, 0, 70, 3, 16, 0, + 1, 0, 0, 0, 70, 3, + 16, 0, 1, 0, 0, 0, + 68, 0, 0, 5, 130, 0, + 16, 0, 0, 0, 0, 0, + 58, 0, 16, 0, 0, 0, + 0, 0, 56, 0, 0, 7, + 178, 0, 16, 0, 1, 0, + 0, 0, 246, 15, 16, 0, + 0, 0, 0, 0, 70, 12, + 16, 0, 1, 0, 0, 0, + 16, 0, 0, 9, 130, 0, + 16, 0, 0, 0, 0, 0, + 70, 2, 16, 128, 65, 0, + 0, 0, 2, 0, 0, 0, + 70, 2, 16, 128, 65, 0, + 0, 0, 5, 0, 0, 0, + 52, 0, 0, 7, 130, 0, + 16, 0, 0, 0, 0, 0, + 58, 0, 16, 0, 0, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 8, 130, 0, 16, 0, + 0, 0, 0, 0, 58, 0, + 16, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 56, 0, 0, 7, 130, 0, + 16, 0, 2, 0, 0, 0, + 58, 0, 16, 0, 0, 0, + 0, 0, 58, 0, 16, 0, + 0, 0, 0, 0, 56, 0, + 0, 7, 130, 0, 16, 0, + 0, 0, 0, 0, 58, 0, + 16, 0, 0, 0, 0, 0, + 58, 0, 16, 0, 2, 0, + 0, 0, 50, 0, 0, 9, + 130, 0, 16, 0, 0, 0, + 0, 0, 58, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 102, 102, 102, 63, + 1, 64, 0, 0, 205, 204, + 204, 61, 16, 0, 0, 8, + 130, 0, 16, 0, 2, 0, + 0, 0, 134, 3, 16, 0, + 4, 0, 0, 0, 70, 2, + 16, 128, 65, 0, 0, 0, + 2, 0, 0, 0, 16, 0, + 0, 8, 18, 0, 16, 0, + 3, 0, 0, 0, 70, 2, + 16, 0, 5, 0, 0, 0, + 70, 2, 16, 128, 65, 0, + 0, 0, 2, 0, 0, 0, + 0, 0, 0, 7, 18, 0, + 16, 0, 3, 0, 0, 0, + 10, 0, 16, 0, 3, 0, + 0, 0, 10, 0, 16, 0, + 3, 0, 0, 0, 50, 0, + 0, 9, 114, 0, 16, 0, + 3, 0, 0, 0, 70, 2, + 16, 0, 2, 0, 0, 0, + 6, 0, 16, 0, 3, 0, + 0, 0, 70, 2, 16, 0, + 5, 0, 0, 0, 56, 0, + 0, 8, 130, 0, 16, 0, + 3, 0, 0, 0, 26, 0, + 16, 0, 3, 0, 0, 0, + 26, 128, 32, 0, 0, 0, + 0, 0, 13, 0, 0, 0, + 50, 0, 0, 10, 130, 0, + 16, 0, 3, 0, 0, 0, + 26, 128, 32, 0, 0, 0, + 0, 0, 12, 0, 0, 0, + 10, 0, 16, 0, 3, 0, + 0, 0, 58, 0, 16, 0, + 3, 0, 0, 0, 50, 0, + 0, 10, 66, 0, 16, 0, + 3, 0, 0, 0, 26, 128, + 32, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 42, 0, + 16, 0, 3, 0, 0, 0, + 58, 0, 16, 0, 3, 0, + 0, 0, 56, 0, 0, 11, + 50, 0, 16, 0, 5, 0, + 0, 0, 166, 138, 32, 0, + 0, 0, 0, 0, 31, 0, + 0, 0, 2, 64, 0, 0, + 205, 204, 204, 60, 205, 204, + 204, 61, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 7, 130, 0, 16, 0, + 3, 0, 0, 0, 26, 0, + 16, 0, 4, 0, 0, 0, + 1, 64, 0, 0, 205, 204, + 204, 189, 56, 32, 0, 7, + 130, 0, 16, 0, 3, 0, + 0, 0, 58, 0, 16, 0, + 3, 0, 0, 0, 1, 64, + 0, 0, 85, 85, 85, 64, + 50, 0, 0, 9, 18, 0, + 16, 0, 4, 0, 0, 0, + 58, 0, 16, 0, 3, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 0, 192, 1, 64, + 0, 0, 0, 0, 64, 64, + 56, 0, 0, 7, 130, 0, + 16, 0, 3, 0, 0, 0, + 58, 0, 16, 0, 3, 0, + 0, 0, 58, 0, 16, 0, + 3, 0, 0, 0, 56, 0, + 0, 7, 130, 0, 16, 0, + 3, 0, 0, 0, 58, 0, + 16, 0, 3, 0, 0, 0, + 10, 0, 16, 0, 4, 0, + 0, 0, 56, 0, 0, 7, + 130, 0, 16, 0, 3, 0, + 0, 0, 58, 0, 16, 0, + 3, 0, 0, 0, 10, 0, + 16, 0, 5, 0, 0, 0, + 56, 0, 0, 8, 50, 0, + 16, 0, 4, 0, 0, 0, + 70, 0, 16, 128, 65, 0, + 0, 0, 2, 0, 0, 0, + 246, 15, 16, 0, 3, 0, + 0, 0, 50, 0, 0, 12, + 50, 0, 16, 0, 4, 0, + 0, 0, 70, 0, 16, 0, + 4, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 64, 63, + 0, 0, 128, 63, 0, 0, + 0, 0, 0, 0, 0, 0, + 70, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 12, + 242, 0, 16, 0, 6, 0, + 0, 0, 70, 142, 32, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 29, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 128, 63, 0, 0, 128, 63, + 0, 0, 128, 63, 0, 0, + 128, 63, 50, 0, 0, 16, + 114, 0, 16, 0, 6, 0, + 0, 0, 70, 2, 16, 128, + 65, 0, 0, 0, 6, 0, + 0, 0, 2, 64, 0, 0, + 11, 215, 35, 63, 11, 215, + 35, 63, 11, 215, 35, 63, + 0, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 128, 63, + 0, 0, 128, 63, 0, 0, + 128, 63, 0, 0, 0, 0, + 56, 0, 0, 8, 114, 0, + 16, 0, 6, 0, 0, 0, + 70, 2, 16, 0, 6, 0, + 0, 0, 246, 143, 32, 0, + 0, 0, 0, 0, 29, 0, + 0, 0, 69, 0, 0, 139, + 194, 0, 0, 128, 67, 85, + 21, 0, 114, 0, 16, 0, + 4, 0, 0, 0, 70, 0, + 16, 0, 4, 0, 0, 0, + 70, 126, 16, 0, 1, 0, + 0, 0, 0, 96, 16, 0, + 0, 0, 0, 0, 56, 0, + 0, 7, 114, 0, 16, 0, + 7, 0, 0, 0, 70, 2, + 16, 0, 6, 0, 0, 0, + 70, 2, 16, 0, 4, 0, + 0, 0, 54, 0, 0, 8, + 82, 0, 16, 0, 5, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 64, 63, 0, 0, + 0, 0, 0, 0, 128, 63, + 0, 0, 0, 0, 56, 0, + 0, 7, 50, 0, 16, 0, + 3, 0, 0, 0, 70, 0, + 16, 0, 3, 0, 0, 0, + 150, 5, 16, 0, 5, 0, + 0, 0, 56, 0, 0, 8, + 34, 0, 16, 0, 5, 0, + 0, 0, 42, 128, 32, 0, + 0, 0, 0, 0, 31, 0, + 0, 0, 1, 64, 0, 0, + 205, 204, 204, 61, 56, 0, + 0, 7, 50, 0, 16, 0, + 3, 0, 0, 0, 70, 0, + 16, 0, 3, 0, 0, 0, + 70, 0, 16, 0, 5, 0, + 0, 0, 14, 0, 0, 7, + 50, 0, 16, 0, 3, 0, + 0, 0, 70, 0, 16, 0, + 3, 0, 0, 0, 166, 10, + 16, 0, 1, 0, 0, 0, + 0, 0, 0, 8, 50, 0, + 16, 0, 0, 0, 0, 0, + 70, 0, 16, 0, 0, 0, + 0, 0, 70, 0, 16, 128, + 65, 0, 0, 0, 3, 0, + 0, 0, 69, 0, 0, 139, + 194, 0, 0, 128, 67, 85, + 21, 0, 178, 0, 16, 0, + 3, 0, 0, 0, 70, 0, + 16, 0, 0, 0, 0, 0, + 70, 123, 16, 0, 1, 0, + 0, 0, 0, 96, 16, 0, + 0, 0, 0, 0, 0, 0, + 0, 7, 18, 0, 16, 0, + 0, 0, 0, 0, 42, 0, + 16, 0, 3, 0, 0, 0, + 1, 64, 0, 0, 154, 153, + 25, 190, 56, 32, 0, 7, + 18, 0, 16, 0, 0, 0, + 0, 0, 10, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 1, 0, 32, 65, + 50, 0, 0, 9, 34, 0, + 16, 0, 0, 0, 0, 0, + 10, 0, 16, 0, 0, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 0, 192, 1, 64, + 0, 0, 0, 0, 64, 64, + 56, 0, 0, 7, 18, 0, + 16, 0, 0, 0, 0, 0, + 10, 0, 16, 0, 0, 0, + 0, 0, 10, 0, 16, 0, + 0, 0, 0, 0, 56, 0, + 0, 7, 18, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 0, 0, 0, 0, + 26, 0, 16, 0, 0, 0, + 0, 0, 56, 0, 0, 7, + 18, 0, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 0, 0, 0, 0, + 56, 0, 0, 10, 114, 0, + 16, 0, 5, 0, 0, 0, + 6, 0, 16, 0, 0, 0, + 0, 0, 2, 64, 0, 0, + 8, 215, 163, 60, 40, 92, + 15, 62, 40, 92, 143, 62, + 0, 0, 0, 0, 50, 0, + 0, 9, 114, 0, 16, 0, + 3, 0, 0, 0, 70, 3, + 16, 0, 3, 0, 0, 0, + 166, 10, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 5, 0, 0, 0, 0, 0, + 0, 10, 114, 0, 16, 0, + 3, 0, 0, 0, 70, 2, + 16, 0, 3, 0, 0, 0, + 2, 64, 0, 0, 205, 204, + 204, 61, 205, 204, 204, 61, + 205, 204, 76, 62, 0, 0, + 0, 0, 50, 0, 0, 9, + 18, 0, 16, 0, 0, 0, + 0, 0, 58, 0, 16, 0, + 2, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 63, + 1, 64, 0, 0, 0, 0, + 0, 63, 52, 0, 0, 7, + 34, 0, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 205, 204, 204, 62, + 56, 0, 0, 7, 18, 0, + 16, 0, 0, 0, 0, 0, + 26, 0, 16, 0, 0, 0, + 0, 0, 10, 0, 16, 0, + 0, 0, 0, 0, 50, 0, + 0, 15, 114, 0, 16, 0, + 0, 0, 0, 0, 6, 0, + 16, 0, 0, 0, 0, 0, + 2, 64, 0, 0, 144, 194, + 53, 63, 219, 249, 30, 63, + 134, 235, 209, 62, 0, 0, + 0, 0, 2, 64, 0, 0, + 225, 122, 148, 62, 74, 12, + 194, 62, 61, 10, 23, 63, + 0, 0, 0, 0, 56, 0, + 0, 8, 114, 0, 16, 0, + 0, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 70, 130, 32, 0, 0, 0, + 0, 0, 29, 0, 0, 0, + 16, 0, 0, 8, 18, 0, + 16, 0, 1, 0, 0, 0, + 70, 3, 16, 0, 1, 0, + 0, 0, 70, 2, 16, 128, + 65, 0, 0, 0, 2, 0, + 0, 0, 52, 0, 0, 7, + 18, 0, 16, 0, 1, 0, + 0, 0, 10, 0, 16, 0, + 1, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 0, + 47, 0, 0, 5, 18, 0, + 16, 0, 1, 0, 0, 0, + 10, 0, 16, 0, 1, 0, + 0, 0, 56, 0, 0, 7, + 18, 0, 16, 0, 1, 0, + 0, 0, 10, 0, 16, 0, + 1, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 200, 67, + 25, 0, 0, 5, 18, 0, + 16, 0, 1, 0, 0, 0, + 10, 0, 16, 0, 1, 0, + 0, 0, 50, 0, 0, 11, + 98, 0, 16, 0, 1, 0, + 0, 0, 166, 139, 32, 0, + 0, 0, 0, 0, 10, 0, + 0, 0, 166, 10, 16, 0, + 1, 0, 0, 0, 166, 139, + 32, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 14, 0, + 0, 6, 1, 192, 0, 0, + 26, 0, 16, 0, 1, 0, + 0, 0, 42, 0, 16, 0, + 1, 0, 0, 0, 50, 0, + 0, 10, 226, 0, 16, 0, + 1, 0, 0, 0, 6, 9, + 16, 128, 65, 0, 0, 0, + 4, 0, 0, 0, 6, 9, + 16, 0, 6, 0, 0, 0, + 6, 9, 16, 0, 3, 0, + 0, 0, 50, 0, 0, 9, + 226, 0, 16, 0, 1, 0, + 0, 0, 246, 15, 16, 0, + 0, 0, 0, 0, 86, 14, + 16, 0, 1, 0, 0, 0, + 6, 9, 16, 0, 7, 0, + 0, 0, 50, 0, 0, 12, + 114, 0, 16, 0, 1, 0, + 0, 0, 6, 0, 16, 0, + 1, 0, 0, 0, 2, 64, + 0, 0, 154, 153, 153, 63, + 154, 153, 153, 63, 154, 153, + 153, 63, 0, 0, 0, 0, + 150, 7, 16, 0, 1, 0, + 0, 0, 56, 0, 0, 8, + 114, 0, 16, 0, 1, 0, + 0, 0, 70, 2, 16, 0, + 1, 0, 0, 0, 246, 143, + 32, 0, 0, 0, 0, 0, + 29, 0, 0, 0, 50, 0, + 0, 9, 114, 32, 16, 0, + 0, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 246, 15, 16, 0, 6, 0, + 0, 0, 70, 2, 16, 0, + 1, 0, 0, 0, 54, 0, + 0, 5, 130, 32, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 62, 0, 0, 1, 83, 84, + 65, 84, 148, 0, 0, 0, + 192, 0, 0, 0, 8, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 155, 0, + 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 3, 0, + 0, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 8, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 10, 0, + 0, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0 +}; diff --git a/demo/d3d/shaders/debugLinePS.hlsl b/demo/d3d/shaders/debugLinePS.hlsl new file mode 100644 index 0000000..d01847b --- /dev/null +++ b/demo/d3d/shaders/debugLinePS.hlsl @@ -0,0 +1,10 @@ +struct Input +{ + float4 position : SV_POSITION; + float4 color : COLOR; +}; + +float4 debugLinePS(Input input) : SV_TARGET +{ + return input.color; +} diff --git a/demo/d3d/shaders/debugLinePS.hlsl.h b/demo/d3d/shaders/debugLinePS.hlsl.h new file mode 100644 index 0000000..6243104 --- /dev/null +++ b/demo/d3d/shaders/debugLinePS.hlsl.h @@ -0,0 +1,121 @@ +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_POSITION 0 xyzw 0 POS float +// COLOR 0 xyzw 1 NONE float xyzw +// +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_TARGET 0 xyzw 0 TARGET float xyzw +// +ps_5_0 +dcl_globalFlags refactoringAllowed +dcl_input_ps linear v1.xyzw +dcl_output o0.xyzw +mov o0.xyzw, v1.xyzw +ret +// Approximately 2 instruction slots used +#endif + +const BYTE g_debugLinePS[] = +{ + 68, 88, 66, 67, 51, 80, + 148, 24, 206, 189, 182, 148, + 220, 111, 88, 236, 138, 6, + 146, 179, 1, 0, 0, 0, + 20, 2, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, + 172, 0, 0, 0, 0, 1, + 0, 0, 52, 1, 0, 0, + 120, 1, 0, 0, 82, 68, + 69, 70, 112, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 60, 0, 0, 0, 0, 5, + 255, 255, 0, 1, 0, 0, + 60, 0, 0, 0, 82, 68, + 49, 49, 60, 0, 0, 0, + 24, 0, 0, 0, 32, 0, + 0, 0, 40, 0, 0, 0, + 36, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 77, 105, 99, 114, 111, 115, + 111, 102, 116, 32, 40, 82, + 41, 32, 72, 76, 83, 76, + 32, 83, 104, 97, 100, 101, + 114, 32, 67, 111, 109, 112, + 105, 108, 101, 114, 32, 54, + 46, 51, 46, 57, 54, 48, + 48, 46, 49, 54, 51, 56, + 52, 0, 171, 171, 73, 83, + 71, 78, 76, 0, 0, 0, + 2, 0, 0, 0, 8, 0, + 0, 0, 56, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 15, 0, + 0, 0, 68, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 15, 15, + 0, 0, 83, 86, 95, 80, + 79, 83, 73, 84, 73, 79, + 78, 0, 67, 79, 76, 79, + 82, 0, 171, 171, 79, 83, + 71, 78, 44, 0, 0, 0, + 1, 0, 0, 0, 8, 0, + 0, 0, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 15, 0, + 0, 0, 83, 86, 95, 84, + 65, 82, 71, 69, 84, 0, + 171, 171, 83, 72, 69, 88, + 60, 0, 0, 0, 80, 0, + 0, 0, 15, 0, 0, 0, + 106, 8, 0, 1, 98, 16, + 0, 3, 242, 16, 16, 0, + 1, 0, 0, 0, 101, 0, + 0, 3, 242, 32, 16, 0, + 0, 0, 0, 0, 54, 0, + 0, 5, 242, 32, 16, 0, + 0, 0, 0, 0, 70, 30, + 16, 0, 1, 0, 0, 0, + 62, 0, 0, 1, 83, 84, + 65, 84, 148, 0, 0, 0, + 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0 +}; diff --git a/demo/d3d/shaders/debugLineVS.hlsl b/demo/d3d/shaders/debugLineVS.hlsl new file mode 100644 index 0000000..1033b35 --- /dev/null +++ b/demo/d3d/shaders/debugLineVS.hlsl @@ -0,0 +1,26 @@ + +cbuffer params : register(b0) +{ + float4x4 projectionViewWorld; +}; + +struct Input +{ + float3 position : POSITION; + float4 color : COLOR; +}; + +struct Output +{ + float4 position : SV_POSITION; + float4 color : COLOR; +}; + +Output debugLineVS(Input input) +{ + Output output; + output.position = mul(projectionViewWorld, float4(input.position, 1.0f)); + output.color = input.color; + + return output; +} diff --git a/demo/d3d/shaders/debugLineVS.hlsl.h b/demo/d3d/shaders/debugLineVS.hlsl.h new file mode 100644 index 0000000..cdf7e4b --- /dev/null +++ b/demo/d3d/shaders/debugLineVS.hlsl.h @@ -0,0 +1,213 @@ +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// Buffer Definitions: +// +// cbuffer params +// { +// +// float4x4 projectionViewWorld; // Offset: 0 Size: 64 +// +// } +// +// +// Resource Bindings: +// +// Name Type Format Dim Slot Elements +// ------------------------------ ---------- ------- ----------- ---- -------- +// params cbuffer NA NA 0 1 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// POSITION 0 xyz 0 NONE float xyz +// COLOR 0 xyzw 1 NONE float xyzw +// +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_POSITION 0 xyzw 0 POS float xyzw +// COLOR 0 xyzw 1 NONE float xyzw +// +vs_5_0 +dcl_globalFlags refactoringAllowed +dcl_constantbuffer cb0[4], immediateIndexed +dcl_input v0.xyz +dcl_input v1.xyzw +dcl_output_siv o0.xyzw, position +dcl_output o1.xyzw +dcl_temps 1 +mul r0.xyzw, v0.yyyy, cb0[1].xyzw +mad r0.xyzw, cb0[0].xyzw, v0.xxxx, r0.xyzw +mad r0.xyzw, cb0[2].xyzw, v0.zzzz, r0.xyzw +add o0.xyzw, r0.xyzw, cb0[3].xyzw +mov o1.xyzw, v1.xyzw +ret +// Approximately 6 instruction slots used +#endif + +const BYTE g_debugLineVS[] = +{ + 68, 88, 66, 67, 240, 24, + 40, 204, 192, 159, 63, 125, + 158, 223, 41, 237, 85, 39, + 230, 54, 1, 0, 0, 0, + 160, 3, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, + 88, 1, 0, 0, 168, 1, + 0, 0, 252, 1, 0, 0, + 4, 3, 0, 0, 82, 68, + 69, 70, 28, 1, 0, 0, + 1, 0, 0, 0, 100, 0, + 0, 0, 1, 0, 0, 0, + 60, 0, 0, 0, 0, 5, + 254, 255, 0, 1, 0, 0, + 232, 0, 0, 0, 82, 68, + 49, 49, 60, 0, 0, 0, + 24, 0, 0, 0, 32, 0, + 0, 0, 40, 0, 0, 0, + 36, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 1, 0, + 0, 0, 112, 97, 114, 97, + 109, 115, 0, 171, 92, 0, + 0, 0, 1, 0, 0, 0, + 124, 0, 0, 0, 64, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 164, 0, + 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 2, 0, + 0, 0, 196, 0, 0, 0, + 0, 0, 0, 0, 255, 255, + 255, 255, 0, 0, 0, 0, + 255, 255, 255, 255, 0, 0, + 0, 0, 112, 114, 111, 106, + 101, 99, 116, 105, 111, 110, + 86, 105, 101, 119, 87, 111, + 114, 108, 100, 0, 102, 108, + 111, 97, 116, 52, 120, 52, + 0, 171, 171, 171, 3, 0, + 3, 0, 4, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 184, 0, 0, 0, 77, 105, + 99, 114, 111, 115, 111, 102, + 116, 32, 40, 82, 41, 32, + 72, 76, 83, 76, 32, 83, + 104, 97, 100, 101, 114, 32, + 67, 111, 109, 112, 105, 108, + 101, 114, 32, 54, 46, 51, + 46, 57, 54, 48, 48, 46, + 49, 54, 51, 56, 52, 0, + 171, 171, 73, 83, 71, 78, + 72, 0, 0, 0, 2, 0, + 0, 0, 8, 0, 0, 0, + 56, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 7, 7, 0, 0, + 65, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 1, 0, + 0, 0, 15, 15, 0, 0, + 80, 79, 83, 73, 84, 73, + 79, 78, 0, 67, 79, 76, + 79, 82, 0, 171, 79, 83, + 71, 78, 76, 0, 0, 0, + 2, 0, 0, 0, 8, 0, + 0, 0, 56, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 15, 0, + 0, 0, 68, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 15, 0, + 0, 0, 83, 86, 95, 80, + 79, 83, 73, 84, 73, 79, + 78, 0, 67, 79, 76, 79, + 82, 0, 171, 171, 83, 72, + 69, 88, 0, 1, 0, 0, + 80, 0, 1, 0, 64, 0, + 0, 0, 106, 8, 0, 1, + 89, 0, 0, 4, 70, 142, + 32, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 95, 0, + 0, 3, 114, 16, 16, 0, + 0, 0, 0, 0, 95, 0, + 0, 3, 242, 16, 16, 0, + 1, 0, 0, 0, 103, 0, + 0, 4, 242, 32, 16, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 101, 0, 0, 3, + 242, 32, 16, 0, 1, 0, + 0, 0, 104, 0, 0, 2, + 1, 0, 0, 0, 56, 0, + 0, 8, 242, 0, 16, 0, + 0, 0, 0, 0, 86, 21, + 16, 0, 0, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 50, 0, 0, 10, 242, 0, + 16, 0, 0, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 6, 16, 16, 0, 0, 0, + 0, 0, 70, 14, 16, 0, + 0, 0, 0, 0, 50, 0, + 0, 10, 242, 0, 16, 0, + 0, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 166, 26, + 16, 0, 0, 0, 0, 0, + 70, 14, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 8, + 242, 32, 16, 0, 0, 0, + 0, 0, 70, 14, 16, 0, + 0, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 54, 0, + 0, 5, 242, 32, 16, 0, + 1, 0, 0, 0, 70, 30, + 16, 0, 1, 0, 0, 0, + 62, 0, 0, 1, 83, 84, + 65, 84, 148, 0, 0, 0, + 6, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0 +}; diff --git a/demo/d3d/shaders/diffuseGS.hlsl b/demo/d3d/shaders/diffuseGS.hlsl new file mode 100644 index 0000000..e7a50d8 --- /dev/null +++ b/demo/d3d/shaders/diffuseGS.hlsl @@ -0,0 +1,83 @@ +#include "shaderCommon.h" + +cbuffer constBuf : register(b0) +{ + DiffuseShaderConst gParams; +}; + +static const float2 corners[4] = +{ + float2(0.0, 1.0), + float2(0.0, 0.0), + float2(1.0, 1.0), + float2(1.0, 0.0) +}; + +[maxvertexcount(4)] +void diffuseGS(point DiffuseVertexOut input[1], inout TriangleStream<DiffuseGeometryOut> triStream) +{ + float4 ndcPos = input[0].ndcPos; + + // frustrum culling + const float ndcBound = 1.0; + if (ndcPos.x < -ndcBound) return; + if (ndcPos.x > ndcBound) return; + if (ndcPos.y < -ndcBound) return; + if (ndcPos.y > ndcBound) return; + + float pointScale = gParams.diffuseScale; + float velocityScale = 1.0; + + float3 v = input[0].viewVel.xyz; + float3 p = input[0].viewPos.xyz; + + // billboard in eye space + float3 u = float3(0.0, pointScale, 0.0); + float3 l = float3(pointScale, 0.0, 0.0); + + // increase size based on life + float lifeTime = input[0].worldPos.w; + + float lifeFade = lerp(1.0f + gParams.diffusion, 1.0, min(1.0, lifeTime*0.25f)); + u *= lifeFade; + l *= lifeFade; + + float fade = 1.0/(lifeFade*lifeFade); + float vlen = length(v)*gParams.motionBlurScale; + + if (vlen > 0.5) + { + float len = max(pointScale, vlen*0.016); + fade = min(1.0, 2.0/(len/pointScale)); + + u = normalize(v)*max(pointScale, vlen*0.016); // assume 60hz + l = normalize(cross(u, float3(0.0, 0.0, -1.0)))*pointScale; + } + + { + DiffuseGeometryOut output; + + output.worldPos = input[0].worldPos; // vertex world pos (life in w) + output.viewPos = input[0].viewPos; // vertex eye pos + output.viewVel.xyz = input[0].viewVel.xyz; // vertex velocity in view space + output.viewVel.w = fade; + output.lightDir = mul(gParams.modelView, float4(gParams.lightDir, 0.0)); + output.color = input[0].color; + + output.uv = float2(0.0, 1.0); + output.clipPos = mul(gParams.projection, float4(p + u - l, 1.0)); + triStream.Append(output); + + output.uv = float2(0.0, 0.0); + output.clipPos = mul(gParams.projection, float4(p - u - l, 1.0)); + triStream.Append(output); + + output.uv = float2(1.0, 1.0); + output.clipPos = mul(gParams.projection, float4(p + u + l, 1.0)); + triStream.Append(output); + + output.uv = float2(1.0, 0.0); + output.clipPos = mul(gParams.projection, float4(p - u + l, 1.0)); + triStream.Append(output); + } +} diff --git a/demo/d3d/shaders/diffuseGS.hlsl.h b/demo/d3d/shaders/diffuseGS.hlsl.h new file mode 100644 index 0000000..6e3efd8 --- /dev/null +++ b/demo/d3d/shaders/diffuseGS.hlsl.h @@ -0,0 +1,973 @@ +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// Buffer Definitions: +// +// cbuffer constBuf +// { +// +// struct DiffuseShaderConst +// { +// +// float3 lightPos; // Offset: 0 +// float pad0; // Offset: 12 +// float3 lightDir; // Offset: 16 +// float pad1; // Offset: 28 +// float4x4 lightTransform; // Offset: 32 +// float4 color; // Offset: 96 +// float4x4 modelView; // Offset: 112 +// float4x4 modelViewProjection; // Offset: 176 +// float4x4 projection; // Offset: 240 +// float4 shadowTaps[12]; // Offset: 304 +// float diffusion; // Offset: 496 +// float diffuseRadius; // Offset: 500 +// float diffuseScale; // Offset: 504 +// float spotMin; // Offset: 508 +// float spotMax; // Offset: 512 +// float motionBlurScale; // Offset: 516 +// float pad3; // Offset: 520 +// float pad4; // Offset: 524 +// +// } gParams; // Offset: 0 Size: 528 +// +// } +// +// +// Resource Bindings: +// +// Name Type Format Dim Slot Elements +// ------------------------------ ---------- ------- ----------- ---- -------- +// constBuf cbuffer NA NA 0 1 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// POSITION 0 xyzw 0 NONE float xyzw +// NCDPOS 0 xyzw 1 NONE float xy +// VIEWPOS 0 xyzw 2 NONE float xyzw +// VIEWVEL 0 xyzw 3 NONE float xyz +// COLOR 0 xyzw 4 NONE float xyzw +// +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_POSITION 0 xyzw 0 POS float xyzw +// POSITION 0 xyzw 1 NONE float xyzw +// VIEWPOS 0 xyzw 2 NONE float xyzw +// VIEWVEL 0 xyzw 3 NONE float xyzw +// LIGHTDIR 0 xyzw 4 NONE float xyzw +// COLOR 0 xyzw 5 NONE float xyzw +// UV 0 xy 6 NONE float xy +// +gs_5_0 +dcl_globalFlags refactoringAllowed +dcl_constantbuffer cb0[33], immediateIndexed +dcl_input v[1][0].xyzw +dcl_input v[1][1].xyzw +dcl_input v[1][2].xyzw +dcl_input v[1][3].xyzw +dcl_input v[1][4].xyzw +dcl_temps 6 +dcl_inputprimitive point +dcl_stream m0 +dcl_outputtopology trianglestrip +dcl_output_siv o0.xyzw, position +dcl_output o1.xyzw +dcl_output o2.xyzw +dcl_output o3.xyzw +dcl_output o4.xyzw +dcl_output o5.xyzw +dcl_output o6.xy +dcl_maxout 4 +lt r0.x, v[0][1].x, l(-1.000000) +if_nz r0.x + ret +endif +lt r0.x, l(1.000000), v[0][1].x +if_nz r0.x + ret +endif +lt r0.x, v[0][1].y, l(-1.000000) +if_nz r0.x + ret +endif +lt r0.x, l(1.000000), v[0][1].y +if_nz r0.x + ret +endif +add r0.x, cb0[31].x, l(1.000000) +mul r0.y, l(0.250000), v[0][0].w +min r0.y, r0.y, l(1.000000) +add r0.z, -r0.x, l(1.000000) +mad r0.x, r0.y, r0.z, r0.x +mov r1.yz, l(0,0,0,0) +mov r1.x, cb0[31].z +mul r1.xyz, r0.xxxx, r1.xyzx +mul r0.x, r0.x, r0.x +div r1.w, l(1.000000, 1.000000, 1.000000, 1.000000), r0.x +dp3 r0.x, v[0][3].xyzx, v[0][3].xyzx +sqrt r0.y, r0.x +mul r0.y, r0.y, cb0[32].y +lt r0.z, l(0.500000), r0.y +mul r0.y, r0.y, l(0.016000) +max r0.y, r0.y, cb0[31].z +div r0.w, r0.y, cb0[31].z +div r0.w, l(2.000000), r0.w +min r2.w, r0.w, l(1.000000) +rsq r0.x, r0.x +mul r3.xyz, r0.xxxx, v[0][3].xyzx +mul r0.xyw, r0.yyyy, r3.xyxz +mul r3.xyz, r0.wxyw, l(0.000000, -1.000000, 0.000000, 0.000000) +mad r3.xyz, r0.ywxy, l(-1.000000, 0.000000, 0.000000, 0.000000), -r3.xyzx +dp2 r3.w, r3.xyxx, r3.xyxx +rsq r3.w, r3.w +mul r3.xyz, r3.wwww, r3.xyzx +mul r2.xyz, r3.xyzx, cb0[31].zzzz +movc r0.xyw, r0.zzzz, r0.xyxw, r1.zxzz +movc r1.xyzw, r0.zzzz, r2.xyzw, r1.xyzw +mul r2.xyzw, cb0[1].yyyy, cb0[8].xyzw +mad r2.xyzw, cb0[7].xyzw, cb0[1].xxxx, r2.xyzw +mad r2.xyzw, cb0[9].xyzw, cb0[1].zzzz, r2.xyzw +add r3.xyz, r0.xywx, v[0][2].xyzx +add r4.xyz, -r1.xyzx, r3.xyzx +mul r5.xyzw, r4.yyyy, cb0[16].xyzw +mad r5.xyzw, cb0[15].xyzw, r4.xxxx, r5.xyzw +mad r4.xyzw, cb0[17].xyzw, r4.zzzz, r5.xyzw +add r4.xyzw, r4.xyzw, cb0[18].xyzw +mov o0.xyzw, r4.xyzw +mov o1.xyzw, v[0][0].xyzw +mov o2.xyzw, v[0][2].xyzw +mov o3.xyz, v[0][3].xyzx +mov o3.w, r1.w +mov o4.xyzw, r2.xyzw +mov o5.xyzw, v[0][4].xyzw +mov o6.xy, l(0,1.000000,0,0) +emit_stream m0 +add r0.xyz, -r0.xywx, v[0][2].xyzx +add r4.xyz, -r1.xyzx, r0.xyzx +mul r5.xyzw, r4.yyyy, cb0[16].xyzw +mad r5.xyzw, cb0[15].xyzw, r4.xxxx, r5.xyzw +mad r4.xyzw, cb0[17].xyzw, r4.zzzz, r5.xyzw +add r4.xyzw, r4.xyzw, cb0[18].xyzw +mov o0.xyzw, r4.xyzw +mov o1.xyzw, v[0][0].xyzw +mov o2.xyzw, v[0][2].xyzw +mov o3.xyz, v[0][3].xyzx +mov o3.w, r1.w +mov o4.xyzw, r2.xyzw +mov o5.xyzw, v[0][4].xyzw +mov o6.xy, l(0,0,0,0) +emit_stream m0 +add r3.xyz, r1.xyzx, r3.xyzx +mul r4.xyzw, r3.yyyy, cb0[16].xyzw +mad r4.xyzw, cb0[15].xyzw, r3.xxxx, r4.xyzw +mad r3.xyzw, cb0[17].xyzw, r3.zzzz, r4.xyzw +add r3.xyzw, r3.xyzw, cb0[18].xyzw +mov o0.xyzw, r3.xyzw +mov o1.xyzw, v[0][0].xyzw +mov o2.xyzw, v[0][2].xyzw +mov o3.xyz, v[0][3].xyzx +mov o3.w, r1.w +mov o4.xyzw, r2.xyzw +mov o5.xyzw, v[0][4].xyzw +mov o6.xy, l(1.000000,1.000000,0,0) +emit_stream m0 +add r0.xyz, r1.xyzx, r0.xyzx +mul r3.xyzw, r0.yyyy, cb0[16].xyzw +mad r3.xyzw, cb0[15].xyzw, r0.xxxx, r3.xyzw +mad r0.xyzw, cb0[17].xyzw, r0.zzzz, r3.xyzw +add r0.xyzw, r0.xyzw, cb0[18].xyzw +mov o0.xyzw, r0.xyzw +mov o1.xyzw, v[0][0].xyzw +mov o2.xyzw, v[0][2].xyzw +mov o3.xyz, v[0][3].xyzx +mov o3.w, r1.w +mov o4.xyzw, r2.xyzw +mov o5.xyzw, v[0][4].xyzw +mov o6.xy, l(1.000000,0,0,0) +emit_stream m0 +ret +// Approximately 108 instruction slots used +#endif + +const BYTE g_diffuseGS[] = +{ + 68, 88, 66, 67, 210, 25, + 219, 88, 83, 177, 178, 56, + 31, 41, 77, 1, 224, 175, + 13, 250, 1, 0, 0, 0, + 16, 18, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, + 188, 3, 0, 0, 108, 4, + 0, 0, 120, 5, 0, 0, + 116, 17, 0, 0, 82, 68, + 69, 70, 128, 3, 0, 0, + 1, 0, 0, 0, 104, 0, + 0, 0, 1, 0, 0, 0, + 60, 0, 0, 0, 0, 5, + 83, 71, 0, 1, 0, 0, + 76, 3, 0, 0, 82, 68, + 49, 49, 60, 0, 0, 0, + 24, 0, 0, 0, 32, 0, + 0, 0, 40, 0, 0, 0, + 36, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 1, 0, + 0, 0, 99, 111, 110, 115, + 116, 66, 117, 102, 0, 171, + 171, 171, 92, 0, 0, 0, + 1, 0, 0, 0, 128, 0, + 0, 0, 16, 2, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 168, 0, 0, 0, + 0, 0, 0, 0, 16, 2, + 0, 0, 2, 0, 0, 0, + 40, 3, 0, 0, 0, 0, + 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 255, 255, + 255, 255, 0, 0, 0, 0, + 103, 80, 97, 114, 97, 109, + 115, 0, 68, 105, 102, 102, + 117, 115, 101, 83, 104, 97, + 100, 101, 114, 67, 111, 110, + 115, 116, 0, 108, 105, 103, + 104, 116, 80, 111, 115, 0, + 102, 108, 111, 97, 116, 51, + 0, 171, 1, 0, 3, 0, + 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 204, 0, + 0, 0, 112, 97, 100, 48, + 0, 102, 108, 111, 97, 116, + 0, 171, 0, 0, 3, 0, + 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 253, 0, + 0, 0, 108, 105, 103, 104, + 116, 68, 105, 114, 0, 112, + 97, 100, 49, 0, 108, 105, + 103, 104, 116, 84, 114, 97, + 110, 115, 102, 111, 114, 109, + 0, 102, 108, 111, 97, 116, + 52, 120, 52, 0, 171, 171, + 3, 0, 3, 0, 4, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 69, 1, 0, 0, + 99, 111, 108, 111, 114, 0, + 102, 108, 111, 97, 116, 52, + 0, 171, 171, 171, 1, 0, + 3, 0, 1, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 122, 1, 0, 0, 109, 111, + 100, 101, 108, 86, 105, 101, + 119, 0, 109, 111, 100, 101, + 108, 86, 105, 101, 119, 80, + 114, 111, 106, 101, 99, 116, + 105, 111, 110, 0, 112, 114, + 111, 106, 101, 99, 116, 105, + 111, 110, 0, 115, 104, 97, + 100, 111, 119, 84, 97, 112, + 115, 0, 1, 0, 3, 0, + 1, 0, 4, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 122, 1, + 0, 0, 100, 105, 102, 102, + 117, 115, 105, 111, 110, 0, + 100, 105, 102, 102, 117, 115, + 101, 82, 97, 100, 105, 117, + 115, 0, 100, 105, 102, 102, + 117, 115, 101, 83, 99, 97, + 108, 101, 0, 115, 112, 111, + 116, 77, 105, 110, 0, 115, + 112, 111, 116, 77, 97, 120, + 0, 109, 111, 116, 105, 111, + 110, 66, 108, 117, 114, 83, + 99, 97, 108, 101, 0, 112, + 97, 100, 51, 0, 112, 97, + 100, 52, 0, 171, 195, 0, + 0, 0, 212, 0, 0, 0, + 0, 0, 0, 0, 248, 0, + 0, 0, 4, 1, 0, 0, + 12, 0, 0, 0, 40, 1, + 0, 0, 212, 0, 0, 0, + 16, 0, 0, 0, 49, 1, + 0, 0, 4, 1, 0, 0, + 28, 0, 0, 0, 54, 1, + 0, 0, 80, 1, 0, 0, + 32, 0, 0, 0, 116, 1, + 0, 0, 132, 1, 0, 0, + 96, 0, 0, 0, 168, 1, + 0, 0, 80, 1, 0, 0, + 112, 0, 0, 0, 178, 1, + 0, 0, 80, 1, 0, 0, + 176, 0, 0, 0, 198, 1, + 0, 0, 80, 1, 0, 0, + 240, 0, 0, 0, 209, 1, + 0, 0, 220, 1, 0, 0, + 48, 1, 0, 0, 0, 2, + 0, 0, 4, 1, 0, 0, + 240, 1, 0, 0, 10, 2, + 0, 0, 4, 1, 0, 0, + 244, 1, 0, 0, 24, 2, + 0, 0, 4, 1, 0, 0, + 248, 1, 0, 0, 37, 2, + 0, 0, 4, 1, 0, 0, + 252, 1, 0, 0, 45, 2, + 0, 0, 4, 1, 0, 0, + 0, 2, 0, 0, 53, 2, + 0, 0, 4, 1, 0, 0, + 4, 2, 0, 0, 69, 2, + 0, 0, 4, 1, 0, 0, + 8, 2, 0, 0, 74, 2, + 0, 0, 4, 1, 0, 0, + 12, 2, 0, 0, 5, 0, + 0, 0, 1, 0, 132, 0, + 0, 0, 18, 0, 80, 2, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 176, 0, 0, 0, 77, 105, + 99, 114, 111, 115, 111, 102, + 116, 32, 40, 82, 41, 32, + 72, 76, 83, 76, 32, 83, + 104, 97, 100, 101, 114, 32, + 67, 111, 109, 112, 105, 108, + 101, 114, 32, 54, 46, 51, + 46, 57, 54, 48, 48, 46, + 49, 54, 51, 56, 52, 0, + 171, 171, 73, 83, 71, 78, + 168, 0, 0, 0, 5, 0, + 0, 0, 8, 0, 0, 0, + 128, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 15, 15, 0, 0, + 137, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 1, 0, + 0, 0, 15, 3, 0, 0, + 144, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 2, 0, + 0, 0, 15, 15, 0, 0, + 152, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 3, 0, + 0, 0, 15, 7, 0, 0, + 160, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 4, 0, + 0, 0, 15, 15, 0, 0, + 80, 79, 83, 73, 84, 73, + 79, 78, 0, 78, 67, 68, + 80, 79, 83, 0, 86, 73, + 69, 87, 80, 79, 83, 0, + 86, 73, 69, 87, 86, 69, + 76, 0, 67, 79, 76, 79, + 82, 0, 171, 171, 79, 83, + 71, 53, 4, 1, 0, 0, + 7, 0, 0, 0, 8, 0, + 0, 0, 0, 0, 0, 0, + 204, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 216, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 1, 0, 0, 0, + 15, 0, 0, 0, 0, 0, + 0, 0, 225, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 2, 0, 0, 0, 15, 0, + 0, 0, 0, 0, 0, 0, + 233, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 3, 0, + 0, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 241, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 4, 0, 0, 0, + 15, 0, 0, 0, 0, 0, + 0, 0, 250, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 5, 0, 0, 0, 15, 0, + 0, 0, 0, 0, 0, 0, + 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 6, 0, + 0, 0, 3, 12, 0, 0, + 83, 86, 95, 80, 79, 83, + 73, 84, 73, 79, 78, 0, + 80, 79, 83, 73, 84, 73, + 79, 78, 0, 86, 73, 69, + 87, 80, 79, 83, 0, 86, + 73, 69, 87, 86, 69, 76, + 0, 76, 73, 71, 72, 84, + 68, 73, 82, 0, 67, 79, + 76, 79, 82, 0, 85, 86, + 0, 171, 83, 72, 69, 88, + 244, 11, 0, 0, 80, 0, + 2, 0, 253, 2, 0, 0, + 106, 8, 0, 1, 89, 0, + 0, 4, 70, 142, 32, 0, + 0, 0, 0, 0, 33, 0, + 0, 0, 95, 0, 0, 4, + 242, 16, 32, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 95, 0, 0, 4, 242, 16, + 32, 0, 1, 0, 0, 0, + 1, 0, 0, 0, 95, 0, + 0, 4, 242, 16, 32, 0, + 1, 0, 0, 0, 2, 0, + 0, 0, 95, 0, 0, 4, + 242, 16, 32, 0, 1, 0, + 0, 0, 3, 0, 0, 0, + 95, 0, 0, 4, 242, 16, + 32, 0, 1, 0, 0, 0, + 4, 0, 0, 0, 104, 0, + 0, 2, 6, 0, 0, 0, + 93, 8, 0, 1, 143, 0, + 0, 3, 0, 0, 17, 0, + 0, 0, 0, 0, 92, 40, + 0, 1, 103, 0, 0, 4, + 242, 32, 16, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 101, 0, 0, 3, 242, 32, + 16, 0, 1, 0, 0, 0, + 101, 0, 0, 3, 242, 32, + 16, 0, 2, 0, 0, 0, + 101, 0, 0, 3, 242, 32, + 16, 0, 3, 0, 0, 0, + 101, 0, 0, 3, 242, 32, + 16, 0, 4, 0, 0, 0, + 101, 0, 0, 3, 242, 32, + 16, 0, 5, 0, 0, 0, + 101, 0, 0, 3, 50, 32, + 16, 0, 6, 0, 0, 0, + 94, 0, 0, 2, 4, 0, + 0, 0, 49, 0, 0, 8, + 18, 0, 16, 0, 0, 0, + 0, 0, 10, 16, 32, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 191, 31, 0, + 4, 3, 10, 0, 16, 0, + 0, 0, 0, 0, 62, 0, + 0, 1, 21, 0, 0, 1, + 49, 0, 0, 8, 18, 0, + 16, 0, 0, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 10, 16, 32, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 31, 0, 4, 3, + 10, 0, 16, 0, 0, 0, + 0, 0, 62, 0, 0, 1, + 21, 0, 0, 1, 49, 0, + 0, 8, 18, 0, 16, 0, + 0, 0, 0, 0, 26, 16, + 32, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 191, + 31, 0, 4, 3, 10, 0, + 16, 0, 0, 0, 0, 0, + 62, 0, 0, 1, 21, 0, + 0, 1, 49, 0, 0, 8, + 18, 0, 16, 0, 0, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 26, 16, + 32, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 31, 0, + 4, 3, 10, 0, 16, 0, + 0, 0, 0, 0, 62, 0, + 0, 1, 21, 0, 0, 1, + 0, 0, 0, 8, 18, 0, + 16, 0, 0, 0, 0, 0, + 10, 128, 32, 0, 0, 0, + 0, 0, 31, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 56, 0, 0, 8, + 34, 0, 16, 0, 0, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 62, 58, 16, + 32, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 51, 0, + 0, 7, 34, 0, 16, 0, + 0, 0, 0, 0, 26, 0, + 16, 0, 0, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 0, 0, 0, 8, + 66, 0, 16, 0, 0, 0, + 0, 0, 10, 0, 16, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 50, 0, + 0, 9, 18, 0, 16, 0, + 0, 0, 0, 0, 26, 0, + 16, 0, 0, 0, 0, 0, + 42, 0, 16, 0, 0, 0, + 0, 0, 10, 0, 16, 0, + 0, 0, 0, 0, 54, 0, + 0, 8, 98, 0, 16, 0, + 1, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 54, 0, 0, 6, 18, 0, + 16, 0, 1, 0, 0, 0, + 42, 128, 32, 0, 0, 0, + 0, 0, 31, 0, 0, 0, + 56, 0, 0, 7, 114, 0, + 16, 0, 1, 0, 0, 0, + 6, 0, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 1, 0, 0, 0, 56, 0, + 0, 7, 18, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 0, 0, 0, 0, + 10, 0, 16, 0, 0, 0, + 0, 0, 14, 0, 0, 10, + 130, 0, 16, 0, 1, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 128, 63, 0, 0, + 128, 63, 0, 0, 128, 63, + 0, 0, 128, 63, 10, 0, + 16, 0, 0, 0, 0, 0, + 16, 0, 0, 9, 18, 0, + 16, 0, 0, 0, 0, 0, + 70, 18, 32, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 70, 18, 32, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 75, 0, 0, 5, 34, 0, + 16, 0, 0, 0, 0, 0, + 10, 0, 16, 0, 0, 0, + 0, 0, 56, 0, 0, 8, + 34, 0, 16, 0, 0, 0, + 0, 0, 26, 0, 16, 0, + 0, 0, 0, 0, 26, 128, + 32, 0, 0, 0, 0, 0, + 32, 0, 0, 0, 49, 0, + 0, 7, 66, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 63, + 26, 0, 16, 0, 0, 0, + 0, 0, 56, 0, 0, 7, + 34, 0, 16, 0, 0, 0, + 0, 0, 26, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 131, 60, + 52, 0, 0, 8, 34, 0, + 16, 0, 0, 0, 0, 0, + 26, 0, 16, 0, 0, 0, + 0, 0, 42, 128, 32, 0, + 0, 0, 0, 0, 31, 0, + 0, 0, 14, 0, 0, 8, + 130, 0, 16, 0, 0, 0, + 0, 0, 26, 0, 16, 0, + 0, 0, 0, 0, 42, 128, + 32, 0, 0, 0, 0, 0, + 31, 0, 0, 0, 14, 0, + 0, 7, 130, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 64, + 58, 0, 16, 0, 0, 0, + 0, 0, 51, 0, 0, 7, + 130, 0, 16, 0, 2, 0, + 0, 0, 58, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 68, 0, 0, 5, 18, 0, + 16, 0, 0, 0, 0, 0, + 10, 0, 16, 0, 0, 0, + 0, 0, 56, 0, 0, 8, + 114, 0, 16, 0, 3, 0, + 0, 0, 6, 0, 16, 0, + 0, 0, 0, 0, 70, 18, + 32, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 56, 0, + 0, 7, 178, 0, 16, 0, + 0, 0, 0, 0, 86, 5, + 16, 0, 0, 0, 0, 0, + 70, 8, 16, 0, 3, 0, + 0, 0, 56, 0, 0, 10, + 114, 0, 16, 0, 3, 0, + 0, 0, 54, 13, 16, 0, + 0, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 128, 191, 0, 0, + 0, 0, 0, 0, 0, 0, + 50, 0, 0, 13, 114, 0, + 16, 0, 3, 0, 0, 0, + 214, 4, 16, 0, 0, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 128, 191, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 70, 2, + 16, 128, 65, 0, 0, 0, + 3, 0, 0, 0, 15, 0, + 0, 7, 130, 0, 16, 0, + 3, 0, 0, 0, 70, 0, + 16, 0, 3, 0, 0, 0, + 70, 0, 16, 0, 3, 0, + 0, 0, 68, 0, 0, 5, + 130, 0, 16, 0, 3, 0, + 0, 0, 58, 0, 16, 0, + 3, 0, 0, 0, 56, 0, + 0, 7, 114, 0, 16, 0, + 3, 0, 0, 0, 246, 15, + 16, 0, 3, 0, 0, 0, + 70, 2, 16, 0, 3, 0, + 0, 0, 56, 0, 0, 8, + 114, 0, 16, 0, 2, 0, + 0, 0, 70, 2, 16, 0, + 3, 0, 0, 0, 166, 138, + 32, 0, 0, 0, 0, 0, + 31, 0, 0, 0, 55, 0, + 0, 9, 178, 0, 16, 0, + 0, 0, 0, 0, 166, 10, + 16, 0, 0, 0, 0, 0, + 70, 12, 16, 0, 0, 0, + 0, 0, 38, 10, 16, 0, + 1, 0, 0, 0, 55, 0, + 0, 9, 242, 0, 16, 0, + 1, 0, 0, 0, 166, 10, + 16, 0, 0, 0, 0, 0, + 70, 14, 16, 0, 2, 0, + 0, 0, 70, 14, 16, 0, + 1, 0, 0, 0, 56, 0, + 0, 9, 242, 0, 16, 0, + 2, 0, 0, 0, 86, 133, + 32, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 50, 0, + 0, 11, 242, 0, 16, 0, + 2, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 6, 128, + 32, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 70, 14, + 16, 0, 2, 0, 0, 0, + 50, 0, 0, 11, 242, 0, + 16, 0, 2, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 9, 0, 0, 0, + 166, 138, 32, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 70, 14, 16, 0, 2, 0, + 0, 0, 0, 0, 0, 8, + 114, 0, 16, 0, 3, 0, + 0, 0, 70, 3, 16, 0, + 0, 0, 0, 0, 70, 18, + 32, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, + 0, 8, 114, 0, 16, 0, + 4, 0, 0, 0, 70, 2, + 16, 128, 65, 0, 0, 0, + 1, 0, 0, 0, 70, 2, + 16, 0, 3, 0, 0, 0, + 56, 0, 0, 8, 242, 0, + 16, 0, 5, 0, 0, 0, + 86, 5, 16, 0, 4, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 16, 0, + 0, 0, 50, 0, 0, 10, + 242, 0, 16, 0, 5, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 15, 0, + 0, 0, 6, 0, 16, 0, + 4, 0, 0, 0, 70, 14, + 16, 0, 5, 0, 0, 0, + 50, 0, 0, 10, 242, 0, + 16, 0, 4, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 17, 0, 0, 0, + 166, 10, 16, 0, 4, 0, + 0, 0, 70, 14, 16, 0, + 5, 0, 0, 0, 0, 0, + 0, 8, 242, 0, 16, 0, + 4, 0, 0, 0, 70, 14, + 16, 0, 4, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 18, 0, 0, 0, + 54, 0, 0, 5, 242, 32, + 16, 0, 0, 0, 0, 0, + 70, 14, 16, 0, 4, 0, + 0, 0, 54, 0, 0, 6, + 242, 32, 16, 0, 1, 0, + 0, 0, 70, 30, 32, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 54, 0, 0, 6, + 242, 32, 16, 0, 2, 0, + 0, 0, 70, 30, 32, 0, + 0, 0, 0, 0, 2, 0, + 0, 0, 54, 0, 0, 6, + 114, 32, 16, 0, 3, 0, + 0, 0, 70, 18, 32, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 54, 0, 0, 5, + 130, 32, 16, 0, 3, 0, + 0, 0, 58, 0, 16, 0, + 1, 0, 0, 0, 54, 0, + 0, 5, 242, 32, 16, 0, + 4, 0, 0, 0, 70, 14, + 16, 0, 2, 0, 0, 0, + 54, 0, 0, 6, 242, 32, + 16, 0, 5, 0, 0, 0, + 70, 30, 32, 0, 0, 0, + 0, 0, 4, 0, 0, 0, + 54, 0, 0, 8, 50, 32, + 16, 0, 6, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 128, 63, + 0, 0, 0, 0, 0, 0, + 0, 0, 117, 0, 0, 3, + 0, 0, 17, 0, 0, 0, + 0, 0, 0, 0, 0, 9, + 114, 0, 16, 0, 0, 0, + 0, 0, 70, 3, 16, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 70, 18, 32, 0, + 0, 0, 0, 0, 2, 0, + 0, 0, 0, 0, 0, 8, + 114, 0, 16, 0, 4, 0, + 0, 0, 70, 2, 16, 128, + 65, 0, 0, 0, 1, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 56, 0, + 0, 8, 242, 0, 16, 0, + 5, 0, 0, 0, 86, 5, + 16, 0, 4, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 16, 0, 0, 0, + 50, 0, 0, 10, 242, 0, + 16, 0, 5, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 15, 0, 0, 0, + 6, 0, 16, 0, 4, 0, + 0, 0, 70, 14, 16, 0, + 5, 0, 0, 0, 50, 0, + 0, 10, 242, 0, 16, 0, + 4, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 166, 10, + 16, 0, 4, 0, 0, 0, + 70, 14, 16, 0, 5, 0, + 0, 0, 0, 0, 0, 8, + 242, 0, 16, 0, 4, 0, + 0, 0, 70, 14, 16, 0, + 4, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 18, 0, 0, 0, 54, 0, + 0, 5, 242, 32, 16, 0, + 0, 0, 0, 0, 70, 14, + 16, 0, 4, 0, 0, 0, + 54, 0, 0, 6, 242, 32, + 16, 0, 1, 0, 0, 0, + 70, 30, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 54, 0, 0, 6, 242, 32, + 16, 0, 2, 0, 0, 0, + 70, 30, 32, 0, 0, 0, + 0, 0, 2, 0, 0, 0, + 54, 0, 0, 6, 114, 32, + 16, 0, 3, 0, 0, 0, + 70, 18, 32, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 54, 0, 0, 5, 130, 32, + 16, 0, 3, 0, 0, 0, + 58, 0, 16, 0, 1, 0, + 0, 0, 54, 0, 0, 5, + 242, 32, 16, 0, 4, 0, + 0, 0, 70, 14, 16, 0, + 2, 0, 0, 0, 54, 0, + 0, 6, 242, 32, 16, 0, + 5, 0, 0, 0, 70, 30, + 32, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 54, 0, + 0, 8, 50, 32, 16, 0, + 6, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 117, 0, 0, 3, 0, 0, + 17, 0, 0, 0, 0, 0, + 0, 0, 0, 7, 114, 0, + 16, 0, 3, 0, 0, 0, + 70, 2, 16, 0, 1, 0, + 0, 0, 70, 2, 16, 0, + 3, 0, 0, 0, 56, 0, + 0, 8, 242, 0, 16, 0, + 4, 0, 0, 0, 86, 5, + 16, 0, 3, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 16, 0, 0, 0, + 50, 0, 0, 10, 242, 0, + 16, 0, 4, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 15, 0, 0, 0, + 6, 0, 16, 0, 3, 0, + 0, 0, 70, 14, 16, 0, + 4, 0, 0, 0, 50, 0, + 0, 10, 242, 0, 16, 0, + 3, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 166, 10, + 16, 0, 3, 0, 0, 0, + 70, 14, 16, 0, 4, 0, + 0, 0, 0, 0, 0, 8, + 242, 0, 16, 0, 3, 0, + 0, 0, 70, 14, 16, 0, + 3, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 18, 0, 0, 0, 54, 0, + 0, 5, 242, 32, 16, 0, + 0, 0, 0, 0, 70, 14, + 16, 0, 3, 0, 0, 0, + 54, 0, 0, 6, 242, 32, + 16, 0, 1, 0, 0, 0, + 70, 30, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 54, 0, 0, 6, 242, 32, + 16, 0, 2, 0, 0, 0, + 70, 30, 32, 0, 0, 0, + 0, 0, 2, 0, 0, 0, + 54, 0, 0, 6, 114, 32, + 16, 0, 3, 0, 0, 0, + 70, 18, 32, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 54, 0, 0, 5, 130, 32, + 16, 0, 3, 0, 0, 0, + 58, 0, 16, 0, 1, 0, + 0, 0, 54, 0, 0, 5, + 242, 32, 16, 0, 4, 0, + 0, 0, 70, 14, 16, 0, + 2, 0, 0, 0, 54, 0, + 0, 6, 242, 32, 16, 0, + 5, 0, 0, 0, 70, 30, + 32, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 54, 0, + 0, 8, 50, 32, 16, 0, + 6, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 128, 63, + 0, 0, 128, 63, 0, 0, + 0, 0, 0, 0, 0, 0, + 117, 0, 0, 3, 0, 0, + 17, 0, 0, 0, 0, 0, + 0, 0, 0, 7, 114, 0, + 16, 0, 0, 0, 0, 0, + 70, 2, 16, 0, 1, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 56, 0, + 0, 8, 242, 0, 16, 0, + 3, 0, 0, 0, 86, 5, + 16, 0, 0, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 16, 0, 0, 0, + 50, 0, 0, 10, 242, 0, + 16, 0, 3, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 15, 0, 0, 0, + 6, 0, 16, 0, 0, 0, + 0, 0, 70, 14, 16, 0, + 3, 0, 0, 0, 50, 0, + 0, 10, 242, 0, 16, 0, + 0, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 166, 10, + 16, 0, 0, 0, 0, 0, + 70, 14, 16, 0, 3, 0, + 0, 0, 0, 0, 0, 8, + 242, 0, 16, 0, 0, 0, + 0, 0, 70, 14, 16, 0, + 0, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 18, 0, 0, 0, 54, 0, + 0, 5, 242, 32, 16, 0, + 0, 0, 0, 0, 70, 14, + 16, 0, 0, 0, 0, 0, + 54, 0, 0, 6, 242, 32, + 16, 0, 1, 0, 0, 0, + 70, 30, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 54, 0, 0, 6, 242, 32, + 16, 0, 2, 0, 0, 0, + 70, 30, 32, 0, 0, 0, + 0, 0, 2, 0, 0, 0, + 54, 0, 0, 6, 114, 32, + 16, 0, 3, 0, 0, 0, + 70, 18, 32, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 54, 0, 0, 5, 130, 32, + 16, 0, 3, 0, 0, 0, + 58, 0, 16, 0, 1, 0, + 0, 0, 54, 0, 0, 5, + 242, 32, 16, 0, 4, 0, + 0, 0, 70, 14, 16, 0, + 2, 0, 0, 0, 54, 0, + 0, 6, 242, 32, 16, 0, + 5, 0, 0, 0, 70, 30, + 32, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 54, 0, + 0, 8, 50, 32, 16, 0, + 6, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 128, 63, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 117, 0, 0, 3, 0, 0, + 17, 0, 0, 0, 0, 0, + 62, 0, 0, 1, 83, 84, + 65, 84, 148, 0, 0, 0, + 108, 0, 0, 0, 6, 0, + 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 55, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 5, 0, + 0, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, + 0, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 5, 0, 0, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0 +}; diff --git a/demo/d3d/shaders/diffusePS.hlsl b/demo/d3d/shaders/diffusePS.hlsl new file mode 100644 index 0000000..b548b49 --- /dev/null +++ b/demo/d3d/shaders/diffusePS.hlsl @@ -0,0 +1,29 @@ +#include "shaderCommon.h" + +cbuffer constBuf : register(b0) +{ + DiffuseShaderConst gParams; +}; + +float sqr(float x) { return x * x; } + +float4 diffusePS(DiffuseGeometryOut input) : SV_TARGET +{ + float attenuation = 1.0f; + float lifeTime = input.worldPos.w; + float lifeFade = min(1.0, lifeTime*0.125); + float velocityFade = input.viewVel.w; + + // calculate normal from texture coordinates + float3 normal = float3(input.uv * 2.0 + float2(-1.0, -1.0), 0.0); + float mag = dot(normal.xy, normal.xy); + + // kill pixels outside circle + if (mag > 1.0) + discard; + + normal.z = 1.0-mag; + + float alpha = lifeFade*velocityFade*sqr(normal.z); + return float4(alpha, alpha, alpha, alpha); +} diff --git a/demo/d3d/shaders/diffusePS.hlsl.h b/demo/d3d/shaders/diffusePS.hlsl.h new file mode 100644 index 0000000..44a31b1 --- /dev/null +++ b/demo/d3d/shaders/diffusePS.hlsl.h @@ -0,0 +1,216 @@ +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_POSITION 0 xyzw 0 POS float +// POSITION 0 xyzw 1 NONE float w +// VIEWPOS 0 xyzw 2 NONE float +// VIEWVEL 0 xyzw 3 NONE float w +// LIGHTDIR 0 xyzw 4 NONE float +// COLOR 0 xyzw 5 NONE float +// UV 0 xy 6 NONE float xy +// +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_TARGET 0 xyzw 0 TARGET float xyzw +// +ps_5_0 +dcl_globalFlags refactoringAllowed +dcl_input_ps linear v1.w +dcl_input_ps linear v3.w +dcl_input_ps linear v6.xy +dcl_output o0.xyzw +dcl_temps 1 +mad r0.xy, v6.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000) +dp2 r0.x, r0.xyxx, r0.xyxx +lt r0.y, l(1.000000), r0.x +discard_nz r0.y +mul r0.y, v1.w, l(0.125000) +min r0.y, r0.y, l(1.000000) +add r0.x, -r0.x, l(1.000000) +mul r0.y, r0.y, v3.w +mul r0.x, r0.x, r0.x +mul o0.xyzw, r0.xxxx, r0.yyyy +ret +// Approximately 11 instruction slots used +#endif + +const BYTE g_diffusePS[] = +{ + 68, 88, 66, 67, 226, 109, + 117, 161, 154, 99, 48, 92, + 15, 92, 142, 117, 138, 39, + 5, 123, 1, 0, 0, 0, + 232, 3, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, + 172, 0, 0, 0, 156, 1, + 0, 0, 208, 1, 0, 0, + 76, 3, 0, 0, 82, 68, + 69, 70, 112, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 60, 0, 0, 0, 0, 5, + 255, 255, 0, 1, 0, 0, + 60, 0, 0, 0, 82, 68, + 49, 49, 60, 0, 0, 0, + 24, 0, 0, 0, 32, 0, + 0, 0, 40, 0, 0, 0, + 36, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 77, 105, 99, 114, 111, 115, + 111, 102, 116, 32, 40, 82, + 41, 32, 72, 76, 83, 76, + 32, 83, 104, 97, 100, 101, + 114, 32, 67, 111, 109, 112, + 105, 108, 101, 114, 32, 54, + 46, 51, 46, 57, 54, 48, + 48, 46, 49, 54, 51, 56, + 52, 0, 171, 171, 73, 83, + 71, 78, 232, 0, 0, 0, + 7, 0, 0, 0, 8, 0, + 0, 0, 176, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 15, 0, + 0, 0, 188, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 15, 8, + 0, 0, 197, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 2, 0, 0, 0, 15, 0, + 0, 0, 205, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 3, 0, 0, 0, 15, 8, + 0, 0, 213, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 4, 0, 0, 0, 15, 0, + 0, 0, 222, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 5, 0, 0, 0, 15, 0, + 0, 0, 228, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 6, 0, 0, 0, 3, 3, + 0, 0, 83, 86, 95, 80, + 79, 83, 73, 84, 73, 79, + 78, 0, 80, 79, 83, 73, + 84, 73, 79, 78, 0, 86, + 73, 69, 87, 80, 79, 83, + 0, 86, 73, 69, 87, 86, + 69, 76, 0, 76, 73, 71, + 72, 84, 68, 73, 82, 0, + 67, 79, 76, 79, 82, 0, + 85, 86, 0, 171, 79, 83, + 71, 78, 44, 0, 0, 0, + 1, 0, 0, 0, 8, 0, + 0, 0, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 15, 0, + 0, 0, 83, 86, 95, 84, + 65, 82, 71, 69, 84, 0, + 171, 171, 83, 72, 69, 88, + 116, 1, 0, 0, 80, 0, + 0, 0, 93, 0, 0, 0, + 106, 8, 0, 1, 98, 16, + 0, 3, 130, 16, 16, 0, + 1, 0, 0, 0, 98, 16, + 0, 3, 130, 16, 16, 0, + 3, 0, 0, 0, 98, 16, + 0, 3, 50, 16, 16, 0, + 6, 0, 0, 0, 101, 0, + 0, 3, 242, 32, 16, 0, + 0, 0, 0, 0, 104, 0, + 0, 2, 1, 0, 0, 0, + 50, 0, 0, 15, 50, 0, + 16, 0, 0, 0, 0, 0, + 70, 16, 16, 0, 6, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 64, 0, 0, + 0, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 128, 191, + 0, 0, 128, 191, 0, 0, + 0, 0, 0, 0, 0, 0, + 15, 0, 0, 7, 18, 0, + 16, 0, 0, 0, 0, 0, + 70, 0, 16, 0, 0, 0, + 0, 0, 70, 0, 16, 0, + 0, 0, 0, 0, 49, 0, + 0, 7, 34, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 10, 0, 16, 0, 0, 0, + 0, 0, 13, 0, 4, 3, + 26, 0, 16, 0, 0, 0, + 0, 0, 56, 0, 0, 7, + 34, 0, 16, 0, 0, 0, + 0, 0, 58, 16, 16, 0, + 1, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 62, + 51, 0, 0, 7, 34, 0, + 16, 0, 0, 0, 0, 0, + 26, 0, 16, 0, 0, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 0, 0, + 0, 8, 18, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 56, 0, 0, 7, 34, 0, + 16, 0, 0, 0, 0, 0, + 26, 0, 16, 0, 0, 0, + 0, 0, 58, 16, 16, 0, + 3, 0, 0, 0, 56, 0, + 0, 7, 18, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 0, 0, 0, 0, + 10, 0, 16, 0, 0, 0, + 0, 0, 56, 0, 0, 7, + 242, 32, 16, 0, 0, 0, + 0, 0, 6, 0, 16, 0, + 0, 0, 0, 0, 86, 5, + 16, 0, 0, 0, 0, 0, + 62, 0, 0, 1, 83, 84, + 65, 84, 148, 0, 0, 0, + 11, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 9, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0 +}; diff --git a/demo/d3d/shaders/diffuseVS.hlsl b/demo/d3d/shaders/diffuseVS.hlsl new file mode 100644 index 0000000..303b896 --- /dev/null +++ b/demo/d3d/shaders/diffuseVS.hlsl @@ -0,0 +1,25 @@ +#include "shaderCommon.h" + +cbuffer constBuf : register(b0) +{ + DiffuseShaderConst gParams; +}; + +DiffuseVertexOut diffuseVS(DiffuseVertexIn input) +{ + float3 worldPos = input.position.xyz; + float4 eyePos = mul(gParams.modelView, float4(worldPos, 1.0)); + + DiffuseVertexOut output; + + output.worldPos = input.position; // lifetime in w + output.viewPos = eyePos; + output.viewVel = mul(gParams.modelView, float4(input.velocity.xyz, 0.0)); + output.color = gParams.color; + + // compute ndc pos for frustrum culling in GS + float4 ndcPos = mul(gParams.modelViewProjection, float4(worldPos.xyz, 1.0)); + output.ndcPos = ndcPos / ndcPos.w; + + return output; +} diff --git a/demo/d3d/shaders/diffuseVS.hlsl.h b/demo/d3d/shaders/diffuseVS.hlsl.h new file mode 100644 index 0000000..7db0a8c --- /dev/null +++ b/demo/d3d/shaders/diffuseVS.hlsl.h @@ -0,0 +1,425 @@ +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// Buffer Definitions: +// +// cbuffer constBuf +// { +// +// struct DiffuseShaderConst +// { +// +// float3 lightPos; // Offset: 0 +// float pad0; // Offset: 12 +// float3 lightDir; // Offset: 16 +// float pad1; // Offset: 28 +// float4x4 lightTransform; // Offset: 32 +// float4 color; // Offset: 96 +// float4x4 modelView; // Offset: 112 +// float4x4 modelViewProjection; // Offset: 176 +// float4x4 projection; // Offset: 240 +// float4 shadowTaps[12]; // Offset: 304 +// float diffusion; // Offset: 496 +// float diffuseRadius; // Offset: 500 +// float diffuseScale; // Offset: 504 +// float spotMin; // Offset: 508 +// float spotMax; // Offset: 512 +// float motionBlurScale; // Offset: 516 +// float pad3; // Offset: 520 +// float pad4; // Offset: 524 +// +// } gParams; // Offset: 0 Size: 528 +// +// } +// +// +// Resource Bindings: +// +// Name Type Format Dim Slot Elements +// ------------------------------ ---------- ------- ----------- ---- -------- +// constBuf cbuffer NA NA 0 1 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// POSITION 0 xyzw 0 NONE float xyzw +// VELOCITY 0 xyzw 1 NONE float xyz +// +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// POSITION 0 xyzw 0 NONE float xyzw +// NCDPOS 0 xyzw 1 NONE float xyzw +// VIEWPOS 0 xyzw 2 NONE float xyzw +// VIEWVEL 0 xyzw 3 NONE float xyzw +// COLOR 0 xyzw 4 NONE float xyzw +// +vs_5_0 +dcl_globalFlags refactoringAllowed +dcl_constantbuffer cb0[15], immediateIndexed +dcl_input v0.xyzw +dcl_input v1.xyz +dcl_output o0.xyzw +dcl_output o1.xyzw +dcl_output o2.xyzw +dcl_output o3.xyzw +dcl_output o4.xyzw +dcl_temps 1 +mov o0.xyzw, v0.xyzw +mul r0.xyzw, v0.yyyy, cb0[12].xyzw +mad r0.xyzw, cb0[11].xyzw, v0.xxxx, r0.xyzw +mad r0.xyzw, cb0[13].xyzw, v0.zzzz, r0.xyzw +add r0.xyzw, r0.xyzw, cb0[14].xyzw +div o1.xyzw, r0.xyzw, r0.wwww +mul r0.xyzw, v0.yyyy, cb0[8].xyzw +mad r0.xyzw, cb0[7].xyzw, v0.xxxx, r0.xyzw +mad r0.xyzw, cb0[9].xyzw, v0.zzzz, r0.xyzw +add o2.xyzw, r0.xyzw, cb0[10].xyzw +mul r0.xyzw, v1.yyyy, cb0[8].xyzw +mad r0.xyzw, cb0[7].xyzw, v1.xxxx, r0.xyzw +mad o3.xyzw, cb0[9].xyzw, v1.zzzz, r0.xyzw +mov o4.xyzw, cb0[6].xyzw +ret +// Approximately 15 instruction slots used +#endif + +const BYTE g_diffuseVS[] = +{ + 68, 88, 66, 67, 169, 46, + 39, 192, 132, 15, 181, 233, + 181, 235, 144, 49, 232, 212, + 251, 135, 1, 0, 0, 0, + 184, 7, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, + 188, 3, 0, 0, 16, 4, + 0, 0, 192, 4, 0, 0, + 28, 7, 0, 0, 82, 68, + 69, 70, 128, 3, 0, 0, + 1, 0, 0, 0, 104, 0, + 0, 0, 1, 0, 0, 0, + 60, 0, 0, 0, 0, 5, + 254, 255, 0, 1, 0, 0, + 76, 3, 0, 0, 82, 68, + 49, 49, 60, 0, 0, 0, + 24, 0, 0, 0, 32, 0, + 0, 0, 40, 0, 0, 0, + 36, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 1, 0, + 0, 0, 99, 111, 110, 115, + 116, 66, 117, 102, 0, 171, + 171, 171, 92, 0, 0, 0, + 1, 0, 0, 0, 128, 0, + 0, 0, 16, 2, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 168, 0, 0, 0, + 0, 0, 0, 0, 16, 2, + 0, 0, 2, 0, 0, 0, + 40, 3, 0, 0, 0, 0, + 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 255, 255, + 255, 255, 0, 0, 0, 0, + 103, 80, 97, 114, 97, 109, + 115, 0, 68, 105, 102, 102, + 117, 115, 101, 83, 104, 97, + 100, 101, 114, 67, 111, 110, + 115, 116, 0, 108, 105, 103, + 104, 116, 80, 111, 115, 0, + 102, 108, 111, 97, 116, 51, + 0, 171, 1, 0, 3, 0, + 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 204, 0, + 0, 0, 112, 97, 100, 48, + 0, 102, 108, 111, 97, 116, + 0, 171, 0, 0, 3, 0, + 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 253, 0, + 0, 0, 108, 105, 103, 104, + 116, 68, 105, 114, 0, 112, + 97, 100, 49, 0, 108, 105, + 103, 104, 116, 84, 114, 97, + 110, 115, 102, 111, 114, 109, + 0, 102, 108, 111, 97, 116, + 52, 120, 52, 0, 171, 171, + 3, 0, 3, 0, 4, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 69, 1, 0, 0, + 99, 111, 108, 111, 114, 0, + 102, 108, 111, 97, 116, 52, + 0, 171, 171, 171, 1, 0, + 3, 0, 1, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 122, 1, 0, 0, 109, 111, + 100, 101, 108, 86, 105, 101, + 119, 0, 109, 111, 100, 101, + 108, 86, 105, 101, 119, 80, + 114, 111, 106, 101, 99, 116, + 105, 111, 110, 0, 112, 114, + 111, 106, 101, 99, 116, 105, + 111, 110, 0, 115, 104, 97, + 100, 111, 119, 84, 97, 112, + 115, 0, 1, 0, 3, 0, + 1, 0, 4, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 122, 1, + 0, 0, 100, 105, 102, 102, + 117, 115, 105, 111, 110, 0, + 100, 105, 102, 102, 117, 115, + 101, 82, 97, 100, 105, 117, + 115, 0, 100, 105, 102, 102, + 117, 115, 101, 83, 99, 97, + 108, 101, 0, 115, 112, 111, + 116, 77, 105, 110, 0, 115, + 112, 111, 116, 77, 97, 120, + 0, 109, 111, 116, 105, 111, + 110, 66, 108, 117, 114, 83, + 99, 97, 108, 101, 0, 112, + 97, 100, 51, 0, 112, 97, + 100, 52, 0, 171, 195, 0, + 0, 0, 212, 0, 0, 0, + 0, 0, 0, 0, 248, 0, + 0, 0, 4, 1, 0, 0, + 12, 0, 0, 0, 40, 1, + 0, 0, 212, 0, 0, 0, + 16, 0, 0, 0, 49, 1, + 0, 0, 4, 1, 0, 0, + 28, 0, 0, 0, 54, 1, + 0, 0, 80, 1, 0, 0, + 32, 0, 0, 0, 116, 1, + 0, 0, 132, 1, 0, 0, + 96, 0, 0, 0, 168, 1, + 0, 0, 80, 1, 0, 0, + 112, 0, 0, 0, 178, 1, + 0, 0, 80, 1, 0, 0, + 176, 0, 0, 0, 198, 1, + 0, 0, 80, 1, 0, 0, + 240, 0, 0, 0, 209, 1, + 0, 0, 220, 1, 0, 0, + 48, 1, 0, 0, 0, 2, + 0, 0, 4, 1, 0, 0, + 240, 1, 0, 0, 10, 2, + 0, 0, 4, 1, 0, 0, + 244, 1, 0, 0, 24, 2, + 0, 0, 4, 1, 0, 0, + 248, 1, 0, 0, 37, 2, + 0, 0, 4, 1, 0, 0, + 252, 1, 0, 0, 45, 2, + 0, 0, 4, 1, 0, 0, + 0, 2, 0, 0, 53, 2, + 0, 0, 4, 1, 0, 0, + 4, 2, 0, 0, 69, 2, + 0, 0, 4, 1, 0, 0, + 8, 2, 0, 0, 74, 2, + 0, 0, 4, 1, 0, 0, + 12, 2, 0, 0, 5, 0, + 0, 0, 1, 0, 132, 0, + 0, 0, 18, 0, 80, 2, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 176, 0, 0, 0, 77, 105, + 99, 114, 111, 115, 111, 102, + 116, 32, 40, 82, 41, 32, + 72, 76, 83, 76, 32, 83, + 104, 97, 100, 101, 114, 32, + 67, 111, 109, 112, 105, 108, + 101, 114, 32, 54, 46, 51, + 46, 57, 54, 48, 48, 46, + 49, 54, 51, 56, 52, 0, + 171, 171, 73, 83, 71, 78, + 76, 0, 0, 0, 2, 0, + 0, 0, 8, 0, 0, 0, + 56, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 15, 15, 0, 0, + 65, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 1, 0, + 0, 0, 15, 7, 0, 0, + 80, 79, 83, 73, 84, 73, + 79, 78, 0, 86, 69, 76, + 79, 67, 73, 84, 89, 0, + 171, 171, 79, 83, 71, 78, + 168, 0, 0, 0, 5, 0, + 0, 0, 8, 0, 0, 0, + 128, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 15, 0, 0, 0, + 137, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 1, 0, + 0, 0, 15, 0, 0, 0, + 144, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 2, 0, + 0, 0, 15, 0, 0, 0, + 152, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 3, 0, + 0, 0, 15, 0, 0, 0, + 160, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 4, 0, + 0, 0, 15, 0, 0, 0, + 80, 79, 83, 73, 84, 73, + 79, 78, 0, 78, 67, 68, + 80, 79, 83, 0, 86, 73, + 69, 87, 80, 79, 83, 0, + 86, 73, 69, 87, 86, 69, + 76, 0, 67, 79, 76, 79, + 82, 0, 171, 171, 83, 72, + 69, 88, 84, 2, 0, 0, + 80, 0, 1, 0, 149, 0, + 0, 0, 106, 8, 0, 1, + 89, 0, 0, 4, 70, 142, + 32, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 95, 0, + 0, 3, 242, 16, 16, 0, + 0, 0, 0, 0, 95, 0, + 0, 3, 114, 16, 16, 0, + 1, 0, 0, 0, 101, 0, + 0, 3, 242, 32, 16, 0, + 0, 0, 0, 0, 101, 0, + 0, 3, 242, 32, 16, 0, + 1, 0, 0, 0, 101, 0, + 0, 3, 242, 32, 16, 0, + 2, 0, 0, 0, 101, 0, + 0, 3, 242, 32, 16, 0, + 3, 0, 0, 0, 101, 0, + 0, 3, 242, 32, 16, 0, + 4, 0, 0, 0, 104, 0, + 0, 2, 1, 0, 0, 0, + 54, 0, 0, 5, 242, 32, + 16, 0, 0, 0, 0, 0, + 70, 30, 16, 0, 0, 0, + 0, 0, 56, 0, 0, 8, + 242, 0, 16, 0, 0, 0, + 0, 0, 86, 21, 16, 0, + 0, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 50, 0, + 0, 10, 242, 0, 16, 0, + 0, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 6, 16, + 16, 0, 0, 0, 0, 0, + 70, 14, 16, 0, 0, 0, + 0, 0, 50, 0, 0, 10, + 242, 0, 16, 0, 0, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 13, 0, + 0, 0, 166, 26, 16, 0, + 0, 0, 0, 0, 70, 14, + 16, 0, 0, 0, 0, 0, + 0, 0, 0, 8, 242, 0, + 16, 0, 0, 0, 0, 0, + 70, 14, 16, 0, 0, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 14, 0, + 0, 0, 14, 0, 0, 7, + 242, 32, 16, 0, 1, 0, + 0, 0, 70, 14, 16, 0, + 0, 0, 0, 0, 246, 15, + 16, 0, 0, 0, 0, 0, + 56, 0, 0, 8, 242, 0, + 16, 0, 0, 0, 0, 0, + 86, 21, 16, 0, 0, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 8, 0, + 0, 0, 50, 0, 0, 10, + 242, 0, 16, 0, 0, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 7, 0, + 0, 0, 6, 16, 16, 0, + 0, 0, 0, 0, 70, 14, + 16, 0, 0, 0, 0, 0, + 50, 0, 0, 10, 242, 0, + 16, 0, 0, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 9, 0, 0, 0, + 166, 26, 16, 0, 0, 0, + 0, 0, 70, 14, 16, 0, + 0, 0, 0, 0, 0, 0, + 0, 8, 242, 32, 16, 0, + 2, 0, 0, 0, 70, 14, + 16, 0, 0, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 10, 0, 0, 0, + 56, 0, 0, 8, 242, 0, + 16, 0, 0, 0, 0, 0, + 86, 21, 16, 0, 1, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 8, 0, + 0, 0, 50, 0, 0, 10, + 242, 0, 16, 0, 0, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 7, 0, + 0, 0, 6, 16, 16, 0, + 1, 0, 0, 0, 70, 14, + 16, 0, 0, 0, 0, 0, + 50, 0, 0, 10, 242, 32, + 16, 0, 3, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 9, 0, 0, 0, + 166, 26, 16, 0, 1, 0, + 0, 0, 70, 14, 16, 0, + 0, 0, 0, 0, 54, 0, + 0, 6, 242, 32, 16, 0, + 4, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 62, 0, + 0, 1, 83, 84, 65, 84, + 148, 0, 0, 0, 15, 0, + 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 7, 0, + 0, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0 +}; diff --git a/demo/d3d/shaders/ellipsoidDepthGS.hlsl b/demo/d3d/shaders/ellipsoidDepthGS.hlsl new file mode 100644 index 0000000..92169d3 --- /dev/null +++ b/demo/d3d/shaders/ellipsoidDepthGS.hlsl @@ -0,0 +1,65 @@ +#include "shaderCommon.h" + +cbuffer constBuf : register(b0) +{ + FluidShaderConst gParams; +}; + +static const float2 corners[4] = +{ + float2(0.0, 1.0), float2(0.0, 0.0), float2(1.0, 1.0), float2(1.0, 0.0) +}; + +[maxvertexcount(4)] +void ellipsoidDepthGS(point FluidVertexOut input[1], inout TriangleStream<FluidGeoOut> triStream) +{ + const float4 ndcPos = input[0].ndcPos; + // frustrum culling + const float ndcBound = 1.0; + if (any(abs(ndcPos.xy) > ndcBound)) + { + return; + } + + float4 bounds = input[0].bounds; + + const float4 invQuad0 = input[0].invQ0; + const float4 invQuad1 = input[0].invQ1; + const float4 invQuad2 = input[0].invQ2; + const float4 invQuad3 = input[0].invQ3; + + float xmin = bounds.x; + float xmax = bounds.y; + float ymin = bounds.z; + float ymax = bounds.w; + + FluidGeoOut output; + + output.position = float4(xmin, ymax, 0.5, 1.0); + output.invQ0 = invQuad0; + output.invQ1 = invQuad1; + output.invQ2 = invQuad2; + output.invQ3 = invQuad3; + triStream.Append(output); + + output.position = float4(xmin, ymin, 0.5, 1.0); + output.invQ0 = invQuad0; + output.invQ1 = invQuad1; + output.invQ2 = invQuad2; + output.invQ3 = invQuad3; + triStream.Append(output); + + output.position = float4(xmax, ymax, 0.5, 1.0); + output.invQ0 = invQuad0; + output.invQ1 = invQuad1; + output.invQ2 = invQuad2; + output.invQ3 = invQuad3; + triStream.Append(output); + + output.position = float4(xmax, ymin, 0.5, 1.0); + output.invQ0 = invQuad0; + output.invQ1 = invQuad1; + output.invQ2 = invQuad2; + output.invQ3 = invQuad3; + triStream.Append(output); +} diff --git a/demo/d3d/shaders/ellipsoidDepthGS.hlsl.h b/demo/d3d/shaders/ellipsoidDepthGS.hlsl.h new file mode 100644 index 0000000..5966899 --- /dev/null +++ b/demo/d3d/shaders/ellipsoidDepthGS.hlsl.h @@ -0,0 +1,372 @@ +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// POSITION 0 xyzw 0 NONE float +// TEXCOORD 0 xyzw 1 NONE float xyzw +// TEXCOORD 1 xyzw 2 NONE float xyzw +// TEXCOORD 2 xyzw 3 NONE float xyzw +// TEXCOORD 3 xyzw 4 NONE float xyzw +// TEXCOORD 4 xyzw 5 NONE float xyzw +// TEXCOORD 5 xyzw 6 NONE float xy +// +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_POSITION 0 xyzw 0 POS float xyzw +// TEXCOORD 0 xyzw 1 NONE float xyzw +// TEXCOORD 1 xyzw 2 NONE float xyzw +// TEXCOORD 2 xyzw 3 NONE float xyzw +// TEXCOORD 3 xyzw 4 NONE float xyzw +// +gs_5_0 +dcl_globalFlags refactoringAllowed +dcl_input v[1][0].xyzw +dcl_input v[1][1].xyzw +dcl_input v[1][2].xyzw +dcl_input v[1][3].xyzw +dcl_input v[1][4].xyzw +dcl_input v[1][5].xyzw +dcl_input v[1][6].xyzw +dcl_temps 1 +dcl_inputprimitive point +dcl_stream m0 +dcl_outputtopology trianglestrip +dcl_output_siv o0.xyzw, position +dcl_output o1.xyzw +dcl_output o2.xyzw +dcl_output o3.xyzw +dcl_output o4.xyzw +dcl_maxout 4 +lt r0.xy, l(1.000000, 1.000000, 0.000000, 0.000000), |v[0][6].xyxx| +or r0.x, r0.y, r0.x +if_nz r0.x + ret +endif +mov o0.xy, v[0][1].xwxx +mov o0.zw, l(0,0,0.500000,1.000000) +mov o1.xyzw, v[0][2].xyzw +mov o2.xyzw, v[0][3].xyzw +mov o3.xyzw, v[0][4].xyzw +mov o4.xyzw, v[0][5].xyzw +emit_stream m0 +mov o0.xy, v[0][1].xzxx +mov o0.zw, l(0,0,0.500000,1.000000) +mov o1.xyzw, v[0][2].xyzw +mov o2.xyzw, v[0][3].xyzw +mov o3.xyzw, v[0][4].xyzw +mov o4.xyzw, v[0][5].xyzw +emit_stream m0 +mov o0.xy, v[0][1].ywyy +mov o0.zw, l(0,0,0.500000,1.000000) +mov o1.xyzw, v[0][2].xyzw +mov o2.xyzw, v[0][3].xyzw +mov o3.xyzw, v[0][4].xyzw +mov o4.xyzw, v[0][5].xyzw +emit_stream m0 +mov o0.xy, v[0][1].yzyy +mov o0.zw, l(0,0,0.500000,1.000000) +mov o1.xyzw, v[0][2].xyzw +mov o2.xyzw, v[0][3].xyzw +mov o3.xyzw, v[0][4].xyzw +mov o4.xyzw, v[0][5].xyzw +emit_stream m0 +ret +// Approximately 34 instruction slots used +#endif + +const BYTE g_ellipsoidDepthGS[] = +{ + 68, 88, 66, 67, 152, 192, + 203, 71, 86, 80, 184, 94, + 47, 161, 87, 71, 136, 207, + 121, 6, 1, 0, 0, 0, + 164, 6, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, + 172, 0, 0, 0, 120, 1, + 0, 0, 44, 2, 0, 0, + 8, 6, 0, 0, 82, 68, + 69, 70, 112, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 60, 0, 0, 0, 0, 5, + 83, 71, 0, 1, 0, 0, + 60, 0, 0, 0, 82, 68, + 49, 49, 60, 0, 0, 0, + 24, 0, 0, 0, 32, 0, + 0, 0, 40, 0, 0, 0, + 36, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 77, 105, 99, 114, 111, 115, + 111, 102, 116, 32, 40, 82, + 41, 32, 72, 76, 83, 76, + 32, 83, 104, 97, 100, 101, + 114, 32, 67, 111, 109, 112, + 105, 108, 101, 114, 32, 54, + 46, 51, 46, 57, 54, 48, + 48, 46, 49, 54, 51, 56, + 52, 0, 171, 171, 73, 83, + 71, 78, 196, 0, 0, 0, + 7, 0, 0, 0, 8, 0, + 0, 0, 176, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 15, 0, + 0, 0, 185, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 15, 15, + 0, 0, 185, 0, 0, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 2, 0, 0, 0, 15, 15, + 0, 0, 185, 0, 0, 0, + 2, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 3, 0, 0, 0, 15, 15, + 0, 0, 185, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 4, 0, 0, 0, 15, 15, + 0, 0, 185, 0, 0, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 5, 0, 0, 0, 15, 15, + 0, 0, 185, 0, 0, 0, + 5, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 6, 0, 0, 0, 15, 3, + 0, 0, 80, 79, 83, 73, + 84, 73, 79, 78, 0, 84, + 69, 88, 67, 79, 79, 82, + 68, 0, 171, 171, 79, 83, + 71, 53, 172, 0, 0, 0, + 5, 0, 0, 0, 8, 0, + 0, 0, 0, 0, 0, 0, + 148, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 160, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 1, 0, 0, 0, + 15, 0, 0, 0, 0, 0, + 0, 0, 160, 0, 0, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 2, 0, 0, 0, 15, 0, + 0, 0, 0, 0, 0, 0, + 160, 0, 0, 0, 2, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 3, 0, + 0, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 160, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 4, 0, 0, 0, + 15, 0, 0, 0, 83, 86, + 95, 80, 79, 83, 73, 84, + 73, 79, 78, 0, 84, 69, + 88, 67, 79, 79, 82, 68, + 0, 171, 171, 171, 83, 72, + 69, 88, 212, 3, 0, 0, + 80, 0, 2, 0, 245, 0, + 0, 0, 106, 8, 0, 1, + 95, 0, 0, 4, 242, 16, + 32, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 95, 0, + 0, 4, 242, 16, 32, 0, + 1, 0, 0, 0, 1, 0, + 0, 0, 95, 0, 0, 4, + 242, 16, 32, 0, 1, 0, + 0, 0, 2, 0, 0, 0, + 95, 0, 0, 4, 242, 16, + 32, 0, 1, 0, 0, 0, + 3, 0, 0, 0, 95, 0, + 0, 4, 242, 16, 32, 0, + 1, 0, 0, 0, 4, 0, + 0, 0, 95, 0, 0, 4, + 242, 16, 32, 0, 1, 0, + 0, 0, 5, 0, 0, 0, + 95, 0, 0, 4, 242, 16, + 32, 0, 1, 0, 0, 0, + 6, 0, 0, 0, 104, 0, + 0, 2, 1, 0, 0, 0, + 93, 8, 0, 1, 143, 0, + 0, 3, 0, 0, 17, 0, + 0, 0, 0, 0, 92, 40, + 0, 1, 103, 0, 0, 4, + 242, 32, 16, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 101, 0, 0, 3, 242, 32, + 16, 0, 1, 0, 0, 0, + 101, 0, 0, 3, 242, 32, + 16, 0, 2, 0, 0, 0, + 101, 0, 0, 3, 242, 32, + 16, 0, 3, 0, 0, 0, + 101, 0, 0, 3, 242, 32, + 16, 0, 4, 0, 0, 0, + 94, 0, 0, 2, 4, 0, + 0, 0, 49, 0, 0, 12, + 50, 0, 16, 0, 0, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 128, 63, 0, 0, + 128, 63, 0, 0, 0, 0, + 0, 0, 0, 0, 70, 16, + 32, 128, 129, 0, 0, 0, + 0, 0, 0, 0, 6, 0, + 0, 0, 60, 0, 0, 7, + 18, 0, 16, 0, 0, 0, + 0, 0, 26, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 0, 0, 0, 0, + 31, 0, 4, 3, 10, 0, + 16, 0, 0, 0, 0, 0, + 62, 0, 0, 1, 21, 0, + 0, 1, 54, 0, 0, 6, + 50, 32, 16, 0, 0, 0, + 0, 0, 198, 16, 32, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 54, 0, 0, 8, + 194, 32, 16, 0, 0, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 63, + 0, 0, 128, 63, 54, 0, + 0, 6, 242, 32, 16, 0, + 1, 0, 0, 0, 70, 30, + 32, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 54, 0, + 0, 6, 242, 32, 16, 0, + 2, 0, 0, 0, 70, 30, + 32, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 54, 0, + 0, 6, 242, 32, 16, 0, + 3, 0, 0, 0, 70, 30, + 32, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 54, 0, + 0, 6, 242, 32, 16, 0, + 4, 0, 0, 0, 70, 30, + 32, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 117, 0, + 0, 3, 0, 0, 17, 0, + 0, 0, 0, 0, 54, 0, + 0, 6, 50, 32, 16, 0, + 0, 0, 0, 0, 134, 16, + 32, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 54, 0, + 0, 8, 194, 32, 16, 0, + 0, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 63, 0, 0, 128, 63, + 54, 0, 0, 6, 242, 32, + 16, 0, 1, 0, 0, 0, + 70, 30, 32, 0, 0, 0, + 0, 0, 2, 0, 0, 0, + 54, 0, 0, 6, 242, 32, + 16, 0, 2, 0, 0, 0, + 70, 30, 32, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 54, 0, 0, 6, 242, 32, + 16, 0, 3, 0, 0, 0, + 70, 30, 32, 0, 0, 0, + 0, 0, 4, 0, 0, 0, + 54, 0, 0, 6, 242, 32, + 16, 0, 4, 0, 0, 0, + 70, 30, 32, 0, 0, 0, + 0, 0, 5, 0, 0, 0, + 117, 0, 0, 3, 0, 0, + 17, 0, 0, 0, 0, 0, + 54, 0, 0, 6, 50, 32, + 16, 0, 0, 0, 0, 0, + 214, 21, 32, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 54, 0, 0, 8, 194, 32, + 16, 0, 0, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 63, 0, 0, + 128, 63, 54, 0, 0, 6, + 242, 32, 16, 0, 1, 0, + 0, 0, 70, 30, 32, 0, + 0, 0, 0, 0, 2, 0, + 0, 0, 54, 0, 0, 6, + 242, 32, 16, 0, 2, 0, + 0, 0, 70, 30, 32, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 54, 0, 0, 6, + 242, 32, 16, 0, 3, 0, + 0, 0, 70, 30, 32, 0, + 0, 0, 0, 0, 4, 0, + 0, 0, 54, 0, 0, 6, + 242, 32, 16, 0, 4, 0, + 0, 0, 70, 30, 32, 0, + 0, 0, 0, 0, 5, 0, + 0, 0, 117, 0, 0, 3, + 0, 0, 17, 0, 0, 0, + 0, 0, 54, 0, 0, 6, + 50, 32, 16, 0, 0, 0, + 0, 0, 150, 21, 32, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 54, 0, 0, 8, + 194, 32, 16, 0, 0, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 63, + 0, 0, 128, 63, 54, 0, + 0, 6, 242, 32, 16, 0, + 1, 0, 0, 0, 70, 30, + 32, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 54, 0, + 0, 6, 242, 32, 16, 0, + 2, 0, 0, 0, 70, 30, + 32, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 54, 0, + 0, 6, 242, 32, 16, 0, + 3, 0, 0, 0, 70, 30, + 32, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 54, 0, + 0, 6, 242, 32, 16, 0, + 4, 0, 0, 0, 70, 30, + 32, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 117, 0, + 0, 3, 0, 0, 17, 0, + 0, 0, 0, 0, 62, 0, + 0, 1, 83, 84, 65, 84, + 148, 0, 0, 0, 34, 0, + 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 12, 0, + 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 2, 0, 0, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 5, 0, + 0, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0 +}; diff --git a/demo/d3d/shaders/ellipsoidDepthPS.hlsl b/demo/d3d/shaders/ellipsoidDepthPS.hlsl new file mode 100644 index 0000000..ccccc69 --- /dev/null +++ b/demo/d3d/shaders/ellipsoidDepthPS.hlsl @@ -0,0 +1,88 @@ +#include "shaderCommon.h" + +cbuffer constBuf : register(b0) +{ + FluidShaderConst gParams; +}; + +float Sign(float x) { return x < 0.0 ? -1.0 : 1.0; } + +bool solveQuadratic(float a, float b, float c, out float minT, out float maxT) +{ +#if 0 + minT = 0.0f; + maxT = 0.0f; +#endif + + if (a == 0.0 && b == 0.0) + { + minT = maxT = 0.0; + return true; + } + + float discriminant = b*b - 4.0*a*c; + + if (discriminant < 0.0) + { + return false; + } + + float t = -0.5*(b + Sign(b)*sqrt(discriminant)); + minT = t / a; + maxT = c / t; + + if (minT > maxT) + { + float tmp = minT; + minT = maxT; + maxT = tmp; + } + + return true; +} + +float sqr(float x) { return x * x; } + +float ellipsoidDepthPS(FluidGeoOut input , out float depthOut : SV_DEPTH) : SV_TARGET +{ + const float4x4 projectionMatrix = gParams.projection; + const float4x4 projectionMatrixInverse = gParams.inverseProjection; + const float3 invViewport = gParams.invViewport; + const float4 position = input.position; + + // transform from view space to parameter space + //column_major + float4x4 invQuadric; + invQuadric._m00_m10_m20_m30 = input.invQ0; + invQuadric._m01_m11_m21_m31 = input.invQ1; + invQuadric._m02_m12_m22_m32 = input.invQ2; + invQuadric._m03_m13_m23_m33 = input.invQ3; + + float4 ndcPos = float4(position.x*invViewport.x*2.0f-1.0f, (1.0f-position.y*invViewport.y)*2.0 - 1.0, 0.0f, 1.0); + float4 viewDir = mul(projectionMatrixInverse, ndcPos); + + // ray to parameter space + float4 dir = mul(invQuadric, float4(viewDir.xyz, 0.0)); + float4 origin = invQuadric._m03_m13_m23_m33; + + // set up quadratric equation + float a = sqr(dir.x) + sqr(dir.y) + sqr(dir.z); + float b = dir.x*origin.x + dir.y*origin.y + dir.z*origin.z - dir.w*origin.w; + float c = sqr(origin.x) + sqr(origin.y) + sqr(origin.z) - sqr(origin.w); + + float minT; + float maxT; + + if (!solveQuadratic(a, 2.0 * b, c, minT, maxT)) + { + discard; + } + { + float3 eyePos = viewDir.xyz*minT; + float4 ndcPos = mul(projectionMatrix, float4(eyePos, 1.0)); + ndcPos.z /= ndcPos.w; + + depthOut = ndcPos.z; + return eyePos.z; + } +} diff --git a/demo/d3d/shaders/ellipsoidDepthPS.hlsl.h b/demo/d3d/shaders/ellipsoidDepthPS.hlsl.h new file mode 100644 index 0000000..7e007a5 --- /dev/null +++ b/demo/d3d/shaders/ellipsoidDepthPS.hlsl.h @@ -0,0 +1,643 @@ +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// Buffer Definitions: +// +// cbuffer constBuf +// { +// +// struct FluidShaderConst +// { +// +// float4x4 modelViewProjection; // Offset: 0 +// float4x4 modelView; // Offset: 64 +// float4x4 projection; // Offset: 128 +// float4x4 inverseModelView; // Offset: 192 +// float4x4 inverseProjection; // Offset: 256 +// float4 invTexScale; // Offset: 320 +// float3 invViewport; // Offset: 336 +// float _pad0; // Offset: 348 +// float blurRadiusWorld; // Offset: 352 +// float blurScale; // Offset: 356 +// float blurFalloff; // Offset: 360 +// int debug; // Offset: 364 +// float3 lightPos; // Offset: 368 +// float _pad1; // Offset: 380 +// float3 lightDir; // Offset: 384 +// float _pad2; // Offset: 396 +// float4x4 lightTransform; // Offset: 400 +// float4 color; // Offset: 464 +// float4 clipPosToEye; // Offset: 480 +// float spotMin; // Offset: 496 +// float spotMax; // Offset: 500 +// float ior; // Offset: 504 +// float _pad3; // Offset: 508 +// float4 shadowTaps[12]; // Offset: 512 +// +// } gParams; // Offset: 0 Size: 704 +// +// } +// +// +// Resource Bindings: +// +// Name Type Format Dim Slot Elements +// ------------------------------ ---------- ------- ----------- ---- -------- +// constBuf cbuffer NA NA 0 1 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_POSITION 0 xyzw 0 POS float xy +// TEXCOORD 0 xyzw 1 NONE float xyzw +// TEXCOORD 1 xyzw 2 NONE float xyzw +// TEXCOORD 2 xyzw 3 NONE float xyzw +// TEXCOORD 3 xyzw 4 NONE float xyzw +// +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_TARGET 0 x 0 TARGET float x +// SV_DEPTH 0 N/A oDepth DEPTH float YES +// +ps_5_0 +dcl_globalFlags refactoringAllowed +dcl_constantbuffer cb0[22], immediateIndexed +dcl_input_ps_siv linear noperspective v0.xy, position +dcl_input_ps linear v1.xyzw +dcl_input_ps linear v2.xyzw +dcl_input_ps linear v3.xyzw +dcl_input_ps linear v4.xyzw +dcl_output o0.x +dcl_output oDepth +dcl_temps 4 +dp2 r0.x, v0.xxxx, cb0[21].xxxx +add r0.x, r0.x, l(-1.000000) +mad r0.y, -v0.y, cb0[21].y, l(1.000000) +mad r0.y, r0.y, l(2.000000), l(-1.000000) +mul r0.yzw, r0.yyyy, cb0[17].xxyz +mad r0.xyz, cb0[16].xyzx, r0.xxxx, r0.yzwy +add r0.xyz, r0.xyzx, cb0[19].xyzx +mul r1.xyzw, r0.yyyy, v2.xyzw +mad r1.xyzw, v1.xyzw, r0.xxxx, r1.xyzw +mad r1.xyzw, v3.xyzw, r0.zzzz, r1.xyzw +dp3 r0.w, r1.xyzx, r1.xyzx +dp3 r1.x, r1.xyzx, v4.xyzx +mad r1.x, -r1.w, v4.w, r1.x +dp3 r1.y, v4.xyzx, v4.xyzx +mad r1.y, -v4.w, v4.w, r1.y +add r1.z, r1.x, r1.x +eq r1.w, r0.w, l(0.000000) +eq r2.x, r1.x, l(0.000000) +and r1.w, r1.w, r2.x +mul r2.x, r0.w, r1.y +mul r2.x, r2.x, l(4.000000) +mad r2.x, r1.z, r1.z, -r2.x +lt r2.y, r2.x, l(0.000000) +not r3.y, r2.y +lt r1.x, r1.x, l(0.000000) +movc r1.x, r1.x, l(-1.000000), l(1.000000) +sqrt r2.x, r2.x +mad r1.x, r1.x, r2.x, r1.z +mul r1.x, r1.x, l(-0.500000) +div r0.w, r1.x, r0.w +div r1.x, r1.y, r1.x +lt r1.y, r1.x, r0.w +movc r3.z, r1.y, r1.x, r0.w +mov r3.xw, l(0,0,0,-1) +movc r1.xy, r2.yyyy, r3.xyxx, r3.zwzz +movc r1.xy, r1.wwww, l(0,-1,0,0), r1.xyxx +not r0.w, r1.y +discard_nz r0.w +mul r0.xyz, r0.xyzx, r1.xxxx +mul r0.yw, r0.yyyy, cb0[9].zzzw +mad r0.xy, cb0[8].zwzz, r0.xxxx, r0.ywyy +mad r0.xy, cb0[10].zwzz, r0.zzzz, r0.xyxx +add r0.xy, r0.xyxx, cb0[11].zwzz +div oDepth, r0.x, r0.y +mov o0.x, r0.z +ret +// Approximately 46 instruction slots used +#endif + +const BYTE g_ellipsoidDepthPS[] = +{ + 68, 88, 66, 67, 108, 237, + 133, 240, 171, 175, 220, 253, + 207, 147, 106, 237, 177, 103, + 173, 51, 1, 0, 0, 0, + 248, 11, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, + 112, 4, 0, 0, 16, 5, + 0, 0, 100, 5, 0, 0, + 92, 11, 0, 0, 82, 68, + 69, 70, 52, 4, 0, 0, + 1, 0, 0, 0, 104, 0, + 0, 0, 1, 0, 0, 0, + 60, 0, 0, 0, 0, 5, + 255, 255, 0, 1, 0, 0, + 0, 4, 0, 0, 82, 68, + 49, 49, 60, 0, 0, 0, + 24, 0, 0, 0, 32, 0, + 0, 0, 40, 0, 0, 0, + 36, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 1, 0, + 0, 0, 99, 111, 110, 115, + 116, 66, 117, 102, 0, 171, + 171, 171, 92, 0, 0, 0, + 1, 0, 0, 0, 128, 0, + 0, 0, 192, 2, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 168, 0, 0, 0, + 0, 0, 0, 0, 192, 2, + 0, 0, 2, 0, 0, 0, + 220, 3, 0, 0, 0, 0, + 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 255, 255, + 255, 255, 0, 0, 0, 0, + 103, 80, 97, 114, 97, 109, + 115, 0, 70, 108, 117, 105, + 100, 83, 104, 97, 100, 101, + 114, 67, 111, 110, 115, 116, + 0, 109, 111, 100, 101, 108, + 86, 105, 101, 119, 80, 114, + 111, 106, 101, 99, 116, 105, + 111, 110, 0, 102, 108, 111, + 97, 116, 52, 120, 52, 0, + 171, 171, 3, 0, 3, 0, + 4, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 213, 0, + 0, 0, 109, 111, 100, 101, + 108, 86, 105, 101, 119, 0, + 112, 114, 111, 106, 101, 99, + 116, 105, 111, 110, 0, 105, + 110, 118, 101, 114, 115, 101, + 77, 111, 100, 101, 108, 86, + 105, 101, 119, 0, 105, 110, + 118, 101, 114, 115, 101, 80, + 114, 111, 106, 101, 99, 116, + 105, 111, 110, 0, 105, 110, + 118, 84, 101, 120, 83, 99, + 97, 108, 101, 0, 102, 108, + 111, 97, 116, 52, 0, 171, + 1, 0, 3, 0, 1, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 72, 1, 0, 0, + 105, 110, 118, 86, 105, 101, + 119, 112, 111, 114, 116, 0, + 102, 108, 111, 97, 116, 51, + 0, 171, 1, 0, 3, 0, + 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 128, 1, + 0, 0, 95, 112, 97, 100, + 48, 0, 102, 108, 111, 97, + 116, 0, 0, 0, 3, 0, + 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 178, 1, + 0, 0, 98, 108, 117, 114, + 82, 97, 100, 105, 117, 115, + 87, 111, 114, 108, 100, 0, + 98, 108, 117, 114, 83, 99, + 97, 108, 101, 0, 98, 108, + 117, 114, 70, 97, 108, 108, + 111, 102, 102, 0, 100, 101, + 98, 117, 103, 0, 105, 110, + 116, 0, 0, 0, 2, 0, + 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 8, 2, + 0, 0, 108, 105, 103, 104, + 116, 80, 111, 115, 0, 95, + 112, 97, 100, 49, 0, 108, + 105, 103, 104, 116, 68, 105, + 114, 0, 95, 112, 97, 100, + 50, 0, 108, 105, 103, 104, + 116, 84, 114, 97, 110, 115, + 102, 111, 114, 109, 0, 99, + 111, 108, 111, 114, 0, 99, + 108, 105, 112, 80, 111, 115, + 84, 111, 69, 121, 101, 0, + 115, 112, 111, 116, 77, 105, + 110, 0, 115, 112, 111, 116, + 77, 97, 120, 0, 105, 111, + 114, 0, 95, 112, 97, 100, + 51, 0, 115, 104, 97, 100, + 111, 119, 84, 97, 112, 115, + 0, 171, 171, 171, 1, 0, + 3, 0, 1, 0, 4, 0, + 12, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 72, 1, 0, 0, 193, 0, + 0, 0, 224, 0, 0, 0, + 0, 0, 0, 0, 4, 1, + 0, 0, 224, 0, 0, 0, + 64, 0, 0, 0, 14, 1, + 0, 0, 224, 0, 0, 0, + 128, 0, 0, 0, 25, 1, + 0, 0, 224, 0, 0, 0, + 192, 0, 0, 0, 42, 1, + 0, 0, 224, 0, 0, 0, + 0, 1, 0, 0, 60, 1, + 0, 0, 80, 1, 0, 0, + 64, 1, 0, 0, 116, 1, + 0, 0, 136, 1, 0, 0, + 80, 1, 0, 0, 172, 1, + 0, 0, 184, 1, 0, 0, + 92, 1, 0, 0, 220, 1, + 0, 0, 184, 1, 0, 0, + 96, 1, 0, 0, 236, 1, + 0, 0, 184, 1, 0, 0, + 100, 1, 0, 0, 246, 1, + 0, 0, 184, 1, 0, 0, + 104, 1, 0, 0, 2, 2, + 0, 0, 12, 2, 0, 0, + 108, 1, 0, 0, 48, 2, + 0, 0, 136, 1, 0, 0, + 112, 1, 0, 0, 57, 2, + 0, 0, 184, 1, 0, 0, + 124, 1, 0, 0, 63, 2, + 0, 0, 136, 1, 0, 0, + 128, 1, 0, 0, 72, 2, + 0, 0, 184, 1, 0, 0, + 140, 1, 0, 0, 78, 2, + 0, 0, 224, 0, 0, 0, + 144, 1, 0, 0, 93, 2, + 0, 0, 80, 1, 0, 0, + 208, 1, 0, 0, 99, 2, + 0, 0, 80, 1, 0, 0, + 224, 1, 0, 0, 112, 2, + 0, 0, 184, 1, 0, 0, + 240, 1, 0, 0, 120, 2, + 0, 0, 184, 1, 0, 0, + 244, 1, 0, 0, 128, 2, + 0, 0, 184, 1, 0, 0, + 248, 1, 0, 0, 132, 2, + 0, 0, 184, 1, 0, 0, + 252, 1, 0, 0, 138, 2, + 0, 0, 152, 2, 0, 0, + 0, 2, 0, 0, 5, 0, + 0, 0, 1, 0, 176, 0, + 0, 0, 24, 0, 188, 2, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 176, 0, 0, 0, 77, 105, + 99, 114, 111, 115, 111, 102, + 116, 32, 40, 82, 41, 32, + 72, 76, 83, 76, 32, 83, + 104, 97, 100, 101, 114, 32, + 67, 111, 109, 112, 105, 108, + 101, 114, 32, 54, 46, 51, + 46, 57, 54, 48, 48, 46, + 49, 54, 51, 56, 52, 0, + 171, 171, 73, 83, 71, 78, + 152, 0, 0, 0, 5, 0, + 0, 0, 8, 0, 0, 0, + 128, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 15, 3, 0, 0, + 140, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 1, 0, + 0, 0, 15, 15, 0, 0, + 140, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 2, 0, + 0, 0, 15, 15, 0, 0, + 140, 0, 0, 0, 2, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 3, 0, + 0, 0, 15, 15, 0, 0, + 140, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 4, 0, + 0, 0, 15, 15, 0, 0, + 83, 86, 95, 80, 79, 83, + 73, 84, 73, 79, 78, 0, + 84, 69, 88, 67, 79, 79, + 82, 68, 0, 171, 171, 171, + 79, 83, 71, 78, 76, 0, + 0, 0, 2, 0, 0, 0, + 8, 0, 0, 0, 56, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 1, 14, 0, 0, 66, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 255, 255, 255, 255, + 1, 14, 0, 0, 83, 86, + 95, 84, 65, 82, 71, 69, + 84, 0, 83, 86, 95, 68, + 69, 80, 84, 72, 0, 171, + 83, 72, 69, 88, 240, 5, + 0, 0, 80, 0, 0, 0, + 124, 1, 0, 0, 106, 8, + 0, 1, 89, 0, 0, 4, + 70, 142, 32, 0, 0, 0, + 0, 0, 22, 0, 0, 0, + 100, 32, 0, 4, 50, 16, + 16, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 98, 16, + 0, 3, 242, 16, 16, 0, + 1, 0, 0, 0, 98, 16, + 0, 3, 242, 16, 16, 0, + 2, 0, 0, 0, 98, 16, + 0, 3, 242, 16, 16, 0, + 3, 0, 0, 0, 98, 16, + 0, 3, 242, 16, 16, 0, + 4, 0, 0, 0, 101, 0, + 0, 3, 18, 32, 16, 0, + 0, 0, 0, 0, 101, 0, + 0, 2, 1, 192, 0, 0, + 104, 0, 0, 2, 4, 0, + 0, 0, 15, 0, 0, 8, + 18, 0, 16, 0, 0, 0, + 0, 0, 6, 16, 16, 0, + 0, 0, 0, 0, 6, 128, + 32, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 0, 0, + 0, 7, 18, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 0, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 191, 50, 0, 0, 11, + 34, 0, 16, 0, 0, 0, + 0, 0, 26, 16, 16, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 26, 128, 32, 0, + 0, 0, 0, 0, 21, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 50, 0, + 0, 9, 34, 0, 16, 0, + 0, 0, 0, 0, 26, 0, + 16, 0, 0, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 0, 64, 1, 64, 0, 0, + 0, 0, 128, 191, 56, 0, + 0, 8, 226, 0, 16, 0, + 0, 0, 0, 0, 86, 5, + 16, 0, 0, 0, 0, 0, + 6, 137, 32, 0, 0, 0, + 0, 0, 17, 0, 0, 0, + 50, 0, 0, 10, 114, 0, + 16, 0, 0, 0, 0, 0, + 70, 130, 32, 0, 0, 0, + 0, 0, 16, 0, 0, 0, + 6, 0, 16, 0, 0, 0, + 0, 0, 150, 7, 16, 0, + 0, 0, 0, 0, 0, 0, + 0, 8, 114, 0, 16, 0, + 0, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 70, 130, 32, 0, 0, 0, + 0, 0, 19, 0, 0, 0, + 56, 0, 0, 7, 242, 0, + 16, 0, 1, 0, 0, 0, + 86, 5, 16, 0, 0, 0, + 0, 0, 70, 30, 16, 0, + 2, 0, 0, 0, 50, 0, + 0, 9, 242, 0, 16, 0, + 1, 0, 0, 0, 70, 30, + 16, 0, 1, 0, 0, 0, + 6, 0, 16, 0, 0, 0, + 0, 0, 70, 14, 16, 0, + 1, 0, 0, 0, 50, 0, + 0, 9, 242, 0, 16, 0, + 1, 0, 0, 0, 70, 30, + 16, 0, 3, 0, 0, 0, + 166, 10, 16, 0, 0, 0, + 0, 0, 70, 14, 16, 0, + 1, 0, 0, 0, 16, 0, + 0, 7, 130, 0, 16, 0, + 0, 0, 0, 0, 70, 2, + 16, 0, 1, 0, 0, 0, + 70, 2, 16, 0, 1, 0, + 0, 0, 16, 0, 0, 7, + 18, 0, 16, 0, 1, 0, + 0, 0, 70, 2, 16, 0, + 1, 0, 0, 0, 70, 18, + 16, 0, 4, 0, 0, 0, + 50, 0, 0, 10, 18, 0, + 16, 0, 1, 0, 0, 0, + 58, 0, 16, 128, 65, 0, + 0, 0, 1, 0, 0, 0, + 58, 16, 16, 0, 4, 0, + 0, 0, 10, 0, 16, 0, + 1, 0, 0, 0, 16, 0, + 0, 7, 34, 0, 16, 0, + 1, 0, 0, 0, 70, 18, + 16, 0, 4, 0, 0, 0, + 70, 18, 16, 0, 4, 0, + 0, 0, 50, 0, 0, 10, + 34, 0, 16, 0, 1, 0, + 0, 0, 58, 16, 16, 128, + 65, 0, 0, 0, 4, 0, + 0, 0, 58, 16, 16, 0, + 4, 0, 0, 0, 26, 0, + 16, 0, 1, 0, 0, 0, + 0, 0, 0, 7, 66, 0, + 16, 0, 1, 0, 0, 0, + 10, 0, 16, 0, 1, 0, + 0, 0, 10, 0, 16, 0, + 1, 0, 0, 0, 24, 0, + 0, 7, 130, 0, 16, 0, + 1, 0, 0, 0, 58, 0, + 16, 0, 0, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 0, 0, 24, 0, 0, 7, + 18, 0, 16, 0, 2, 0, + 0, 0, 10, 0, 16, 0, + 1, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 7, 130, 0, + 16, 0, 1, 0, 0, 0, + 58, 0, 16, 0, 1, 0, + 0, 0, 10, 0, 16, 0, + 2, 0, 0, 0, 56, 0, + 0, 7, 18, 0, 16, 0, + 2, 0, 0, 0, 58, 0, + 16, 0, 0, 0, 0, 0, + 26, 0, 16, 0, 1, 0, + 0, 0, 56, 0, 0, 7, + 18, 0, 16, 0, 2, 0, + 0, 0, 10, 0, 16, 0, + 2, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 64, + 50, 0, 0, 10, 18, 0, + 16, 0, 2, 0, 0, 0, + 42, 0, 16, 0, 1, 0, + 0, 0, 42, 0, 16, 0, + 1, 0, 0, 0, 10, 0, + 16, 128, 65, 0, 0, 0, + 2, 0, 0, 0, 49, 0, + 0, 7, 34, 0, 16, 0, + 2, 0, 0, 0, 10, 0, + 16, 0, 2, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 0, 0, 59, 0, 0, 5, + 34, 0, 16, 0, 3, 0, + 0, 0, 26, 0, 16, 0, + 2, 0, 0, 0, 49, 0, + 0, 7, 18, 0, 16, 0, + 1, 0, 0, 0, 10, 0, + 16, 0, 1, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 0, 0, 55, 0, 0, 9, + 18, 0, 16, 0, 1, 0, + 0, 0, 10, 0, 16, 0, + 1, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 191, + 1, 64, 0, 0, 0, 0, + 128, 63, 75, 0, 0, 5, + 18, 0, 16, 0, 2, 0, + 0, 0, 10, 0, 16, 0, + 2, 0, 0, 0, 50, 0, + 0, 9, 18, 0, 16, 0, + 1, 0, 0, 0, 10, 0, + 16, 0, 1, 0, 0, 0, + 10, 0, 16, 0, 2, 0, + 0, 0, 42, 0, 16, 0, + 1, 0, 0, 0, 56, 0, + 0, 7, 18, 0, 16, 0, + 1, 0, 0, 0, 10, 0, + 16, 0, 1, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 0, 191, 14, 0, 0, 7, + 130, 0, 16, 0, 0, 0, + 0, 0, 10, 0, 16, 0, + 1, 0, 0, 0, 58, 0, + 16, 0, 0, 0, 0, 0, + 14, 0, 0, 7, 18, 0, + 16, 0, 1, 0, 0, 0, + 26, 0, 16, 0, 1, 0, + 0, 0, 10, 0, 16, 0, + 1, 0, 0, 0, 49, 0, + 0, 7, 34, 0, 16, 0, + 1, 0, 0, 0, 10, 0, + 16, 0, 1, 0, 0, 0, + 58, 0, 16, 0, 0, 0, + 0, 0, 55, 0, 0, 9, + 66, 0, 16, 0, 3, 0, + 0, 0, 26, 0, 16, 0, + 1, 0, 0, 0, 10, 0, + 16, 0, 1, 0, 0, 0, + 58, 0, 16, 0, 0, 0, + 0, 0, 54, 0, 0, 8, + 146, 0, 16, 0, 3, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 255, 255, 255, 255, 55, 0, + 0, 9, 50, 0, 16, 0, + 1, 0, 0, 0, 86, 5, + 16, 0, 2, 0, 0, 0, + 70, 0, 16, 0, 3, 0, + 0, 0, 230, 10, 16, 0, + 3, 0, 0, 0, 55, 0, + 0, 12, 50, 0, 16, 0, + 1, 0, 0, 0, 246, 15, + 16, 0, 1, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 0, 0, + 0, 0, 70, 0, 16, 0, + 1, 0, 0, 0, 59, 0, + 0, 5, 130, 0, 16, 0, + 0, 0, 0, 0, 26, 0, + 16, 0, 1, 0, 0, 0, + 13, 0, 4, 3, 58, 0, + 16, 0, 0, 0, 0, 0, + 56, 0, 0, 7, 114, 0, + 16, 0, 0, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 6, 0, 16, 0, + 1, 0, 0, 0, 56, 0, + 0, 8, 162, 0, 16, 0, + 0, 0, 0, 0, 86, 5, + 16, 0, 0, 0, 0, 0, + 166, 142, 32, 0, 0, 0, + 0, 0, 9, 0, 0, 0, + 50, 0, 0, 10, 50, 0, + 16, 0, 0, 0, 0, 0, + 230, 138, 32, 0, 0, 0, + 0, 0, 8, 0, 0, 0, + 6, 0, 16, 0, 0, 0, + 0, 0, 214, 5, 16, 0, + 0, 0, 0, 0, 50, 0, + 0, 10, 50, 0, 16, 0, + 0, 0, 0, 0, 230, 138, + 32, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 166, 10, + 16, 0, 0, 0, 0, 0, + 70, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 8, + 50, 0, 16, 0, 0, 0, + 0, 0, 70, 0, 16, 0, + 0, 0, 0, 0, 230, 138, + 32, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 14, 0, + 0, 6, 1, 192, 0, 0, + 10, 0, 16, 0, 0, 0, + 0, 0, 26, 0, 16, 0, + 0, 0, 0, 0, 54, 0, + 0, 5, 18, 32, 16, 0, + 0, 0, 0, 0, 42, 0, + 16, 0, 0, 0, 0, 0, + 62, 0, 0, 1, 83, 84, + 65, 84, 148, 0, 0, 0, + 46, 0, 0, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 35, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, + 0, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0 +}; diff --git a/demo/d3d/shaders/ellipsoidDepthVS.hlsl b/demo/d3d/shaders/ellipsoidDepthVS.hlsl new file mode 100644 index 0000000..f26317e --- /dev/null +++ b/demo/d3d/shaders/ellipsoidDepthVS.hlsl @@ -0,0 +1,118 @@ +#include "shaderCommon.h" + +cbuffer constBuf : register(b0) +{ + FluidShaderConst gParams; +}; + +// returns 1.0 for x==0.0 (unlike glsl) +float Sign(float x) { return x < 0.0 ? -1.0 : 1.0; } + +bool solveQuadratic(float a, float b, float c, out float minT, out float maxT) +{ +#if 0 + // for debugging + minT = -0.5; + maxT = 0.5; + return true; +#else + //minT = 0.0f; + //maxT = 0.0f; +#endif + + if (a == 0.0 && b == 0.0) + { + minT = maxT = 0.0; + return false; + } + + float discriminant = b*b - 4.0*a*c; + + if (discriminant < 0.0) + { + return false; + } + + float t = -0.5*(b + Sign(b)*sqrt(discriminant)); + minT = t / a; + maxT = c / t; + + if (minT > maxT) + { + float tmp = minT; + minT = maxT; + maxT = tmp; + } + + return true; +} + +float DotInvW(float4 a, float4 b) { return a.x*b.x + a.y*b.y + a.z*b.z - a.w*b.w; } + +FluidVertexOut ellipsoidDepthVS(FluidVertexIn input, uint instance : SV_VertexID) +{ + const float4 q1 = input.q1; + const float4 q2 = input.q2; + const float4 q3 = input.q3; + + const float4x4 modelViewProjectionMatrix = gParams.modelViewProjection; + const float4x4 modelViewMatrixInverse = gParams.inverseModelView; + + float3 worldPos = input.position.xyz; + + // construct quadric matrix + float4x4 q; + q._m00_m10_m20_m30 = float4(q1.xyz*q1.w, 0.0); + q._m01_m11_m21_m31 = float4(q2.xyz*q2.w, 0.0); + q._m02_m12_m22_m32 = float4(q3.xyz*q3.w, 0.0); + q._m03_m13_m23_m33 = float4(worldPos, 1.0); + + // transforms a normal to parameter space (inverse transpose of (q*modelview)^-T) + float4x4 invClip = mul(modelViewProjectionMatrix, q); + + // solve for the right hand bounds in homogenous clip space + float a1 = DotInvW(invClip[3], invClip[3]); + float b1 = -2.0f*DotInvW(invClip[0], invClip[3]); + float c1 = DotInvW(invClip[0], invClip[0]); + + float xmin; + float xmax; + solveQuadratic(a1, b1, c1, xmin, xmax); + + // solve for the right hand bounds in homogenous clip space + float a2 = DotInvW(invClip[3], invClip[3]); + float b2 = -2.0f*DotInvW(invClip[1], invClip[3]); + float c2 = DotInvW(invClip[1], invClip[1]); + + float ymin; + float ymax; + solveQuadratic(a2, b2, c2, ymin, ymax); + + FluidVertexOut output; + output.position = float4(worldPos.xyz, 1.0); + output.bounds = float4(xmin, xmax, ymin, ymax); + + // construct inverse quadric matrix (used for ray-casting in parameter space) + float4x4 invq; + invq._m00_m10_m20_m30 = float4(q1.xyz / q1.w, 0.0); + invq._m01_m11_m21_m31 = float4(q2.xyz / q2.w, 0.0); + invq._m02_m12_m22_m32 = float4(q3.xyz / q3.w, 0.0); + invq._m03_m13_m23_m33 = float4(0.0, 0.0, 0.0, 1.0); + + invq = transpose(invq); + invq._m03_m13_m23_m33 = -(mul(invq, output.position)); + + // transform a point from view space to parameter space + invq = mul(invq, modelViewMatrixInverse); + + // pass down + output.invQ0 = invq._m00_m10_m20_m30; + output.invQ1 = invq._m01_m11_m21_m31; + output.invQ2 = invq._m02_m12_m22_m32; + output.invQ3 = invq._m03_m13_m23_m33; + + // compute ndc pos for frustrum culling in GS + float4 projPos = mul(modelViewProjectionMatrix, float4(worldPos.xyz, 1.0)); + output.ndcPos = projPos / projPos.w; + return output; +} diff --git a/demo/d3d/shaders/ellipsoidDepthVS.hlsl.h b/demo/d3d/shaders/ellipsoidDepthVS.hlsl.h new file mode 100644 index 0000000..719d17d --- /dev/null +++ b/demo/d3d/shaders/ellipsoidDepthVS.hlsl.h @@ -0,0 +1,935 @@ +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// Buffer Definitions: +// +// cbuffer constBuf +// { +// +// struct FluidShaderConst +// { +// +// float4x4 modelViewProjection; // Offset: 0 +// float4x4 modelView; // Offset: 64 +// float4x4 projection; // Offset: 128 +// float4x4 inverseModelView; // Offset: 192 +// float4x4 inverseProjection; // Offset: 256 +// float4 invTexScale; // Offset: 320 +// float3 invViewport; // Offset: 336 +// float _pad0; // Offset: 348 +// float blurRadiusWorld; // Offset: 352 +// float blurScale; // Offset: 356 +// float blurFalloff; // Offset: 360 +// int debug; // Offset: 364 +// float3 lightPos; // Offset: 368 +// float _pad1; // Offset: 380 +// float3 lightDir; // Offset: 384 +// float _pad2; // Offset: 396 +// float4x4 lightTransform; // Offset: 400 +// float4 color; // Offset: 464 +// float4 clipPosToEye; // Offset: 480 +// float spotMin; // Offset: 496 +// float spotMax; // Offset: 500 +// float ior; // Offset: 504 +// float _pad3; // Offset: 508 +// float4 shadowTaps[12]; // Offset: 512 +// +// } gParams; // Offset: 0 Size: 704 +// +// } +// +// +// Resource Bindings: +// +// Name Type Format Dim Slot Elements +// ------------------------------ ---------- ------- ----------- ---- -------- +// constBuf cbuffer NA NA 0 1 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// POSITION 0 xyzw 0 NONE float xyz +// U 0 xyzw 1 NONE float xyzw +// V 0 xyzw 2 NONE float xyzw +// W 0 xyzw 3 NONE float xyzw +// SV_VertexID 0 x 4 VERTID uint +// +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// POSITION 0 xyzw 0 NONE float xyzw +// TEXCOORD 0 xyzw 1 NONE float xyzw +// TEXCOORD 1 xyzw 2 NONE float xyzw +// TEXCOORD 2 xyzw 3 NONE float xyzw +// TEXCOORD 3 xyzw 4 NONE float xyzw +// TEXCOORD 4 xyzw 5 NONE float xyzw +// TEXCOORD 5 xyzw 6 NONE float xyzw +// +vs_5_0 +dcl_globalFlags refactoringAllowed +dcl_constantbuffer cb0[16], immediateIndexed +dcl_input v0.xyz +dcl_input v1.xyzw +dcl_input v2.xyzw +dcl_input v3.xyzw +dcl_output o0.xyzw +dcl_output o1.xyzw +dcl_output o2.xyzw +dcl_output o3.xyzw +dcl_output o4.xyzw +dcl_output o5.xyzw +dcl_output o6.xyzw +dcl_temps 4 +mov o0.xyz, v0.xyzx +mov o0.w, l(1.000000) +mul r0.xyz, v2.wwww, v2.xyzx +mul r1.xyzw, r0.yyyy, cb0[1].wxxy +mad r1.xyzw, cb0[0].wxxy, r0.xxxx, r1.xyzw +mad r0.xyzw, cb0[2].wxxy, r0.zzzz, r1.xyzw +mul r1.x, r0.w, r0.w +mul r0.xyzw, r0.xxzx, r0.xyzw +mul r1.yzw, v1.wwww, v1.xxyz +mul r2.xyzw, r1.zzzz, cb0[1].wxxy +mad r2.xyzw, cb0[0].wxxy, r1.yyyy, r2.xyzw +mad r2.xyzw, cb0[2].wxxy, r1.wwww, r2.xyzw +mad r1.x, r2.w, r2.w, r1.x +mad r0.xyzw, r2.xyzw, r2.xxzx, r0.xyzw +mul r1.yzw, v3.wwww, v3.xxyz +mul r2.xyzw, r1.zzzz, cb0[1].wxxy +mad r2.xyzw, cb0[0].wxxy, r1.yyyy, r2.xyzw +mad r2.xyzw, cb0[2].wxxy, r1.wwww, r2.xyzw +mad r1.x, r2.w, r2.w, r1.x +mad r0.xyzw, r2.xyzw, r2.xxzx, r0.xyzw +mul r2.xyzw, v0.yyyy, cb0[1].wxxy +mad r2.xyzw, cb0[0].wxxy, v0.xxxx, r2.xyzw +mad r2.xyzw, cb0[2].wxxy, v0.zzzz, r2.xyzw +add r2.xyzw, r2.xyzw, cb0[3].wxxy +mad r1.x, -r2.w, r2.w, r1.x +mad r0.xyzw, -r2.xyzw, r2.xxzx, r0.xyzw +mul r1.yzw, r0.yyxw, l(0.000000, -2.000000, 4.000000, -2.000000) +mul r2.xy, r1.ywyy, r1.ywyy +mad r2.y, -r1.z, r1.x, r2.y +mad r1.z, -r1.z, r0.z, r2.x +sqrt r2.x, r2.y +ge r2.y, r2.y, l(0.000000) +lt r2.zw, l(0.000000, 0.000000, -0.000000, -0.000000), r0.yyyw +movc r2.zw, r2.zzzw, l(0,0,-1.000000,-1.000000), l(0,0,1.000000,1.000000) +mad r1.w, r2.w, r2.x, r1.w +mul r1.w, r1.w, l(-0.500000) +div r3.w, r1.w, r0.x +div r3.z, r1.x, r1.w +lt r1.x, r3.z, r3.w +movc r1.xw, r1.xxxx, r3.zzzw, r3.wwwz +and r1.xw, r1.xxxw, r2.yyyy +eq r2.xyw, r0.xyxw, l(0.000000, -0.000000, 0.000000, -0.000000) +and r0.yw, r2.yyyw, r2.xxxx +movc o1.zw, r0.wwww, l(0,0,0,0), r1.xxxw +sqrt r0.w, r1.z +ge r1.x, r1.z, l(0.000000) +mad r0.w, r2.z, r0.w, r1.y +mul r0.w, r0.w, l(-0.500000) +div r2.xy, r0.zwzz, r0.wxww +lt r0.x, r2.x, r2.y +movc r0.xz, r0.xxxx, r2.xxyx, r2.yyxy +and r0.xz, r0.xxzx, r1.xxxx +movc o1.xy, r0.yyyy, l(0,0,0,0), r0.xzxx +mov o2.w, -cb0[12].w +div r0.xyz, v1.xyzx, v1.wwww +dp3 r0.w, r0.xyzx, v0.xyzx +mov r0.w, -r0.w +dp4 o2.x, r0.xyzw, cb0[12].xyzw +div r1.xyz, v2.xyzx, v2.wwww +dp3 r1.w, r1.xyzx, v0.xyzx +mov r1.w, -r1.w +dp4 o2.y, r1.xyzw, cb0[12].xyzw +div r2.xyz, v3.xyzx, v3.wwww +dp3 r2.w, r2.xyzx, v0.xyzx +mov r2.w, -r2.w +dp4 o2.z, r2.xyzw, cb0[12].xyzw +mov o3.w, -cb0[13].w +dp4 o3.x, r0.xyzw, cb0[13].xyzw +dp4 o3.y, r1.xyzw, cb0[13].xyzw +dp4 o3.z, r2.xyzw, cb0[13].xyzw +dp4 o4.x, r0.xyzw, cb0[14].xyzw +dp4 o5.x, r0.xyzw, cb0[15].xyzw +dp4 o4.y, r1.xyzw, cb0[14].xyzw +dp4 o5.y, r1.xyzw, cb0[15].xyzw +dp4 o4.z, r2.xyzw, cb0[14].xyzw +dp4 o5.z, r2.xyzw, cb0[15].xyzw +mov o4.w, -cb0[14].w +mov o5.w, -cb0[15].w +mul r0.xyzw, v0.yyyy, cb0[1].xyzw +mad r0.xyzw, cb0[0].xyzw, v0.xxxx, r0.xyzw +mad r0.xyzw, cb0[2].xyzw, v0.zzzz, r0.xyzw +add r0.xyzw, r0.xyzw, cb0[3].xyzw +div o6.xyzw, r0.xyzw, r0.wwww +ret +// Approximately 84 instruction slots used +#endif + +const BYTE g_ellipsoidDepthVS[] = +{ + 68, 88, 66, 67, 251, 213, + 215, 144, 39, 19, 119, 132, + 9, 110, 41, 184, 9, 243, + 116, 11, 1, 0, 0, 0, + 184, 17, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, + 112, 4, 0, 0, 20, 5, + 0, 0, 224, 5, 0, 0, + 28, 17, 0, 0, 82, 68, + 69, 70, 52, 4, 0, 0, + 1, 0, 0, 0, 104, 0, + 0, 0, 1, 0, 0, 0, + 60, 0, 0, 0, 0, 5, + 254, 255, 0, 1, 0, 0, + 0, 4, 0, 0, 82, 68, + 49, 49, 60, 0, 0, 0, + 24, 0, 0, 0, 32, 0, + 0, 0, 40, 0, 0, 0, + 36, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 1, 0, + 0, 0, 99, 111, 110, 115, + 116, 66, 117, 102, 0, 171, + 171, 171, 92, 0, 0, 0, + 1, 0, 0, 0, 128, 0, + 0, 0, 192, 2, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 168, 0, 0, 0, + 0, 0, 0, 0, 192, 2, + 0, 0, 2, 0, 0, 0, + 220, 3, 0, 0, 0, 0, + 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 255, 255, + 255, 255, 0, 0, 0, 0, + 103, 80, 97, 114, 97, 109, + 115, 0, 70, 108, 117, 105, + 100, 83, 104, 97, 100, 101, + 114, 67, 111, 110, 115, 116, + 0, 109, 111, 100, 101, 108, + 86, 105, 101, 119, 80, 114, + 111, 106, 101, 99, 116, 105, + 111, 110, 0, 102, 108, 111, + 97, 116, 52, 120, 52, 0, + 171, 171, 3, 0, 3, 0, + 4, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 213, 0, + 0, 0, 109, 111, 100, 101, + 108, 86, 105, 101, 119, 0, + 112, 114, 111, 106, 101, 99, + 116, 105, 111, 110, 0, 105, + 110, 118, 101, 114, 115, 101, + 77, 111, 100, 101, 108, 86, + 105, 101, 119, 0, 105, 110, + 118, 101, 114, 115, 101, 80, + 114, 111, 106, 101, 99, 116, + 105, 111, 110, 0, 105, 110, + 118, 84, 101, 120, 83, 99, + 97, 108, 101, 0, 102, 108, + 111, 97, 116, 52, 0, 171, + 1, 0, 3, 0, 1, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 72, 1, 0, 0, + 105, 110, 118, 86, 105, 101, + 119, 112, 111, 114, 116, 0, + 102, 108, 111, 97, 116, 51, + 0, 171, 1, 0, 3, 0, + 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 128, 1, + 0, 0, 95, 112, 97, 100, + 48, 0, 102, 108, 111, 97, + 116, 0, 0, 0, 3, 0, + 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 178, 1, + 0, 0, 98, 108, 117, 114, + 82, 97, 100, 105, 117, 115, + 87, 111, 114, 108, 100, 0, + 98, 108, 117, 114, 83, 99, + 97, 108, 101, 0, 98, 108, + 117, 114, 70, 97, 108, 108, + 111, 102, 102, 0, 100, 101, + 98, 117, 103, 0, 105, 110, + 116, 0, 0, 0, 2, 0, + 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 8, 2, + 0, 0, 108, 105, 103, 104, + 116, 80, 111, 115, 0, 95, + 112, 97, 100, 49, 0, 108, + 105, 103, 104, 116, 68, 105, + 114, 0, 95, 112, 97, 100, + 50, 0, 108, 105, 103, 104, + 116, 84, 114, 97, 110, 115, + 102, 111, 114, 109, 0, 99, + 111, 108, 111, 114, 0, 99, + 108, 105, 112, 80, 111, 115, + 84, 111, 69, 121, 101, 0, + 115, 112, 111, 116, 77, 105, + 110, 0, 115, 112, 111, 116, + 77, 97, 120, 0, 105, 111, + 114, 0, 95, 112, 97, 100, + 51, 0, 115, 104, 97, 100, + 111, 119, 84, 97, 112, 115, + 0, 171, 171, 171, 1, 0, + 3, 0, 1, 0, 4, 0, + 12, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 72, 1, 0, 0, 193, 0, + 0, 0, 224, 0, 0, 0, + 0, 0, 0, 0, 4, 1, + 0, 0, 224, 0, 0, 0, + 64, 0, 0, 0, 14, 1, + 0, 0, 224, 0, 0, 0, + 128, 0, 0, 0, 25, 1, + 0, 0, 224, 0, 0, 0, + 192, 0, 0, 0, 42, 1, + 0, 0, 224, 0, 0, 0, + 0, 1, 0, 0, 60, 1, + 0, 0, 80, 1, 0, 0, + 64, 1, 0, 0, 116, 1, + 0, 0, 136, 1, 0, 0, + 80, 1, 0, 0, 172, 1, + 0, 0, 184, 1, 0, 0, + 92, 1, 0, 0, 220, 1, + 0, 0, 184, 1, 0, 0, + 96, 1, 0, 0, 236, 1, + 0, 0, 184, 1, 0, 0, + 100, 1, 0, 0, 246, 1, + 0, 0, 184, 1, 0, 0, + 104, 1, 0, 0, 2, 2, + 0, 0, 12, 2, 0, 0, + 108, 1, 0, 0, 48, 2, + 0, 0, 136, 1, 0, 0, + 112, 1, 0, 0, 57, 2, + 0, 0, 184, 1, 0, 0, + 124, 1, 0, 0, 63, 2, + 0, 0, 136, 1, 0, 0, + 128, 1, 0, 0, 72, 2, + 0, 0, 184, 1, 0, 0, + 140, 1, 0, 0, 78, 2, + 0, 0, 224, 0, 0, 0, + 144, 1, 0, 0, 93, 2, + 0, 0, 80, 1, 0, 0, + 208, 1, 0, 0, 99, 2, + 0, 0, 80, 1, 0, 0, + 224, 1, 0, 0, 112, 2, + 0, 0, 184, 1, 0, 0, + 240, 1, 0, 0, 120, 2, + 0, 0, 184, 1, 0, 0, + 244, 1, 0, 0, 128, 2, + 0, 0, 184, 1, 0, 0, + 248, 1, 0, 0, 132, 2, + 0, 0, 184, 1, 0, 0, + 252, 1, 0, 0, 138, 2, + 0, 0, 152, 2, 0, 0, + 0, 2, 0, 0, 5, 0, + 0, 0, 1, 0, 176, 0, + 0, 0, 24, 0, 188, 2, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 176, 0, 0, 0, 77, 105, + 99, 114, 111, 115, 111, 102, + 116, 32, 40, 82, 41, 32, + 72, 76, 83, 76, 32, 83, + 104, 97, 100, 101, 114, 32, + 67, 111, 109, 112, 105, 108, + 101, 114, 32, 54, 46, 51, + 46, 57, 54, 48, 48, 46, + 49, 54, 51, 56, 52, 0, + 171, 171, 73, 83, 71, 78, + 156, 0, 0, 0, 5, 0, + 0, 0, 8, 0, 0, 0, + 128, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 15, 7, 0, 0, + 137, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 1, 0, + 0, 0, 15, 15, 0, 0, + 139, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 2, 0, + 0, 0, 15, 15, 0, 0, + 141, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 3, 0, + 0, 0, 15, 15, 0, 0, + 143, 0, 0, 0, 0, 0, + 0, 0, 6, 0, 0, 0, + 1, 0, 0, 0, 4, 0, + 0, 0, 1, 0, 0, 0, + 80, 79, 83, 73, 84, 73, + 79, 78, 0, 85, 0, 86, + 0, 87, 0, 83, 86, 95, + 86, 101, 114, 116, 101, 120, + 73, 68, 0, 171, 79, 83, + 71, 78, 196, 0, 0, 0, + 7, 0, 0, 0, 8, 0, + 0, 0, 176, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 15, 0, + 0, 0, 185, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 15, 0, + 0, 0, 185, 0, 0, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 2, 0, 0, 0, 15, 0, + 0, 0, 185, 0, 0, 0, + 2, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 3, 0, 0, 0, 15, 0, + 0, 0, 185, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 4, 0, 0, 0, 15, 0, + 0, 0, 185, 0, 0, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 5, 0, 0, 0, 15, 0, + 0, 0, 185, 0, 0, 0, + 5, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 6, 0, 0, 0, 15, 0, + 0, 0, 80, 79, 83, 73, + 84, 73, 79, 78, 0, 84, + 69, 88, 67, 79, 79, 82, + 68, 0, 171, 171, 83, 72, + 69, 88, 52, 11, 0, 0, + 80, 0, 1, 0, 205, 2, + 0, 0, 106, 8, 0, 1, + 89, 0, 0, 4, 70, 142, + 32, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 95, 0, + 0, 3, 114, 16, 16, 0, + 0, 0, 0, 0, 95, 0, + 0, 3, 242, 16, 16, 0, + 1, 0, 0, 0, 95, 0, + 0, 3, 242, 16, 16, 0, + 2, 0, 0, 0, 95, 0, + 0, 3, 242, 16, 16, 0, + 3, 0, 0, 0, 101, 0, + 0, 3, 242, 32, 16, 0, + 0, 0, 0, 0, 101, 0, + 0, 3, 242, 32, 16, 0, + 1, 0, 0, 0, 101, 0, + 0, 3, 242, 32, 16, 0, + 2, 0, 0, 0, 101, 0, + 0, 3, 242, 32, 16, 0, + 3, 0, 0, 0, 101, 0, + 0, 3, 242, 32, 16, 0, + 4, 0, 0, 0, 101, 0, + 0, 3, 242, 32, 16, 0, + 5, 0, 0, 0, 101, 0, + 0, 3, 242, 32, 16, 0, + 6, 0, 0, 0, 104, 0, + 0, 2, 4, 0, 0, 0, + 54, 0, 0, 5, 114, 32, + 16, 0, 0, 0, 0, 0, + 70, 18, 16, 0, 0, 0, + 0, 0, 54, 0, 0, 5, + 130, 32, 16, 0, 0, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 56, 0, + 0, 7, 114, 0, 16, 0, + 0, 0, 0, 0, 246, 31, + 16, 0, 2, 0, 0, 0, + 70, 18, 16, 0, 2, 0, + 0, 0, 56, 0, 0, 8, + 242, 0, 16, 0, 1, 0, + 0, 0, 86, 5, 16, 0, + 0, 0, 0, 0, 54, 132, + 32, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 50, 0, + 0, 10, 242, 0, 16, 0, + 1, 0, 0, 0, 54, 132, + 32, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 6, 0, + 16, 0, 0, 0, 0, 0, + 70, 14, 16, 0, 1, 0, + 0, 0, 50, 0, 0, 10, + 242, 0, 16, 0, 0, 0, + 0, 0, 54, 132, 32, 0, + 0, 0, 0, 0, 2, 0, + 0, 0, 166, 10, 16, 0, + 0, 0, 0, 0, 70, 14, + 16, 0, 1, 0, 0, 0, + 56, 0, 0, 7, 18, 0, + 16, 0, 1, 0, 0, 0, + 58, 0, 16, 0, 0, 0, + 0, 0, 58, 0, 16, 0, + 0, 0, 0, 0, 56, 0, + 0, 7, 242, 0, 16, 0, + 0, 0, 0, 0, 6, 2, + 16, 0, 0, 0, 0, 0, + 70, 14, 16, 0, 0, 0, + 0, 0, 56, 0, 0, 7, + 226, 0, 16, 0, 1, 0, + 0, 0, 246, 31, 16, 0, + 1, 0, 0, 0, 6, 25, + 16, 0, 1, 0, 0, 0, + 56, 0, 0, 8, 242, 0, + 16, 0, 2, 0, 0, 0, + 166, 10, 16, 0, 1, 0, + 0, 0, 54, 132, 32, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 50, 0, 0, 10, + 242, 0, 16, 0, 2, 0, + 0, 0, 54, 132, 32, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 86, 5, 16, 0, + 1, 0, 0, 0, 70, 14, + 16, 0, 2, 0, 0, 0, + 50, 0, 0, 10, 242, 0, + 16, 0, 2, 0, 0, 0, + 54, 132, 32, 0, 0, 0, + 0, 0, 2, 0, 0, 0, + 246, 15, 16, 0, 1, 0, + 0, 0, 70, 14, 16, 0, + 2, 0, 0, 0, 50, 0, + 0, 9, 18, 0, 16, 0, + 1, 0, 0, 0, 58, 0, + 16, 0, 2, 0, 0, 0, + 58, 0, 16, 0, 2, 0, + 0, 0, 10, 0, 16, 0, + 1, 0, 0, 0, 50, 0, + 0, 9, 242, 0, 16, 0, + 0, 0, 0, 0, 70, 14, + 16, 0, 2, 0, 0, 0, + 6, 2, 16, 0, 2, 0, + 0, 0, 70, 14, 16, 0, + 0, 0, 0, 0, 56, 0, + 0, 7, 226, 0, 16, 0, + 1, 0, 0, 0, 246, 31, + 16, 0, 3, 0, 0, 0, + 6, 25, 16, 0, 3, 0, + 0, 0, 56, 0, 0, 8, + 242, 0, 16, 0, 2, 0, + 0, 0, 166, 10, 16, 0, + 1, 0, 0, 0, 54, 132, + 32, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 50, 0, + 0, 10, 242, 0, 16, 0, + 2, 0, 0, 0, 54, 132, + 32, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 86, 5, + 16, 0, 1, 0, 0, 0, + 70, 14, 16, 0, 2, 0, + 0, 0, 50, 0, 0, 10, + 242, 0, 16, 0, 2, 0, + 0, 0, 54, 132, 32, 0, + 0, 0, 0, 0, 2, 0, + 0, 0, 246, 15, 16, 0, + 1, 0, 0, 0, 70, 14, + 16, 0, 2, 0, 0, 0, + 50, 0, 0, 9, 18, 0, + 16, 0, 1, 0, 0, 0, + 58, 0, 16, 0, 2, 0, + 0, 0, 58, 0, 16, 0, + 2, 0, 0, 0, 10, 0, + 16, 0, 1, 0, 0, 0, + 50, 0, 0, 9, 242, 0, + 16, 0, 0, 0, 0, 0, + 70, 14, 16, 0, 2, 0, + 0, 0, 6, 2, 16, 0, + 2, 0, 0, 0, 70, 14, + 16, 0, 0, 0, 0, 0, + 56, 0, 0, 8, 242, 0, + 16, 0, 2, 0, 0, 0, + 86, 21, 16, 0, 0, 0, + 0, 0, 54, 132, 32, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 50, 0, 0, 10, + 242, 0, 16, 0, 2, 0, + 0, 0, 54, 132, 32, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 6, 16, 16, 0, + 0, 0, 0, 0, 70, 14, + 16, 0, 2, 0, 0, 0, + 50, 0, 0, 10, 242, 0, + 16, 0, 2, 0, 0, 0, + 54, 132, 32, 0, 0, 0, + 0, 0, 2, 0, 0, 0, + 166, 26, 16, 0, 0, 0, + 0, 0, 70, 14, 16, 0, + 2, 0, 0, 0, 0, 0, + 0, 8, 242, 0, 16, 0, + 2, 0, 0, 0, 70, 14, + 16, 0, 2, 0, 0, 0, + 54, 132, 32, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 50, 0, 0, 10, 18, 0, + 16, 0, 1, 0, 0, 0, + 58, 0, 16, 128, 65, 0, + 0, 0, 2, 0, 0, 0, + 58, 0, 16, 0, 2, 0, + 0, 0, 10, 0, 16, 0, + 1, 0, 0, 0, 50, 0, + 0, 10, 242, 0, 16, 0, + 0, 0, 0, 0, 70, 14, + 16, 128, 65, 0, 0, 0, + 2, 0, 0, 0, 6, 2, + 16, 0, 2, 0, 0, 0, + 70, 14, 16, 0, 0, 0, + 0, 0, 56, 0, 0, 10, + 226, 0, 16, 0, 1, 0, + 0, 0, 86, 12, 16, 0, + 0, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 192, 0, 0, + 128, 64, 0, 0, 0, 192, + 56, 0, 0, 7, 50, 0, + 16, 0, 2, 0, 0, 0, + 214, 5, 16, 0, 1, 0, + 0, 0, 214, 5, 16, 0, + 1, 0, 0, 0, 50, 0, + 0, 10, 34, 0, 16, 0, + 2, 0, 0, 0, 42, 0, + 16, 128, 65, 0, 0, 0, + 1, 0, 0, 0, 10, 0, + 16, 0, 1, 0, 0, 0, + 26, 0, 16, 0, 2, 0, + 0, 0, 50, 0, 0, 10, + 66, 0, 16, 0, 1, 0, + 0, 0, 42, 0, 16, 128, + 65, 0, 0, 0, 1, 0, + 0, 0, 42, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 2, 0, 0, 0, + 75, 0, 0, 5, 18, 0, + 16, 0, 2, 0, 0, 0, + 26, 0, 16, 0, 2, 0, + 0, 0, 29, 0, 0, 7, + 34, 0, 16, 0, 2, 0, + 0, 0, 26, 0, 16, 0, + 2, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 0, + 49, 0, 0, 10, 194, 0, + 16, 0, 2, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 128, 0, 0, + 0, 128, 86, 13, 16, 0, + 0, 0, 0, 0, 55, 0, + 0, 15, 194, 0, 16, 0, + 2, 0, 0, 0, 166, 14, + 16, 0, 2, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 128, 191, 0, 0, + 128, 191, 2, 64, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 128, 63, + 0, 0, 128, 63, 50, 0, + 0, 9, 130, 0, 16, 0, + 1, 0, 0, 0, 58, 0, + 16, 0, 2, 0, 0, 0, + 10, 0, 16, 0, 2, 0, + 0, 0, 58, 0, 16, 0, + 1, 0, 0, 0, 56, 0, + 0, 7, 130, 0, 16, 0, + 1, 0, 0, 0, 58, 0, + 16, 0, 1, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 0, 191, 14, 0, 0, 7, + 130, 0, 16, 0, 3, 0, + 0, 0, 58, 0, 16, 0, + 1, 0, 0, 0, 10, 0, + 16, 0, 0, 0, 0, 0, + 14, 0, 0, 7, 66, 0, + 16, 0, 3, 0, 0, 0, + 10, 0, 16, 0, 1, 0, + 0, 0, 58, 0, 16, 0, + 1, 0, 0, 0, 49, 0, + 0, 7, 18, 0, 16, 0, + 1, 0, 0, 0, 42, 0, + 16, 0, 3, 0, 0, 0, + 58, 0, 16, 0, 3, 0, + 0, 0, 55, 0, 0, 9, + 146, 0, 16, 0, 1, 0, + 0, 0, 6, 0, 16, 0, + 1, 0, 0, 0, 166, 14, + 16, 0, 3, 0, 0, 0, + 246, 11, 16, 0, 3, 0, + 0, 0, 1, 0, 0, 7, + 146, 0, 16, 0, 1, 0, + 0, 0, 6, 12, 16, 0, + 1, 0, 0, 0, 86, 5, + 16, 0, 2, 0, 0, 0, + 24, 0, 0, 10, 178, 0, + 16, 0, 2, 0, 0, 0, + 70, 12, 16, 0, 0, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 128, 0, 0, 0, 0, + 0, 0, 0, 128, 1, 0, + 0, 7, 162, 0, 16, 0, + 0, 0, 0, 0, 86, 13, + 16, 0, 2, 0, 0, 0, + 6, 0, 16, 0, 2, 0, + 0, 0, 55, 0, 0, 12, + 194, 32, 16, 0, 1, 0, + 0, 0, 246, 15, 16, 0, + 0, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 6, 12, 16, 0, 1, 0, + 0, 0, 75, 0, 0, 5, + 130, 0, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 1, 0, 0, 0, 29, 0, + 0, 7, 18, 0, 16, 0, + 1, 0, 0, 0, 42, 0, + 16, 0, 1, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 0, 0, 50, 0, 0, 9, + 130, 0, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 2, 0, 0, 0, 58, 0, + 16, 0, 0, 0, 0, 0, + 26, 0, 16, 0, 1, 0, + 0, 0, 56, 0, 0, 7, + 130, 0, 16, 0, 0, 0, + 0, 0, 58, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 191, + 14, 0, 0, 7, 50, 0, + 16, 0, 2, 0, 0, 0, + 230, 10, 16, 0, 0, 0, + 0, 0, 54, 15, 16, 0, + 0, 0, 0, 0, 49, 0, + 0, 7, 18, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 2, 0, 0, 0, + 26, 0, 16, 0, 2, 0, + 0, 0, 55, 0, 0, 9, + 82, 0, 16, 0, 0, 0, + 0, 0, 6, 0, 16, 0, + 0, 0, 0, 0, 6, 1, + 16, 0, 2, 0, 0, 0, + 86, 4, 16, 0, 2, 0, + 0, 0, 1, 0, 0, 7, + 82, 0, 16, 0, 0, 0, + 0, 0, 6, 2, 16, 0, + 0, 0, 0, 0, 6, 0, + 16, 0, 1, 0, 0, 0, + 55, 0, 0, 12, 50, 32, + 16, 0, 1, 0, 0, 0, + 86, 5, 16, 0, 0, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 134, 0, + 16, 0, 0, 0, 0, 0, + 54, 0, 0, 7, 130, 32, + 16, 0, 2, 0, 0, 0, + 58, 128, 32, 128, 65, 0, + 0, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 14, 0, + 0, 7, 114, 0, 16, 0, + 0, 0, 0, 0, 70, 18, + 16, 0, 1, 0, 0, 0, + 246, 31, 16, 0, 1, 0, + 0, 0, 16, 0, 0, 7, + 130, 0, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 70, 18, + 16, 0, 0, 0, 0, 0, + 54, 0, 0, 6, 130, 0, + 16, 0, 0, 0, 0, 0, + 58, 0, 16, 128, 65, 0, + 0, 0, 0, 0, 0, 0, + 17, 0, 0, 8, 18, 32, + 16, 0, 2, 0, 0, 0, + 70, 14, 16, 0, 0, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 12, 0, + 0, 0, 14, 0, 0, 7, + 114, 0, 16, 0, 1, 0, + 0, 0, 70, 18, 16, 0, + 2, 0, 0, 0, 246, 31, + 16, 0, 2, 0, 0, 0, + 16, 0, 0, 7, 130, 0, + 16, 0, 1, 0, 0, 0, + 70, 2, 16, 0, 1, 0, + 0, 0, 70, 18, 16, 0, + 0, 0, 0, 0, 54, 0, + 0, 6, 130, 0, 16, 0, + 1, 0, 0, 0, 58, 0, + 16, 128, 65, 0, 0, 0, + 1, 0, 0, 0, 17, 0, + 0, 8, 34, 32, 16, 0, + 2, 0, 0, 0, 70, 14, + 16, 0, 1, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 12, 0, 0, 0, + 14, 0, 0, 7, 114, 0, + 16, 0, 2, 0, 0, 0, + 70, 18, 16, 0, 3, 0, + 0, 0, 246, 31, 16, 0, + 3, 0, 0, 0, 16, 0, + 0, 7, 130, 0, 16, 0, + 2, 0, 0, 0, 70, 2, + 16, 0, 2, 0, 0, 0, + 70, 18, 16, 0, 0, 0, + 0, 0, 54, 0, 0, 6, + 130, 0, 16, 0, 2, 0, + 0, 0, 58, 0, 16, 128, + 65, 0, 0, 0, 2, 0, + 0, 0, 17, 0, 0, 8, + 66, 32, 16, 0, 2, 0, + 0, 0, 70, 14, 16, 0, + 2, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 54, 0, + 0, 7, 130, 32, 16, 0, + 3, 0, 0, 0, 58, 128, + 32, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 13, 0, + 0, 0, 17, 0, 0, 8, + 18, 32, 16, 0, 3, 0, + 0, 0, 70, 14, 16, 0, + 0, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 17, 0, + 0, 8, 34, 32, 16, 0, + 3, 0, 0, 0, 70, 14, + 16, 0, 1, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 13, 0, 0, 0, + 17, 0, 0, 8, 66, 32, + 16, 0, 3, 0, 0, 0, + 70, 14, 16, 0, 2, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 13, 0, + 0, 0, 17, 0, 0, 8, + 18, 32, 16, 0, 4, 0, + 0, 0, 70, 14, 16, 0, + 0, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 14, 0, 0, 0, 17, 0, + 0, 8, 18, 32, 16, 0, + 5, 0, 0, 0, 70, 14, + 16, 0, 0, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 15, 0, 0, 0, + 17, 0, 0, 8, 34, 32, + 16, 0, 4, 0, 0, 0, + 70, 14, 16, 0, 1, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 14, 0, + 0, 0, 17, 0, 0, 8, + 34, 32, 16, 0, 5, 0, + 0, 0, 70, 14, 16, 0, + 1, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 17, 0, + 0, 8, 66, 32, 16, 0, + 4, 0, 0, 0, 70, 14, + 16, 0, 2, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 14, 0, 0, 0, + 17, 0, 0, 8, 66, 32, + 16, 0, 5, 0, 0, 0, + 70, 14, 16, 0, 2, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 15, 0, + 0, 0, 54, 0, 0, 7, + 130, 32, 16, 0, 4, 0, + 0, 0, 58, 128, 32, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 14, 0, 0, 0, + 54, 0, 0, 7, 130, 32, + 16, 0, 5, 0, 0, 0, + 58, 128, 32, 128, 65, 0, + 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 56, 0, + 0, 8, 242, 0, 16, 0, + 0, 0, 0, 0, 86, 21, + 16, 0, 0, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 50, 0, 0, 10, 242, 0, + 16, 0, 0, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 6, 16, 16, 0, 0, 0, + 0, 0, 70, 14, 16, 0, + 0, 0, 0, 0, 50, 0, + 0, 10, 242, 0, 16, 0, + 0, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 166, 26, + 16, 0, 0, 0, 0, 0, + 70, 14, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 8, + 242, 0, 16, 0, 0, 0, + 0, 0, 70, 14, 16, 0, + 0, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 14, 0, + 0, 7, 242, 32, 16, 0, + 6, 0, 0, 0, 70, 14, + 16, 0, 0, 0, 0, 0, + 246, 15, 16, 0, 0, 0, + 0, 0, 62, 0, 0, 1, + 83, 84, 65, 84, 148, 0, + 0, 0, 84, 0, 0, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 11, 0, 0, 0, + 70, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 5, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0 +}; diff --git a/demo/d3d/shaders/imguiPS.hlsl b/demo/d3d/shaders/imguiPS.hlsl new file mode 100644 index 0000000..f51a21b --- /dev/null +++ b/demo/d3d/shaders/imguiPS.hlsl @@ -0,0 +1,22 @@ + +struct Input +{ + float4 position : SV_POSITION; + float2 texCoord : TEXCOORD; + float4 color : COLOR; +}; + +Texture2D<float> tex : register(t0); +SamplerState texSampler : register(s0); + +float4 imguiPS(Input input) : SV_TARGET +{ + float4 color = input.color; + + if (input.texCoord.x >= 0.f) + { + color.a *= tex.SampleLevel(texSampler, input.texCoord, 0.f); + } + + return color; +}
\ No newline at end of file diff --git a/demo/d3d/shaders/imguiPS.hlsl.h b/demo/d3d/shaders/imguiPS.hlsl.h new file mode 100644 index 0000000..92aa84a --- /dev/null +++ b/demo/d3d/shaders/imguiPS.hlsl.h @@ -0,0 +1,197 @@ +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// Resource Bindings: +// +// Name Type Format Dim Slot Elements +// ------------------------------ ---------- ------- ----------- ---- -------- +// texSampler sampler NA NA 0 1 +// tex texture float 2d 0 1 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_POSITION 0 xyzw 0 POS float +// TEXCOORD 0 xy 1 NONE float xy +// COLOR 0 xyzw 2 NONE float xyzw +// +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_TARGET 0 xyzw 0 TARGET float xyzw +// +ps_5_0 +dcl_globalFlags refactoringAllowed +dcl_sampler s0, mode_default +dcl_resource_texture2d (float,float,float,float) t0 +dcl_input_ps linear v1.xy +dcl_input_ps linear v2.xyzw +dcl_output o0.xyzw +dcl_temps 1 +ge r0.x, v1.x, l(0.000000) +if_nz r0.x + sample_l_indexable(texture2d)(float,float,float,float) r0.x, v1.xyxx, t0.xyzw, s0, l(0.000000) + mul r0.x, r0.x, v2.w +else + mov r0.x, v2.w +endif +mov r0.yzw, v2.xxyz +mov o0.xyzw, r0.yzwx +ret +// Approximately 10 instruction slots used +#endif + +const BYTE g_imguiPS[] = +{ + 68, 88, 66, 67, 214, 230, + 179, 60, 250, 108, 227, 78, + 125, 188, 145, 68, 25, 248, + 141, 62, 1, 0, 0, 0, + 92, 3, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, + 252, 0, 0, 0, 112, 1, + 0, 0, 164, 1, 0, 0, + 192, 2, 0, 0, 82, 68, + 69, 70, 192, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 2, 0, 0, 0, + 60, 0, 0, 0, 0, 5, + 255, 255, 0, 1, 0, 0, + 139, 0, 0, 0, 82, 68, + 49, 49, 60, 0, 0, 0, + 24, 0, 0, 0, 32, 0, + 0, 0, 40, 0, 0, 0, + 36, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 124, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 1, 0, + 0, 0, 135, 0, 0, 0, + 2, 0, 0, 0, 5, 0, + 0, 0, 4, 0, 0, 0, + 255, 255, 255, 255, 0, 0, + 0, 0, 1, 0, 0, 0, + 1, 0, 0, 0, 116, 101, + 120, 83, 97, 109, 112, 108, + 101, 114, 0, 116, 101, 120, + 0, 77, 105, 99, 114, 111, + 115, 111, 102, 116, 32, 40, + 82, 41, 32, 72, 76, 83, + 76, 32, 83, 104, 97, 100, + 101, 114, 32, 67, 111, 109, + 112, 105, 108, 101, 114, 32, + 54, 46, 51, 46, 57, 54, + 48, 48, 46, 49, 54, 51, + 56, 52, 0, 171, 171, 171, + 73, 83, 71, 78, 108, 0, + 0, 0, 3, 0, 0, 0, + 8, 0, 0, 0, 80, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 92, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 1, 0, 0, 0, + 3, 3, 0, 0, 101, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 2, 0, 0, 0, + 15, 15, 0, 0, 83, 86, + 95, 80, 79, 83, 73, 84, + 73, 79, 78, 0, 84, 69, + 88, 67, 79, 79, 82, 68, + 0, 67, 79, 76, 79, 82, + 0, 171, 79, 83, 71, 78, + 44, 0, 0, 0, 1, 0, + 0, 0, 8, 0, 0, 0, + 32, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 15, 0, 0, 0, + 83, 86, 95, 84, 65, 82, + 71, 69, 84, 0, 171, 171, + 83, 72, 69, 88, 20, 1, + 0, 0, 80, 0, 0, 0, + 69, 0, 0, 0, 106, 8, + 0, 1, 90, 0, 0, 3, + 0, 96, 16, 0, 0, 0, + 0, 0, 88, 24, 0, 4, + 0, 112, 16, 0, 0, 0, + 0, 0, 85, 85, 0, 0, + 98, 16, 0, 3, 50, 16, + 16, 0, 1, 0, 0, 0, + 98, 16, 0, 3, 242, 16, + 16, 0, 2, 0, 0, 0, + 101, 0, 0, 3, 242, 32, + 16, 0, 0, 0, 0, 0, + 104, 0, 0, 2, 1, 0, + 0, 0, 29, 0, 0, 7, + 18, 0, 16, 0, 0, 0, + 0, 0, 10, 16, 16, 0, + 1, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 0, + 31, 0, 4, 3, 10, 0, + 16, 0, 0, 0, 0, 0, + 72, 0, 0, 141, 194, 0, + 0, 128, 67, 85, 21, 0, + 18, 0, 16, 0, 0, 0, + 0, 0, 70, 16, 16, 0, + 1, 0, 0, 0, 70, 126, + 16, 0, 0, 0, 0, 0, + 0, 96, 16, 0, 0, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 0, 0, 56, 0, + 0, 7, 18, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 0, 0, 0, 0, + 58, 16, 16, 0, 2, 0, + 0, 0, 18, 0, 0, 1, + 54, 0, 0, 5, 18, 0, + 16, 0, 0, 0, 0, 0, + 58, 16, 16, 0, 2, 0, + 0, 0, 21, 0, 0, 1, + 54, 0, 0, 5, 226, 0, + 16, 0, 0, 0, 0, 0, + 6, 25, 16, 0, 2, 0, + 0, 0, 54, 0, 0, 5, + 242, 32, 16, 0, 0, 0, + 0, 0, 150, 3, 16, 0, + 0, 0, 0, 0, 62, 0, + 0, 1, 83, 84, 65, 84, + 148, 0, 0, 0, 10, 0, + 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 2, 0, 0, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0 +}; diff --git a/demo/d3d/shaders/imguiVS.hlsl b/demo/d3d/shaders/imguiVS.hlsl new file mode 100644 index 0000000..6116ee1 --- /dev/null +++ b/demo/d3d/shaders/imguiVS.hlsl @@ -0,0 +1,31 @@ + +cbuffer params : register(b0) +{ + float4x4 transform; +}; + +struct Input +{ + float2 position : POSITION; + float2 texCoord : TEXCOORD; + float4 color : COLOR; +}; + +struct Output +{ + float4 position : SV_POSITION; + float2 texCoord : TEXCOORD; + float4 color : COLOR; +}; + +Output imguiVS(Input input, uint instance : SV_InstanceID) +{ + Output output; + + output.position = mul(float4(input.position, 0.f, 1.f), transform); + + output.texCoord = input.texCoord.xy; // float2(input.texCoord.x, 1.f - input.texCoord.y); + output.color = input.color; + + return output; +}
\ No newline at end of file diff --git a/demo/d3d/shaders/imguiVS.hlsl.h b/demo/d3d/shaders/imguiVS.hlsl.h new file mode 100644 index 0000000..7249cec --- /dev/null +++ b/demo/d3d/shaders/imguiVS.hlsl.h @@ -0,0 +1,248 @@ +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// Buffer Definitions: +// +// cbuffer params +// { +// +// float4x4 transform; // Offset: 0 Size: 64 +// +// } +// +// +// Resource Bindings: +// +// Name Type Format Dim Slot Elements +// ------------------------------ ---------- ------- ----------- ---- -------- +// params cbuffer NA NA 0 1 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// POSITION 0 xy 0 NONE float xy +// TEXCOORD 0 xy 1 NONE float xy +// COLOR 0 xyzw 2 NONE float xyzw +// SV_InstanceID 0 x 3 INSTID uint +// +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_POSITION 0 xyzw 0 POS float xyzw +// TEXCOORD 0 xy 1 NONE float xy +// COLOR 0 xyzw 2 NONE float xyzw +// +vs_5_0 +dcl_globalFlags refactoringAllowed +dcl_constantbuffer cb0[4], immediateIndexed +dcl_input v0.xy +dcl_input v1.xy +dcl_input v2.xyzw +dcl_output_siv o0.xyzw, position +dcl_output o1.xy +dcl_output o2.xyzw +dcl_temps 1 +mov r0.xy, v0.xyxx +mov r0.z, l(1.000000) +dp3 o0.x, r0.xyzx, cb0[0].xywx +dp3 o0.y, r0.xyzx, cb0[1].xywx +dp3 o0.z, r0.xyzx, cb0[2].xywx +dp3 o0.w, r0.xyzx, cb0[3].xywx +mov o1.xy, v1.xyxx +mov o2.xyzw, v2.xyzw +ret +// Approximately 9 instruction slots used +#endif + +const BYTE g_imguiVS[] = +{ + 68, 88, 66, 67, 11, 92, + 70, 30, 32, 80, 66, 187, + 246, 56, 106, 189, 128, 201, + 215, 197, 1, 0, 0, 0, + 64, 4, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, + 76, 1, 0, 0, 228, 1, + 0, 0, 88, 2, 0, 0, + 164, 3, 0, 0, 82, 68, + 69, 70, 16, 1, 0, 0, + 1, 0, 0, 0, 100, 0, + 0, 0, 1, 0, 0, 0, + 60, 0, 0, 0, 0, 5, + 254, 255, 0, 1, 0, 0, + 220, 0, 0, 0, 82, 68, + 49, 49, 60, 0, 0, 0, + 24, 0, 0, 0, 32, 0, + 0, 0, 40, 0, 0, 0, + 36, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 1, 0, + 0, 0, 112, 97, 114, 97, + 109, 115, 0, 171, 92, 0, + 0, 0, 1, 0, 0, 0, + 124, 0, 0, 0, 64, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 164, 0, + 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 2, 0, + 0, 0, 184, 0, 0, 0, + 0, 0, 0, 0, 255, 255, + 255, 255, 0, 0, 0, 0, + 255, 255, 255, 255, 0, 0, + 0, 0, 116, 114, 97, 110, + 115, 102, 111, 114, 109, 0, + 102, 108, 111, 97, 116, 52, + 120, 52, 0, 171, 3, 0, + 3, 0, 4, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 174, 0, 0, 0, 77, 105, + 99, 114, 111, 115, 111, 102, + 116, 32, 40, 82, 41, 32, + 72, 76, 83, 76, 32, 83, + 104, 97, 100, 101, 114, 32, + 67, 111, 109, 112, 105, 108, + 101, 114, 32, 54, 46, 51, + 46, 57, 54, 48, 48, 46, + 49, 54, 51, 56, 52, 0, + 171, 171, 73, 83, 71, 78, + 144, 0, 0, 0, 4, 0, + 0, 0, 8, 0, 0, 0, + 104, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 3, 3, 0, 0, + 113, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 1, 0, + 0, 0, 3, 3, 0, 0, + 122, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 2, 0, + 0, 0, 15, 15, 0, 0, + 128, 0, 0, 0, 0, 0, + 0, 0, 8, 0, 0, 0, + 1, 0, 0, 0, 3, 0, + 0, 0, 1, 0, 0, 0, + 80, 79, 83, 73, 84, 73, + 79, 78, 0, 84, 69, 88, + 67, 79, 79, 82, 68, 0, + 67, 79, 76, 79, 82, 0, + 83, 86, 95, 73, 110, 115, + 116, 97, 110, 99, 101, 73, + 68, 0, 171, 171, 79, 83, + 71, 78, 108, 0, 0, 0, + 3, 0, 0, 0, 8, 0, + 0, 0, 80, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 15, 0, + 0, 0, 92, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 3, 12, + 0, 0, 101, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 2, 0, 0, 0, 15, 0, + 0, 0, 83, 86, 95, 80, + 79, 83, 73, 84, 73, 79, + 78, 0, 84, 69, 88, 67, + 79, 79, 82, 68, 0, 67, + 79, 76, 79, 82, 0, 171, + 83, 72, 69, 88, 68, 1, + 0, 0, 80, 0, 1, 0, + 81, 0, 0, 0, 106, 8, + 0, 1, 89, 0, 0, 4, + 70, 142, 32, 0, 0, 0, + 0, 0, 4, 0, 0, 0, + 95, 0, 0, 3, 50, 16, + 16, 0, 0, 0, 0, 0, + 95, 0, 0, 3, 50, 16, + 16, 0, 1, 0, 0, 0, + 95, 0, 0, 3, 242, 16, + 16, 0, 2, 0, 0, 0, + 103, 0, 0, 4, 242, 32, + 16, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 101, 0, + 0, 3, 50, 32, 16, 0, + 1, 0, 0, 0, 101, 0, + 0, 3, 242, 32, 16, 0, + 2, 0, 0, 0, 104, 0, + 0, 2, 1, 0, 0, 0, + 54, 0, 0, 5, 50, 0, + 16, 0, 0, 0, 0, 0, + 70, 16, 16, 0, 0, 0, + 0, 0, 54, 0, 0, 5, + 66, 0, 16, 0, 0, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 16, 0, + 0, 8, 18, 32, 16, 0, + 0, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 70, 131, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 16, 0, 0, 8, 34, 32, + 16, 0, 0, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 70, 131, 32, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 16, 0, 0, 8, + 66, 32, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 70, 131, + 32, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 16, 0, + 0, 8, 130, 32, 16, 0, + 0, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 70, 131, 32, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 54, 0, 0, 5, 50, 32, + 16, 0, 1, 0, 0, 0, + 70, 16, 16, 0, 1, 0, + 0, 0, 54, 0, 0, 5, + 242, 32, 16, 0, 2, 0, + 0, 0, 70, 30, 16, 0, + 2, 0, 0, 0, 62, 0, + 0, 1, 83, 84, 65, 84, + 148, 0, 0, 0, 9, 0, + 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 6, 0, + 0, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0 +}; diff --git a/demo/d3d/shaders/meshAsyncComputeBenchPS.hlsl b/demo/d3d/shaders/meshAsyncComputeBenchPS.hlsl new file mode 100644 index 0000000..1d8b9d5 --- /dev/null +++ b/demo/d3d/shaders/meshAsyncComputeBenchPS.hlsl @@ -0,0 +1,3 @@ +#define FLX_ASYNC_COMPUTE_BENCHMARK_ENABLE 1 + +#include "meshPS.hlsl" diff --git a/demo/d3d/shaders/meshAsyncComputeBenchPS.hlsl.h b/demo/d3d/shaders/meshAsyncComputeBenchPS.hlsl.h new file mode 100644 index 0000000..8223a67 --- /dev/null +++ b/demo/d3d/shaders/meshAsyncComputeBenchPS.hlsl.h @@ -0,0 +1,1558 @@ +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// Buffer Definitions: +// +// cbuffer constBuf +// { +// +// struct MeshShaderConst +// { +// +// float4x4 modelViewProjection; // Offset: 0 +// float4x4 modelView; // Offset: 64 +// float4x4 objectTransform; // Offset: 128 +// float4x4 lightTransform; // Offset: 192 +// float4 clipPlane; // Offset: 256 +// float4 fogColor; // Offset: 272 +// float4 color; // Offset: 288 +// float4 secondaryColor; // Offset: 304 +// float4 shadowTaps[12]; // Offset: 320 +// float3 lightPos; // Offset: 512 +// float _pad0; // Offset: 524 +// float3 lightDir; // Offset: 528 +// float _pad1; // Offset: 540 +// float bias; // Offset: 544 +// float expand; // Offset: 548 +// float spotMin; // Offset: 552 +// float spotMax; // Offset: 556 +// int grid; // Offset: 560 +// int tex; // Offset: 564 +// int colorArray; // Offset: 568 +// int increaseGfxLoadForAsyncComputeTesting;// Offset: 572 +// +// } gParams; // Offset: 0 Size: 576 +// +// } +// +// +// Resource Bindings: +// +// Name Type Format Dim Slot Elements +// ------------------------------ ---------- ------- ----------- ---- -------- +// shadowSampler sampler_c NA NA 0 1 +// shadowTexture texture float 2d 0 1 +// constBuf cbuffer NA NA 0 1 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_POSITION 0 xyzw 0 POS float +// TEXCOORD 0 xyz 1 NONE float xyz +// TEXCOORD 1 xyzw 2 NONE float xyzw +// TEXCOORD 2 xyz 3 NONE float +// TEXCOORD 3 xyz 4 NONE float xyz +// TEXCOORD 4 xyzw 5 NONE float xyz +// TEXCOORD 5 xy 6 NONE float +// TEXCOORD 6 xyzw 7 NONE float xyz +// TEXCOORD 7 xyzw 8 NONE float z +// SV_IsFrontFace 0 x 9 FFACE uint x +// +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_TARGET 0 xyzw 0 TARGET float xyzw +// +ps_5_0 +dcl_globalFlags refactoringAllowed +dcl_constantbuffer cb0[36], immediateIndexed +dcl_sampler s0, mode_comparison +dcl_resource_texture2d (float,float,float,float) t0 +dcl_input_ps linear v1.xyz +dcl_input_ps linear v2.xyzw +dcl_input_ps linear v4.xyz +dcl_input_ps linear v5.xyz +dcl_input_ps linear v7.xyz +dcl_input_ps linear v8.z +dcl_input_ps_sgv v9.x, is_front_face +dcl_output o0.xyzw +dcl_temps 6 +div r0.xyz, v2.xyzx, v2.wwww +mad r1.xyz, r0.xyzx, l(0.500000, 0.500000, 1.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000) +lt r0.z, r1.x, l(0.000000) +lt r0.w, l(1.000000), r1.x +or r0.z, r0.w, r0.z +add r0.w, -cb0[20].y, l(1.000000) +mul r2.x, cb0[20].x, l(0.002000) +mul r2.y, r0.w, l(0.002000) +add r1.w, -r1.y, l(1.000000) +add r2.xy, r1.xwxx, r2.xyxx +sample_c_indexable(texture2d)(float,float,float,float) r0.w, r2.xyxx, t0.xxxx, s0, r1.z +add r2.x, -cb0[21].y, l(1.000000) +mul r3.x, cb0[21].x, l(0.002000) +mul r3.y, r2.x, l(0.002000) +add r2.xy, r1.xwxx, r3.xyxx +sample_c_indexable(texture2d)(float,float,float,float) r2.x, r2.xyxx, t0.xxxx, s0, r1.z +add r2.y, -cb0[22].y, l(1.000000) +mul r3.x, cb0[22].x, l(0.002000) +mul r3.y, r2.y, l(0.002000) +add r2.yz, r1.xxwx, r3.xxyx +sample_c_indexable(texture2d)(float,float,float,float) r2.y, r2.yzyy, t0.xxxx, s0, r1.z +add r2.z, -cb0[23].y, l(1.000000) +mul r3.x, cb0[23].x, l(0.002000) +mul r3.y, r2.z, l(0.002000) +add r2.zw, r1.xxxw, r3.xxxy +sample_c_indexable(texture2d)(float,float,float,float) r2.z, r2.zwzz, t0.xxxx, s0, r1.z +add r2.w, -cb0[24].y, l(1.000000) +mul r3.x, cb0[24].x, l(0.002000) +mul r3.y, r2.w, l(0.002000) +add r3.xy, r1.xwxx, r3.xyxx +sample_c_indexable(texture2d)(float,float,float,float) r2.w, r3.xyxx, t0.xxxx, s0, r1.z +add r3.x, -cb0[25].y, l(1.000000) +mul r4.x, cb0[25].x, l(0.002000) +mul r4.y, r3.x, l(0.002000) +add r3.xy, r1.xwxx, r4.xyxx +sample_c_indexable(texture2d)(float,float,float,float) r3.x, r3.xyxx, t0.xxxx, s0, r1.z +add r3.y, -cb0[26].y, l(1.000000) +mul r4.x, cb0[26].x, l(0.002000) +mul r4.y, r3.y, l(0.002000) +add r3.yz, r1.xxwx, r4.xxyx +sample_c_indexable(texture2d)(float,float,float,float) r3.y, r3.yzyy, t0.xxxx, s0, r1.z +add r3.z, -cb0[27].y, l(1.000000) +mul r4.x, cb0[27].x, l(0.002000) +mul r4.y, r3.z, l(0.002000) +add r3.zw, r1.xxxw, r4.xxxy +sample_c_indexable(texture2d)(float,float,float,float) r3.z, r3.zwzz, t0.xxxx, s0, r1.z +add r3.w, -cb0[28].y, l(1.000000) +mul r4.x, cb0[28].x, l(0.002000) +mul r4.y, r3.w, l(0.002000) +add r4.xy, r1.xwxx, r4.xyxx +sample_c_indexable(texture2d)(float,float,float,float) r3.w, r4.xyxx, t0.xxxx, s0, r1.z +add r4.x, -cb0[29].y, l(1.000000) +mul r5.x, cb0[29].x, l(0.002000) +mul r5.y, r4.x, l(0.002000) +add r4.xy, r1.xwxx, r5.xyxx +sample_c_indexable(texture2d)(float,float,float,float) r4.x, r4.xyxx, t0.xxxx, s0, r1.z +add r4.y, -cb0[30].y, l(1.000000) +mul r5.x, cb0[30].x, l(0.002000) +mul r5.y, r4.y, l(0.002000) +add r4.yz, r1.xxwx, r5.xxyx +sample_c_indexable(texture2d)(float,float,float,float) r4.y, r4.yzyy, t0.xxxx, s0, r1.z +add r4.z, -cb0[31].y, l(1.000000) +mul r5.x, cb0[31].x, l(0.002000) +mul r5.y, r4.z, l(0.002000) +add r1.xw, r1.xxxw, r5.xxxy +sample_c_indexable(texture2d)(float,float,float,float) r1.x, r1.xwxx, t0.xxxx, s0, r1.z +if_z r0.z + lt r0.z, r1.y, l(0.000000) + lt r1.y, l(1.000000), r1.y + or r0.z, r0.z, r1.y + if_z r0.z + add r0.z, r0.w, r2.x + add r0.z, r2.y, r0.z + add r0.z, r2.z, r0.z + add r0.z, r2.w, r0.z + add r0.z, r3.x, r0.z + add r0.z, r3.y, r0.z + add r0.z, r3.z, r0.z + add r0.z, r3.w, r0.z + add r0.z, r4.x, r0.z + add r0.z, r4.y, r0.z + add r0.z, r1.x, r0.z + mul r0.z, r0.z, l(0.083333) + else + mov r0.z, l(1.000000) + endif +else + mov r0.z, l(1.000000) +endif +dp2 r0.x, r0.xyxx, r0.xyxx +add r0.y, -cb0[34].w, cb0[34].z +add r0.x, r0.x, -cb0[34].w +div r0.y, l(1.000000, 1.000000, 1.000000, 1.000000), r0.y +mul_sat r0.x, r0.y, r0.x +mad r0.y, r0.x, l(-2.000000), l(3.000000) +mul r0.x, r0.x, r0.x +mul r0.x, r0.x, r0.y +max r0.xz, r0.xxzx, l(0.050000, 0.000000, 0.500000, 0.000000) +movc r1.xyz, v9.xxxx, v1.xyzx, -v1.xyzx +movc r2.xyz, v9.xxxx, v5.xyzx, v7.xyzx +ine r0.y, cb0[35].x, l(0) +lt r0.w, l(0.995000), r1.y +and r0.w, r0.w, r0.y +if_nz r0.w + deriv_rtx_coarse r3.xy, v4.xzxx + deriv_rty_coarse r3.zw, v4.xxxz + max r3.xy, |r3.zwzz|, |r3.xyxx| + max r0.w, r3.y, r3.x + mad r3.xy, -r0.wwww, l(0.500000, 0.500000, 0.000000, 0.000000), v4.xzxx + mad r3.zw, r0.wwww, l(0.000000, 0.000000, 0.500000, 0.500000), v4.xxxz + mul r4.xy, r3.zwzz, l(0.500000, 0.500000, 0.000000, 0.000000) + round_ni r4.xy, r4.xyxx + mad r3.zw, r3.zzzw, l(0.000000, 0.000000, 0.500000, 0.500000), -r4.xxxy + add r3.zw, r3.zzzw, l(0.000000, 0.000000, -0.500000, -0.500000) + max r3.zw, r3.zzzw, l(0.000000, 0.000000, 0.000000, 0.000000) + mad r3.zw, r3.zzzw, l(0.000000, 0.000000, 2.000000, 2.000000), r4.xxxy + mul r4.xy, r3.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000) + round_ni r4.xy, r4.xyxx + mad r3.xy, r3.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000), -r4.xyxx + add r3.xy, r3.xyxx, l(-0.500000, -0.500000, 0.000000, 0.000000) + max r3.xy, r3.xyxx, l(0.000000, 0.000000, 0.000000, 0.000000) + mad r3.xy, r3.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), r4.xyxx + add r3.xy, -r3.xyxx, r3.zwzz + div r3.xy, r3.xyxx, r0.wwww + add r3.zw, -r3.xxxy, l(0.000000, 0.000000, 1.000000, 1.000000) + mul r0.w, r3.w, r3.z + mad r0.w, r3.x, r3.y, r0.w + mad r0.w, -r0.w, l(0.250000), l(1.000000) + mul r3.xyz, r0.wwww, r2.xyzx +else + lt r0.w, l(0.995000), |r1.z| + and r0.y, r0.w, r0.y + deriv_rtx_coarse r4.xy, v4.yxyy + deriv_rty_coarse r4.zw, v4.yyyx + max r4.xy, |r4.zwzz|, |r4.xyxx| + max r0.w, r4.y, r4.x + mad r4.xy, -r0.wwww, l(0.500000, 0.500000, 0.000000, 0.000000), v4.yxyy + mad r4.zw, r0.wwww, l(0.000000, 0.000000, 0.500000, 0.500000), v4.yyyx + mul r5.xy, r4.zwzz, l(0.500000, 0.500000, 0.000000, 0.000000) + round_ni r5.xy, r5.xyxx + mad r4.zw, r4.zzzw, l(0.000000, 0.000000, 0.500000, 0.500000), -r5.xxxy + add r4.zw, r4.zzzw, l(0.000000, 0.000000, -0.500000, -0.500000) + max r4.zw, r4.zzzw, l(0.000000, 0.000000, 0.000000, 0.000000) + mad r4.zw, r4.zzzw, l(0.000000, 0.000000, 2.000000, 2.000000), r5.xxxy + mul r5.xy, r4.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000) + round_ni r5.xy, r5.xyxx + mad r4.xy, r4.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000), -r5.xyxx + add r4.xy, r4.xyxx, l(-0.500000, -0.500000, 0.000000, 0.000000) + max r4.xy, r4.xyxx, l(0.000000, 0.000000, 0.000000, 0.000000) + mad r4.xy, r4.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), r5.xyxx + add r4.xy, -r4.xyxx, r4.zwzz + div r4.xy, r4.xyxx, r0.wwww + add r4.zw, -r4.xxxy, l(0.000000, 0.000000, 1.000000, 1.000000) + mul r0.w, r4.w, r4.z + mad r0.w, r4.x, r4.y, r0.w + mad r0.w, -r0.w, l(0.250000), l(1.000000) + mul r4.xyz, r0.wwww, r2.xyzx + movc r3.xyz, r0.yyyy, r4.xyzx, r2.xyzx +endif +dp3 r0.y, cb0[33].xyzx, r1.xyzx +mul r0.z, r0.z, -r0.y +max r0.z, r0.z, l(0.000000) +mul r1.xyz, r0.zzzz, r3.xyzx +mul r2.xyz, r3.xyzx, l(4.000000, 4.000000, 4.000000, 0.000000) +mad r0.yzw, r0.yyyy, l(0.000000, -0.500000, -0.500000, -1.000000), l(0.000000, 0.500000, 0.500000, 0.000000) +mad r0.yzw, r0.yyzw, l(0.000000, 0.020000, 0.012500, 0.007500), l(0.000000, 0.025000, 0.025000, 0.030000) +mul r0.yzw, r0.yyzw, r2.xxyz +mul r0.yzw, r0.xxxx, r0.yyzw +mad r0.xyz, r1.xyzx, r0.xxxx, r0.yzwy +mul r0.w, v8.z, cb0[17].w +mul r0.w, r0.w, l(1.442695) +exp r0.w, r0.w +add r0.xyz, r0.xyzx, -cb0[17].xyzx +mad r0.xyz, r0.wwww, r0.xyzx, cb0[17].xyzx +log r0.xyz, |r0.xyzx| +mul r0.xyz, r0.xyzx, l(0.454545, 0.454545, 0.454545, 0.000000) +exp o0.xyz, r0.xyzx +mov o0.w, l(1.000000) +ret +// Approximately 179 instruction slots used +#endif + +const BYTE g_meshPS[] = +{ + 68, 88, 66, 67, 72, 67, + 173, 99, 108, 111, 205, 171, + 203, 27, 188, 233, 104, 15, + 95, 167, 1, 0, 0, 0, + 40, 30, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, + 148, 4, 0, 0, 184, 5, + 0, 0, 236, 5, 0, 0, + 140, 29, 0, 0, 82, 68, + 69, 70, 88, 4, 0, 0, + 1, 0, 0, 0, 196, 0, + 0, 0, 3, 0, 0, 0, + 60, 0, 0, 0, 0, 5, + 255, 255, 0, 1, 0, 0, + 36, 4, 0, 0, 82, 68, + 49, 49, 60, 0, 0, 0, + 24, 0, 0, 0, 32, 0, + 0, 0, 40, 0, 0, 0, + 36, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 156, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 3, 0, + 0, 0, 170, 0, 0, 0, + 2, 0, 0, 0, 5, 0, + 0, 0, 4, 0, 0, 0, + 255, 255, 255, 255, 0, 0, + 0, 0, 1, 0, 0, 0, + 1, 0, 0, 0, 184, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 1, 0, 0, 0, + 115, 104, 97, 100, 111, 119, + 83, 97, 109, 112, 108, 101, + 114, 0, 115, 104, 97, 100, + 111, 119, 84, 101, 120, 116, + 117, 114, 101, 0, 99, 111, + 110, 115, 116, 66, 117, 102, + 0, 171, 171, 171, 184, 0, + 0, 0, 1, 0, 0, 0, + 220, 0, 0, 0, 64, 2, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 4, 1, + 0, 0, 0, 0, 0, 0, + 64, 2, 0, 0, 2, 0, + 0, 0, 0, 4, 0, 0, + 0, 0, 0, 0, 255, 255, + 255, 255, 0, 0, 0, 0, + 255, 255, 255, 255, 0, 0, + 0, 0, 103, 80, 97, 114, + 97, 109, 115, 0, 77, 101, + 115, 104, 83, 104, 97, 100, + 101, 114, 67, 111, 110, 115, + 116, 0, 109, 111, 100, 101, + 108, 86, 105, 101, 119, 80, + 114, 111, 106, 101, 99, 116, + 105, 111, 110, 0, 102, 108, + 111, 97, 116, 52, 120, 52, + 0, 171, 171, 171, 3, 0, + 3, 0, 4, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 48, 1, 0, 0, 109, 111, + 100, 101, 108, 86, 105, 101, + 119, 0, 111, 98, 106, 101, + 99, 116, 84, 114, 97, 110, + 115, 102, 111, 114, 109, 0, + 108, 105, 103, 104, 116, 84, + 114, 97, 110, 115, 102, 111, + 114, 109, 0, 99, 108, 105, + 112, 80, 108, 97, 110, 101, + 0, 102, 108, 111, 97, 116, + 52, 0, 171, 171, 1, 0, + 3, 0, 1, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 147, 1, 0, 0, 102, 111, + 103, 67, 111, 108, 111, 114, + 0, 99, 111, 108, 111, 114, + 0, 115, 101, 99, 111, 110, + 100, 97, 114, 121, 67, 111, + 108, 111, 114, 0, 115, 104, + 97, 100, 111, 119, 84, 97, + 112, 115, 0, 171, 171, 171, + 1, 0, 3, 0, 1, 0, + 4, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 147, 1, 0, 0, + 108, 105, 103, 104, 116, 80, + 111, 115, 0, 102, 108, 111, + 97, 116, 51, 0, 1, 0, + 3, 0, 1, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 25, 2, 0, 0, 95, 112, + 97, 100, 48, 0, 102, 108, + 111, 97, 116, 0, 0, 0, + 3, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 74, 2, 0, 0, 108, 105, + 103, 104, 116, 68, 105, 114, + 0, 95, 112, 97, 100, 49, + 0, 98, 105, 97, 115, 0, + 101, 120, 112, 97, 110, 100, + 0, 115, 112, 111, 116, 77, + 105, 110, 0, 115, 112, 111, + 116, 77, 97, 120, 0, 103, + 114, 105, 100, 0, 105, 110, + 116, 0, 0, 0, 2, 0, + 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 164, 2, + 0, 0, 116, 101, 120, 0, + 99, 111, 108, 111, 114, 65, + 114, 114, 97, 121, 0, 105, + 110, 99, 114, 101, 97, 115, + 101, 71, 102, 120, 76, 111, + 97, 100, 70, 111, 114, 65, + 115, 121, 110, 99, 67, 111, + 109, 112, 117, 116, 101, 84, + 101, 115, 116, 105, 110, 103, + 0, 171, 171, 171, 28, 1, + 0, 0, 60, 1, 0, 0, + 0, 0, 0, 0, 96, 1, + 0, 0, 60, 1, 0, 0, + 64, 0, 0, 0, 106, 1, + 0, 0, 60, 1, 0, 0, + 128, 0, 0, 0, 122, 1, + 0, 0, 60, 1, 0, 0, + 192, 0, 0, 0, 137, 1, + 0, 0, 156, 1, 0, 0, + 0, 1, 0, 0, 192, 1, + 0, 0, 156, 1, 0, 0, + 16, 1, 0, 0, 201, 1, + 0, 0, 156, 1, 0, 0, + 32, 1, 0, 0, 207, 1, + 0, 0, 156, 1, 0, 0, + 48, 1, 0, 0, 222, 1, + 0, 0, 236, 1, 0, 0, + 64, 1, 0, 0, 16, 2, + 0, 0, 32, 2, 0, 0, + 0, 2, 0, 0, 68, 2, + 0, 0, 80, 2, 0, 0, + 12, 2, 0, 0, 116, 2, + 0, 0, 32, 2, 0, 0, + 16, 2, 0, 0, 125, 2, + 0, 0, 80, 2, 0, 0, + 28, 2, 0, 0, 131, 2, + 0, 0, 80, 2, 0, 0, + 32, 2, 0, 0, 136, 2, + 0, 0, 80, 2, 0, 0, + 36, 2, 0, 0, 143, 2, + 0, 0, 80, 2, 0, 0, + 40, 2, 0, 0, 151, 2, + 0, 0, 80, 2, 0, 0, + 44, 2, 0, 0, 159, 2, + 0, 0, 168, 2, 0, 0, + 48, 2, 0, 0, 204, 2, + 0, 0, 168, 2, 0, 0, + 52, 2, 0, 0, 208, 2, + 0, 0, 168, 2, 0, 0, + 56, 2, 0, 0, 219, 2, + 0, 0, 168, 2, 0, 0, + 60, 2, 0, 0, 5, 0, + 0, 0, 1, 0, 144, 0, + 0, 0, 21, 0, 4, 3, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 12, 1, 0, 0, 77, 105, + 99, 114, 111, 115, 111, 102, + 116, 32, 40, 82, 41, 32, + 72, 76, 83, 76, 32, 83, + 104, 97, 100, 101, 114, 32, + 67, 111, 109, 112, 105, 108, + 101, 114, 32, 54, 46, 51, + 46, 57, 54, 48, 48, 46, + 49, 54, 51, 56, 52, 0, + 171, 171, 73, 83, 71, 78, + 28, 1, 0, 0, 10, 0, + 0, 0, 8, 0, 0, 0, + 248, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 15, 0, 0, 0, + 4, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 1, 0, + 0, 0, 7, 7, 0, 0, + 4, 1, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 2, 0, + 0, 0, 15, 15, 0, 0, + 4, 1, 0, 0, 2, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 3, 0, + 0, 0, 7, 0, 0, 0, + 4, 1, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 4, 0, + 0, 0, 7, 7, 0, 0, + 4, 1, 0, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 5, 0, + 0, 0, 15, 7, 0, 0, + 4, 1, 0, 0, 5, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 6, 0, + 0, 0, 3, 0, 0, 0, + 4, 1, 0, 0, 6, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 7, 0, + 0, 0, 15, 7, 0, 0, + 4, 1, 0, 0, 7, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 8, 0, + 0, 0, 15, 4, 0, 0, + 13, 1, 0, 0, 0, 0, + 0, 0, 9, 0, 0, 0, + 1, 0, 0, 0, 9, 0, + 0, 0, 1, 1, 0, 0, + 83, 86, 95, 80, 79, 83, + 73, 84, 73, 79, 78, 0, + 84, 69, 88, 67, 79, 79, + 82, 68, 0, 83, 86, 95, + 73, 115, 70, 114, 111, 110, + 116, 70, 97, 99, 101, 0, + 79, 83, 71, 78, 44, 0, + 0, 0, 1, 0, 0, 0, + 8, 0, 0, 0, 32, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 83, 86, + 95, 84, 65, 82, 71, 69, + 84, 0, 171, 171, 83, 72, + 69, 88, 152, 23, 0, 0, + 80, 0, 0, 0, 230, 5, + 0, 0, 106, 8, 0, 1, + 89, 0, 0, 4, 70, 142, + 32, 0, 0, 0, 0, 0, + 36, 0, 0, 0, 90, 8, + 0, 3, 0, 96, 16, 0, + 0, 0, 0, 0, 88, 24, + 0, 4, 0, 112, 16, 0, + 0, 0, 0, 0, 85, 85, + 0, 0, 98, 16, 0, 3, + 114, 16, 16, 0, 1, 0, + 0, 0, 98, 16, 0, 3, + 242, 16, 16, 0, 2, 0, + 0, 0, 98, 16, 0, 3, + 114, 16, 16, 0, 4, 0, + 0, 0, 98, 16, 0, 3, + 114, 16, 16, 0, 5, 0, + 0, 0, 98, 16, 0, 3, + 114, 16, 16, 0, 7, 0, + 0, 0, 98, 16, 0, 3, + 66, 16, 16, 0, 8, 0, + 0, 0, 99, 8, 0, 4, + 18, 16, 16, 0, 9, 0, + 0, 0, 9, 0, 0, 0, + 101, 0, 0, 3, 242, 32, + 16, 0, 0, 0, 0, 0, + 104, 0, 0, 2, 6, 0, + 0, 0, 14, 0, 0, 7, + 114, 0, 16, 0, 0, 0, + 0, 0, 70, 18, 16, 0, + 2, 0, 0, 0, 246, 31, + 16, 0, 2, 0, 0, 0, + 50, 0, 0, 15, 114, 0, + 16, 0, 1, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 63, 0, 0, + 0, 63, 0, 0, 128, 63, + 0, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 63, + 0, 0, 0, 63, 0, 0, + 0, 0, 0, 0, 0, 0, + 49, 0, 0, 7, 66, 0, + 16, 0, 0, 0, 0, 0, + 10, 0, 16, 0, 1, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 0, 0, 49, 0, + 0, 7, 130, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 10, 0, 16, 0, 1, 0, + 0, 0, 60, 0, 0, 7, + 66, 0, 16, 0, 0, 0, + 0, 0, 58, 0, 16, 0, + 0, 0, 0, 0, 42, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 0, 9, 130, 0, + 16, 0, 0, 0, 0, 0, + 26, 128, 32, 128, 65, 0, + 0, 0, 0, 0, 0, 0, + 20, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 56, 0, 0, 8, 18, 0, + 16, 0, 2, 0, 0, 0, + 10, 128, 32, 0, 0, 0, + 0, 0, 20, 0, 0, 0, + 1, 64, 0, 0, 111, 18, + 3, 59, 56, 0, 0, 7, + 34, 0, 16, 0, 2, 0, + 0, 0, 58, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 3, 59, + 0, 0, 0, 8, 130, 0, + 16, 0, 1, 0, 0, 0, + 26, 0, 16, 128, 65, 0, + 0, 0, 1, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 0, 0, 0, 7, + 50, 0, 16, 0, 2, 0, + 0, 0, 198, 0, 16, 0, + 1, 0, 0, 0, 70, 0, + 16, 0, 2, 0, 0, 0, + 70, 0, 0, 141, 194, 0, + 0, 128, 67, 85, 21, 0, + 130, 0, 16, 0, 0, 0, + 0, 0, 70, 0, 16, 0, + 2, 0, 0, 0, 6, 112, + 16, 0, 0, 0, 0, 0, + 0, 96, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 1, 0, 0, 0, 0, 0, + 0, 9, 18, 0, 16, 0, + 2, 0, 0, 0, 26, 128, + 32, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 21, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 56, 0, + 0, 8, 18, 0, 16, 0, + 3, 0, 0, 0, 10, 128, + 32, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 3, 59, + 56, 0, 0, 7, 34, 0, + 16, 0, 3, 0, 0, 0, + 10, 0, 16, 0, 2, 0, + 0, 0, 1, 64, 0, 0, + 111, 18, 3, 59, 0, 0, + 0, 7, 50, 0, 16, 0, + 2, 0, 0, 0, 198, 0, + 16, 0, 1, 0, 0, 0, + 70, 0, 16, 0, 3, 0, + 0, 0, 70, 0, 0, 141, + 194, 0, 0, 128, 67, 85, + 21, 0, 18, 0, 16, 0, + 2, 0, 0, 0, 70, 0, + 16, 0, 2, 0, 0, 0, + 6, 112, 16, 0, 0, 0, + 0, 0, 0, 96, 16, 0, + 0, 0, 0, 0, 42, 0, + 16, 0, 1, 0, 0, 0, + 0, 0, 0, 9, 34, 0, + 16, 0, 2, 0, 0, 0, + 26, 128, 32, 128, 65, 0, + 0, 0, 0, 0, 0, 0, + 22, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 56, 0, 0, 8, 18, 0, + 16, 0, 3, 0, 0, 0, + 10, 128, 32, 0, 0, 0, + 0, 0, 22, 0, 0, 0, + 1, 64, 0, 0, 111, 18, + 3, 59, 56, 0, 0, 7, + 34, 0, 16, 0, 3, 0, + 0, 0, 26, 0, 16, 0, + 2, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 3, 59, + 0, 0, 0, 7, 98, 0, + 16, 0, 2, 0, 0, 0, + 6, 3, 16, 0, 1, 0, + 0, 0, 6, 1, 16, 0, + 3, 0, 0, 0, 70, 0, + 0, 141, 194, 0, 0, 128, + 67, 85, 21, 0, 34, 0, + 16, 0, 2, 0, 0, 0, + 150, 5, 16, 0, 2, 0, + 0, 0, 6, 112, 16, 0, + 0, 0, 0, 0, 0, 96, + 16, 0, 0, 0, 0, 0, + 42, 0, 16, 0, 1, 0, + 0, 0, 0, 0, 0, 9, + 66, 0, 16, 0, 2, 0, + 0, 0, 26, 128, 32, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 23, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 56, 0, 0, 8, + 18, 0, 16, 0, 3, 0, + 0, 0, 10, 128, 32, 0, + 0, 0, 0, 0, 23, 0, + 0, 0, 1, 64, 0, 0, + 111, 18, 3, 59, 56, 0, + 0, 7, 34, 0, 16, 0, + 3, 0, 0, 0, 42, 0, + 16, 0, 2, 0, 0, 0, + 1, 64, 0, 0, 111, 18, + 3, 59, 0, 0, 0, 7, + 194, 0, 16, 0, 2, 0, + 0, 0, 6, 12, 16, 0, + 1, 0, 0, 0, 6, 4, + 16, 0, 3, 0, 0, 0, + 70, 0, 0, 141, 194, 0, + 0, 128, 67, 85, 21, 0, + 66, 0, 16, 0, 2, 0, + 0, 0, 230, 10, 16, 0, + 2, 0, 0, 0, 6, 112, + 16, 0, 0, 0, 0, 0, + 0, 96, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 1, 0, 0, 0, 0, 0, + 0, 9, 130, 0, 16, 0, + 2, 0, 0, 0, 26, 128, + 32, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 24, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 56, 0, + 0, 8, 18, 0, 16, 0, + 3, 0, 0, 0, 10, 128, + 32, 0, 0, 0, 0, 0, + 24, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 3, 59, + 56, 0, 0, 7, 34, 0, + 16, 0, 3, 0, 0, 0, + 58, 0, 16, 0, 2, 0, + 0, 0, 1, 64, 0, 0, + 111, 18, 3, 59, 0, 0, + 0, 7, 50, 0, 16, 0, + 3, 0, 0, 0, 198, 0, + 16, 0, 1, 0, 0, 0, + 70, 0, 16, 0, 3, 0, + 0, 0, 70, 0, 0, 141, + 194, 0, 0, 128, 67, 85, + 21, 0, 130, 0, 16, 0, + 2, 0, 0, 0, 70, 0, + 16, 0, 3, 0, 0, 0, + 6, 112, 16, 0, 0, 0, + 0, 0, 0, 96, 16, 0, + 0, 0, 0, 0, 42, 0, + 16, 0, 1, 0, 0, 0, + 0, 0, 0, 9, 18, 0, + 16, 0, 3, 0, 0, 0, + 26, 128, 32, 128, 65, 0, + 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 56, 0, 0, 8, 18, 0, + 16, 0, 4, 0, 0, 0, + 10, 128, 32, 0, 0, 0, + 0, 0, 25, 0, 0, 0, + 1, 64, 0, 0, 111, 18, + 3, 59, 56, 0, 0, 7, + 34, 0, 16, 0, 4, 0, + 0, 0, 10, 0, 16, 0, + 3, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 3, 59, + 0, 0, 0, 7, 50, 0, + 16, 0, 3, 0, 0, 0, + 198, 0, 16, 0, 1, 0, + 0, 0, 70, 0, 16, 0, + 4, 0, 0, 0, 70, 0, + 0, 141, 194, 0, 0, 128, + 67, 85, 21, 0, 18, 0, + 16, 0, 3, 0, 0, 0, + 70, 0, 16, 0, 3, 0, + 0, 0, 6, 112, 16, 0, + 0, 0, 0, 0, 0, 96, + 16, 0, 0, 0, 0, 0, + 42, 0, 16, 0, 1, 0, + 0, 0, 0, 0, 0, 9, + 34, 0, 16, 0, 3, 0, + 0, 0, 26, 128, 32, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 26, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 56, 0, 0, 8, + 18, 0, 16, 0, 4, 0, + 0, 0, 10, 128, 32, 0, + 0, 0, 0, 0, 26, 0, + 0, 0, 1, 64, 0, 0, + 111, 18, 3, 59, 56, 0, + 0, 7, 34, 0, 16, 0, + 4, 0, 0, 0, 26, 0, + 16, 0, 3, 0, 0, 0, + 1, 64, 0, 0, 111, 18, + 3, 59, 0, 0, 0, 7, + 98, 0, 16, 0, 3, 0, + 0, 0, 6, 3, 16, 0, + 1, 0, 0, 0, 6, 1, + 16, 0, 4, 0, 0, 0, + 70, 0, 0, 141, 194, 0, + 0, 128, 67, 85, 21, 0, + 34, 0, 16, 0, 3, 0, + 0, 0, 150, 5, 16, 0, + 3, 0, 0, 0, 6, 112, + 16, 0, 0, 0, 0, 0, + 0, 96, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 1, 0, 0, 0, 0, 0, + 0, 9, 66, 0, 16, 0, + 3, 0, 0, 0, 26, 128, + 32, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 27, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 56, 0, + 0, 8, 18, 0, 16, 0, + 4, 0, 0, 0, 10, 128, + 32, 0, 0, 0, 0, 0, + 27, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 3, 59, + 56, 0, 0, 7, 34, 0, + 16, 0, 4, 0, 0, 0, + 42, 0, 16, 0, 3, 0, + 0, 0, 1, 64, 0, 0, + 111, 18, 3, 59, 0, 0, + 0, 7, 194, 0, 16, 0, + 3, 0, 0, 0, 6, 12, + 16, 0, 1, 0, 0, 0, + 6, 4, 16, 0, 4, 0, + 0, 0, 70, 0, 0, 141, + 194, 0, 0, 128, 67, 85, + 21, 0, 66, 0, 16, 0, + 3, 0, 0, 0, 230, 10, + 16, 0, 3, 0, 0, 0, + 6, 112, 16, 0, 0, 0, + 0, 0, 0, 96, 16, 0, + 0, 0, 0, 0, 42, 0, + 16, 0, 1, 0, 0, 0, + 0, 0, 0, 9, 130, 0, + 16, 0, 3, 0, 0, 0, + 26, 128, 32, 128, 65, 0, + 0, 0, 0, 0, 0, 0, + 28, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 56, 0, 0, 8, 18, 0, + 16, 0, 4, 0, 0, 0, + 10, 128, 32, 0, 0, 0, + 0, 0, 28, 0, 0, 0, + 1, 64, 0, 0, 111, 18, + 3, 59, 56, 0, 0, 7, + 34, 0, 16, 0, 4, 0, + 0, 0, 58, 0, 16, 0, + 3, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 3, 59, + 0, 0, 0, 7, 50, 0, + 16, 0, 4, 0, 0, 0, + 198, 0, 16, 0, 1, 0, + 0, 0, 70, 0, 16, 0, + 4, 0, 0, 0, 70, 0, + 0, 141, 194, 0, 0, 128, + 67, 85, 21, 0, 130, 0, + 16, 0, 3, 0, 0, 0, + 70, 0, 16, 0, 4, 0, + 0, 0, 6, 112, 16, 0, + 0, 0, 0, 0, 0, 96, + 16, 0, 0, 0, 0, 0, + 42, 0, 16, 0, 1, 0, + 0, 0, 0, 0, 0, 9, + 18, 0, 16, 0, 4, 0, + 0, 0, 26, 128, 32, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 29, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 56, 0, 0, 8, + 18, 0, 16, 0, 5, 0, + 0, 0, 10, 128, 32, 0, + 0, 0, 0, 0, 29, 0, + 0, 0, 1, 64, 0, 0, + 111, 18, 3, 59, 56, 0, + 0, 7, 34, 0, 16, 0, + 5, 0, 0, 0, 10, 0, + 16, 0, 4, 0, 0, 0, + 1, 64, 0, 0, 111, 18, + 3, 59, 0, 0, 0, 7, + 50, 0, 16, 0, 4, 0, + 0, 0, 198, 0, 16, 0, + 1, 0, 0, 0, 70, 0, + 16, 0, 5, 0, 0, 0, + 70, 0, 0, 141, 194, 0, + 0, 128, 67, 85, 21, 0, + 18, 0, 16, 0, 4, 0, + 0, 0, 70, 0, 16, 0, + 4, 0, 0, 0, 6, 112, + 16, 0, 0, 0, 0, 0, + 0, 96, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 1, 0, 0, 0, 0, 0, + 0, 9, 34, 0, 16, 0, + 4, 0, 0, 0, 26, 128, + 32, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 30, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 56, 0, + 0, 8, 18, 0, 16, 0, + 5, 0, 0, 0, 10, 128, + 32, 0, 0, 0, 0, 0, + 30, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 3, 59, + 56, 0, 0, 7, 34, 0, + 16, 0, 5, 0, 0, 0, + 26, 0, 16, 0, 4, 0, + 0, 0, 1, 64, 0, 0, + 111, 18, 3, 59, 0, 0, + 0, 7, 98, 0, 16, 0, + 4, 0, 0, 0, 6, 3, + 16, 0, 1, 0, 0, 0, + 6, 1, 16, 0, 5, 0, + 0, 0, 70, 0, 0, 141, + 194, 0, 0, 128, 67, 85, + 21, 0, 34, 0, 16, 0, + 4, 0, 0, 0, 150, 5, + 16, 0, 4, 0, 0, 0, + 6, 112, 16, 0, 0, 0, + 0, 0, 0, 96, 16, 0, + 0, 0, 0, 0, 42, 0, + 16, 0, 1, 0, 0, 0, + 0, 0, 0, 9, 66, 0, + 16, 0, 4, 0, 0, 0, + 26, 128, 32, 128, 65, 0, + 0, 0, 0, 0, 0, 0, + 31, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 56, 0, 0, 8, 18, 0, + 16, 0, 5, 0, 0, 0, + 10, 128, 32, 0, 0, 0, + 0, 0, 31, 0, 0, 0, + 1, 64, 0, 0, 111, 18, + 3, 59, 56, 0, 0, 7, + 34, 0, 16, 0, 5, 0, + 0, 0, 42, 0, 16, 0, + 4, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 3, 59, + 0, 0, 0, 7, 146, 0, + 16, 0, 1, 0, 0, 0, + 6, 12, 16, 0, 1, 0, + 0, 0, 6, 4, 16, 0, + 5, 0, 0, 0, 70, 0, + 0, 141, 194, 0, 0, 128, + 67, 85, 21, 0, 18, 0, + 16, 0, 1, 0, 0, 0, + 198, 0, 16, 0, 1, 0, + 0, 0, 6, 112, 16, 0, + 0, 0, 0, 0, 0, 96, + 16, 0, 0, 0, 0, 0, + 42, 0, 16, 0, 1, 0, + 0, 0, 31, 0, 0, 3, + 42, 0, 16, 0, 0, 0, + 0, 0, 49, 0, 0, 7, + 66, 0, 16, 0, 0, 0, + 0, 0, 26, 0, 16, 0, + 1, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 0, + 49, 0, 0, 7, 34, 0, + 16, 0, 1, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 26, 0, 16, 0, + 1, 0, 0, 0, 60, 0, + 0, 7, 66, 0, 16, 0, + 0, 0, 0, 0, 42, 0, + 16, 0, 0, 0, 0, 0, + 26, 0, 16, 0, 1, 0, + 0, 0, 31, 0, 0, 3, + 42, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 7, + 66, 0, 16, 0, 0, 0, + 0, 0, 58, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 2, 0, 0, 0, + 0, 0, 0, 7, 66, 0, + 16, 0, 0, 0, 0, 0, + 26, 0, 16, 0, 2, 0, + 0, 0, 42, 0, 16, 0, + 0, 0, 0, 0, 0, 0, + 0, 7, 66, 0, 16, 0, + 0, 0, 0, 0, 42, 0, + 16, 0, 2, 0, 0, 0, + 42, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 7, + 66, 0, 16, 0, 0, 0, + 0, 0, 58, 0, 16, 0, + 2, 0, 0, 0, 42, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 0, 7, 66, 0, + 16, 0, 0, 0, 0, 0, + 10, 0, 16, 0, 3, 0, + 0, 0, 42, 0, 16, 0, + 0, 0, 0, 0, 0, 0, + 0, 7, 66, 0, 16, 0, + 0, 0, 0, 0, 26, 0, + 16, 0, 3, 0, 0, 0, + 42, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 7, + 66, 0, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 3, 0, 0, 0, 42, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 0, 7, 66, 0, + 16, 0, 0, 0, 0, 0, + 58, 0, 16, 0, 3, 0, + 0, 0, 42, 0, 16, 0, + 0, 0, 0, 0, 0, 0, + 0, 7, 66, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 4, 0, 0, 0, + 42, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 7, + 66, 0, 16, 0, 0, 0, + 0, 0, 26, 0, 16, 0, + 4, 0, 0, 0, 42, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 0, 7, 66, 0, + 16, 0, 0, 0, 0, 0, + 10, 0, 16, 0, 1, 0, + 0, 0, 42, 0, 16, 0, + 0, 0, 0, 0, 56, 0, + 0, 7, 66, 0, 16, 0, + 0, 0, 0, 0, 42, 0, + 16, 0, 0, 0, 0, 0, + 1, 64, 0, 0, 171, 170, + 170, 61, 18, 0, 0, 1, + 54, 0, 0, 5, 66, 0, + 16, 0, 0, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 21, 0, 0, 1, + 18, 0, 0, 1, 54, 0, + 0, 5, 66, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 21, 0, 0, 1, 15, 0, + 0, 7, 18, 0, 16, 0, + 0, 0, 0, 0, 70, 0, + 16, 0, 0, 0, 0, 0, + 70, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 10, + 34, 0, 16, 0, 0, 0, + 0, 0, 58, 128, 32, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 34, 0, 0, 0, + 42, 128, 32, 0, 0, 0, + 0, 0, 34, 0, 0, 0, + 0, 0, 0, 9, 18, 0, + 16, 0, 0, 0, 0, 0, + 10, 0, 16, 0, 0, 0, + 0, 0, 58, 128, 32, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 34, 0, 0, 0, + 14, 0, 0, 10, 34, 0, + 16, 0, 0, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 128, 63, 0, 0, 128, 63, + 0, 0, 128, 63, 0, 0, + 128, 63, 26, 0, 16, 0, + 0, 0, 0, 0, 56, 32, + 0, 7, 18, 0, 16, 0, + 0, 0, 0, 0, 26, 0, + 16, 0, 0, 0, 0, 0, + 10, 0, 16, 0, 0, 0, + 0, 0, 50, 0, 0, 9, + 34, 0, 16, 0, 0, 0, + 0, 0, 10, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 192, + 1, 64, 0, 0, 0, 0, + 64, 64, 56, 0, 0, 7, + 18, 0, 16, 0, 0, 0, + 0, 0, 10, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 0, 0, 0, 0, + 56, 0, 0, 7, 18, 0, + 16, 0, 0, 0, 0, 0, + 10, 0, 16, 0, 0, 0, + 0, 0, 26, 0, 16, 0, + 0, 0, 0, 0, 52, 0, + 0, 10, 82, 0, 16, 0, + 0, 0, 0, 0, 6, 2, + 16, 0, 0, 0, 0, 0, + 2, 64, 0, 0, 205, 204, + 76, 61, 0, 0, 0, 0, + 0, 0, 0, 63, 0, 0, + 0, 0, 55, 0, 0, 10, + 114, 0, 16, 0, 1, 0, + 0, 0, 6, 16, 16, 0, + 9, 0, 0, 0, 70, 18, + 16, 0, 1, 0, 0, 0, + 70, 18, 16, 128, 65, 0, + 0, 0, 1, 0, 0, 0, + 55, 0, 0, 9, 114, 0, + 16, 0, 2, 0, 0, 0, + 6, 16, 16, 0, 9, 0, + 0, 0, 70, 18, 16, 0, + 5, 0, 0, 0, 70, 18, + 16, 0, 7, 0, 0, 0, + 39, 0, 0, 8, 34, 0, + 16, 0, 0, 0, 0, 0, + 10, 128, 32, 0, 0, 0, + 0, 0, 35, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 0, 0, 49, 0, 0, 7, + 130, 0, 16, 0, 0, 0, + 0, 0, 1, 64, 0, 0, + 82, 184, 126, 63, 26, 0, + 16, 0, 1, 0, 0, 0, + 1, 0, 0, 7, 130, 0, + 16, 0, 0, 0, 0, 0, + 58, 0, 16, 0, 0, 0, + 0, 0, 26, 0, 16, 0, + 0, 0, 0, 0, 31, 0, + 4, 3, 58, 0, 16, 0, + 0, 0, 0, 0, 122, 0, + 0, 5, 50, 0, 16, 0, + 3, 0, 0, 0, 134, 16, + 16, 0, 4, 0, 0, 0, + 124, 0, 0, 5, 194, 0, + 16, 0, 3, 0, 0, 0, + 6, 24, 16, 0, 4, 0, + 0, 0, 52, 0, 0, 9, + 50, 0, 16, 0, 3, 0, + 0, 0, 230, 10, 16, 128, + 129, 0, 0, 0, 3, 0, + 0, 0, 70, 0, 16, 128, + 129, 0, 0, 0, 3, 0, + 0, 0, 52, 0, 0, 7, + 130, 0, 16, 0, 0, 0, + 0, 0, 26, 0, 16, 0, + 3, 0, 0, 0, 10, 0, + 16, 0, 3, 0, 0, 0, + 50, 0, 0, 13, 50, 0, + 16, 0, 3, 0, 0, 0, + 246, 15, 16, 128, 65, 0, + 0, 0, 0, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 63, 0, 0, 0, 63, + 0, 0, 0, 0, 0, 0, + 0, 0, 134, 16, 16, 0, + 4, 0, 0, 0, 50, 0, + 0, 12, 194, 0, 16, 0, + 3, 0, 0, 0, 246, 15, + 16, 0, 0, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 63, 0, 0, + 0, 63, 6, 24, 16, 0, + 4, 0, 0, 0, 56, 0, + 0, 10, 50, 0, 16, 0, + 4, 0, 0, 0, 230, 10, + 16, 0, 3, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 63, 0, 0, 0, 63, + 0, 0, 0, 0, 0, 0, + 0, 0, 65, 0, 0, 5, + 50, 0, 16, 0, 4, 0, + 0, 0, 70, 0, 16, 0, + 4, 0, 0, 0, 50, 0, + 0, 13, 194, 0, 16, 0, + 3, 0, 0, 0, 166, 14, + 16, 0, 3, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 63, 0, 0, + 0, 63, 6, 4, 16, 128, + 65, 0, 0, 0, 4, 0, + 0, 0, 0, 0, 0, 10, + 194, 0, 16, 0, 3, 0, + 0, 0, 166, 14, 16, 0, + 3, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 191, 0, 0, 0, 191, + 52, 0, 0, 10, 194, 0, + 16, 0, 3, 0, 0, 0, + 166, 14, 16, 0, 3, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 0, + 0, 12, 194, 0, 16, 0, + 3, 0, 0, 0, 166, 14, + 16, 0, 3, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 64, 0, 0, + 0, 64, 6, 4, 16, 0, + 4, 0, 0, 0, 56, 0, + 0, 10, 50, 0, 16, 0, + 4, 0, 0, 0, 70, 0, + 16, 0, 3, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 63, 0, 0, 0, 63, + 0, 0, 0, 0, 0, 0, + 0, 0, 65, 0, 0, 5, + 50, 0, 16, 0, 4, 0, + 0, 0, 70, 0, 16, 0, + 4, 0, 0, 0, 50, 0, + 0, 13, 50, 0, 16, 0, + 3, 0, 0, 0, 70, 0, + 16, 0, 3, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 63, 0, 0, 0, 63, + 0, 0, 0, 0, 0, 0, + 0, 0, 70, 0, 16, 128, + 65, 0, 0, 0, 4, 0, + 0, 0, 0, 0, 0, 10, + 50, 0, 16, 0, 3, 0, + 0, 0, 70, 0, 16, 0, + 3, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 191, + 0, 0, 0, 191, 0, 0, + 0, 0, 0, 0, 0, 0, + 52, 0, 0, 10, 50, 0, + 16, 0, 3, 0, 0, 0, + 70, 0, 16, 0, 3, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 0, + 0, 12, 50, 0, 16, 0, + 3, 0, 0, 0, 70, 0, + 16, 0, 3, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 64, 0, 0, 0, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 70, 0, 16, 0, + 4, 0, 0, 0, 0, 0, + 0, 8, 50, 0, 16, 0, + 3, 0, 0, 0, 70, 0, + 16, 128, 65, 0, 0, 0, + 3, 0, 0, 0, 230, 10, + 16, 0, 3, 0, 0, 0, + 14, 0, 0, 7, 50, 0, + 16, 0, 3, 0, 0, 0, + 70, 0, 16, 0, 3, 0, + 0, 0, 246, 15, 16, 0, + 0, 0, 0, 0, 0, 0, + 0, 11, 194, 0, 16, 0, + 3, 0, 0, 0, 6, 4, + 16, 128, 65, 0, 0, 0, + 3, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 128, 63, 0, 0, 128, 63, + 56, 0, 0, 7, 130, 0, + 16, 0, 0, 0, 0, 0, + 58, 0, 16, 0, 3, 0, + 0, 0, 42, 0, 16, 0, + 3, 0, 0, 0, 50, 0, + 0, 9, 130, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 3, 0, 0, 0, + 26, 0, 16, 0, 3, 0, + 0, 0, 58, 0, 16, 0, + 0, 0, 0, 0, 50, 0, + 0, 10, 130, 0, 16, 0, + 0, 0, 0, 0, 58, 0, + 16, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 62, + 1, 64, 0, 0, 0, 0, + 128, 63, 56, 0, 0, 7, + 114, 0, 16, 0, 3, 0, + 0, 0, 246, 15, 16, 0, + 0, 0, 0, 0, 70, 2, + 16, 0, 2, 0, 0, 0, + 18, 0, 0, 1, 49, 0, + 0, 8, 130, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 82, 184, 126, 63, + 42, 0, 16, 128, 129, 0, + 0, 0, 1, 0, 0, 0, + 1, 0, 0, 7, 34, 0, + 16, 0, 0, 0, 0, 0, + 58, 0, 16, 0, 0, 0, + 0, 0, 26, 0, 16, 0, + 0, 0, 0, 0, 122, 0, + 0, 5, 50, 0, 16, 0, + 4, 0, 0, 0, 22, 21, + 16, 0, 4, 0, 0, 0, + 124, 0, 0, 5, 194, 0, + 16, 0, 4, 0, 0, 0, + 86, 17, 16, 0, 4, 0, + 0, 0, 52, 0, 0, 9, + 50, 0, 16, 0, 4, 0, + 0, 0, 230, 10, 16, 128, + 129, 0, 0, 0, 4, 0, + 0, 0, 70, 0, 16, 128, + 129, 0, 0, 0, 4, 0, + 0, 0, 52, 0, 0, 7, + 130, 0, 16, 0, 0, 0, + 0, 0, 26, 0, 16, 0, + 4, 0, 0, 0, 10, 0, + 16, 0, 4, 0, 0, 0, + 50, 0, 0, 13, 50, 0, + 16, 0, 4, 0, 0, 0, + 246, 15, 16, 128, 65, 0, + 0, 0, 0, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 63, 0, 0, 0, 63, + 0, 0, 0, 0, 0, 0, + 0, 0, 22, 21, 16, 0, + 4, 0, 0, 0, 50, 0, + 0, 12, 194, 0, 16, 0, + 4, 0, 0, 0, 246, 15, + 16, 0, 0, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 63, 0, 0, + 0, 63, 86, 17, 16, 0, + 4, 0, 0, 0, 56, 0, + 0, 10, 50, 0, 16, 0, + 5, 0, 0, 0, 230, 10, + 16, 0, 4, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 63, 0, 0, 0, 63, + 0, 0, 0, 0, 0, 0, + 0, 0, 65, 0, 0, 5, + 50, 0, 16, 0, 5, 0, + 0, 0, 70, 0, 16, 0, + 5, 0, 0, 0, 50, 0, + 0, 13, 194, 0, 16, 0, + 4, 0, 0, 0, 166, 14, + 16, 0, 4, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 63, 0, 0, + 0, 63, 6, 4, 16, 128, + 65, 0, 0, 0, 5, 0, + 0, 0, 0, 0, 0, 10, + 194, 0, 16, 0, 4, 0, + 0, 0, 166, 14, 16, 0, + 4, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 191, 0, 0, 0, 191, + 52, 0, 0, 10, 194, 0, + 16, 0, 4, 0, 0, 0, + 166, 14, 16, 0, 4, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 0, + 0, 12, 194, 0, 16, 0, + 4, 0, 0, 0, 166, 14, + 16, 0, 4, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 64, 0, 0, + 0, 64, 6, 4, 16, 0, + 5, 0, 0, 0, 56, 0, + 0, 10, 50, 0, 16, 0, + 5, 0, 0, 0, 70, 0, + 16, 0, 4, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 63, 0, 0, 0, 63, + 0, 0, 0, 0, 0, 0, + 0, 0, 65, 0, 0, 5, + 50, 0, 16, 0, 5, 0, + 0, 0, 70, 0, 16, 0, + 5, 0, 0, 0, 50, 0, + 0, 13, 50, 0, 16, 0, + 4, 0, 0, 0, 70, 0, + 16, 0, 4, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 63, 0, 0, 0, 63, + 0, 0, 0, 0, 0, 0, + 0, 0, 70, 0, 16, 128, + 65, 0, 0, 0, 5, 0, + 0, 0, 0, 0, 0, 10, + 50, 0, 16, 0, 4, 0, + 0, 0, 70, 0, 16, 0, + 4, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 191, + 0, 0, 0, 191, 0, 0, + 0, 0, 0, 0, 0, 0, + 52, 0, 0, 10, 50, 0, + 16, 0, 4, 0, 0, 0, + 70, 0, 16, 0, 4, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 0, + 0, 12, 50, 0, 16, 0, + 4, 0, 0, 0, 70, 0, + 16, 0, 4, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 64, 0, 0, 0, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 70, 0, 16, 0, + 5, 0, 0, 0, 0, 0, + 0, 8, 50, 0, 16, 0, + 4, 0, 0, 0, 70, 0, + 16, 128, 65, 0, 0, 0, + 4, 0, 0, 0, 230, 10, + 16, 0, 4, 0, 0, 0, + 14, 0, 0, 7, 50, 0, + 16, 0, 4, 0, 0, 0, + 70, 0, 16, 0, 4, 0, + 0, 0, 246, 15, 16, 0, + 0, 0, 0, 0, 0, 0, + 0, 11, 194, 0, 16, 0, + 4, 0, 0, 0, 6, 4, + 16, 128, 65, 0, 0, 0, + 4, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 128, 63, 0, 0, 128, 63, + 56, 0, 0, 7, 130, 0, + 16, 0, 0, 0, 0, 0, + 58, 0, 16, 0, 4, 0, + 0, 0, 42, 0, 16, 0, + 4, 0, 0, 0, 50, 0, + 0, 9, 130, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 4, 0, 0, 0, + 26, 0, 16, 0, 4, 0, + 0, 0, 58, 0, 16, 0, + 0, 0, 0, 0, 50, 0, + 0, 10, 130, 0, 16, 0, + 0, 0, 0, 0, 58, 0, + 16, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 62, + 1, 64, 0, 0, 0, 0, + 128, 63, 56, 0, 0, 7, + 114, 0, 16, 0, 4, 0, + 0, 0, 246, 15, 16, 0, + 0, 0, 0, 0, 70, 2, + 16, 0, 2, 0, 0, 0, + 55, 0, 0, 9, 114, 0, + 16, 0, 3, 0, 0, 0, + 86, 5, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 4, 0, 0, 0, 70, 2, + 16, 0, 2, 0, 0, 0, + 21, 0, 0, 1, 16, 0, + 0, 8, 34, 0, 16, 0, + 0, 0, 0, 0, 70, 130, + 32, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 70, 2, + 16, 0, 1, 0, 0, 0, + 56, 0, 0, 8, 66, 0, + 16, 0, 0, 0, 0, 0, + 42, 0, 16, 0, 0, 0, + 0, 0, 26, 0, 16, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 52, 0, 0, 7, + 66, 0, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 0, + 56, 0, 0, 7, 114, 0, + 16, 0, 1, 0, 0, 0, + 166, 10, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 3, 0, 0, 0, 56, 0, + 0, 10, 114, 0, 16, 0, + 2, 0, 0, 0, 70, 2, + 16, 0, 3, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 128, 64, 0, 0, 128, 64, + 0, 0, 128, 64, 0, 0, + 0, 0, 50, 0, 0, 15, + 226, 0, 16, 0, 0, 0, + 0, 0, 86, 5, 16, 0, + 0, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 191, 0, 0, + 0, 191, 0, 0, 128, 191, + 2, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 63, + 0, 0, 0, 63, 0, 0, + 0, 0, 50, 0, 0, 15, + 226, 0, 16, 0, 0, 0, + 0, 0, 86, 14, 16, 0, + 0, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 0, + 11, 215, 163, 60, 206, 204, + 76, 60, 148, 194, 245, 59, + 2, 64, 0, 0, 0, 0, + 0, 0, 205, 204, 204, 60, + 205, 204, 204, 60, 143, 194, + 245, 60, 56, 0, 0, 7, + 226, 0, 16, 0, 0, 0, + 0, 0, 86, 14, 16, 0, + 0, 0, 0, 0, 6, 9, + 16, 0, 2, 0, 0, 0, + 56, 0, 0, 7, 226, 0, + 16, 0, 0, 0, 0, 0, + 6, 0, 16, 0, 0, 0, + 0, 0, 86, 14, 16, 0, + 0, 0, 0, 0, 50, 0, + 0, 9, 114, 0, 16, 0, + 0, 0, 0, 0, 70, 2, + 16, 0, 1, 0, 0, 0, + 6, 0, 16, 0, 0, 0, + 0, 0, 150, 7, 16, 0, + 0, 0, 0, 0, 56, 0, + 0, 8, 130, 0, 16, 0, + 0, 0, 0, 0, 42, 16, + 16, 0, 8, 0, 0, 0, + 58, 128, 32, 0, 0, 0, + 0, 0, 17, 0, 0, 0, + 56, 0, 0, 7, 130, 0, + 16, 0, 0, 0, 0, 0, + 58, 0, 16, 0, 0, 0, + 0, 0, 1, 64, 0, 0, + 59, 170, 184, 63, 25, 0, + 0, 5, 130, 0, 16, 0, + 0, 0, 0, 0, 58, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 0, 9, 114, 0, + 16, 0, 0, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 70, 130, 32, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 17, 0, 0, 0, + 50, 0, 0, 10, 114, 0, + 16, 0, 0, 0, 0, 0, + 246, 15, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 70, 130, + 32, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 47, 0, + 0, 6, 114, 0, 16, 0, + 0, 0, 0, 0, 70, 2, + 16, 128, 129, 0, 0, 0, + 0, 0, 0, 0, 56, 0, + 0, 10, 114, 0, 16, 0, + 0, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 2, 64, 0, 0, 47, 186, + 232, 62, 47, 186, 232, 62, + 47, 186, 232, 62, 0, 0, + 0, 0, 25, 0, 0, 5, + 114, 32, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 54, 0, + 0, 5, 130, 32, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 62, 0, 0, 1, 83, 84, + 65, 84, 148, 0, 0, 0, + 179, 0, 0, 0, 6, 0, + 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 146, 0, + 0, 0, 1, 0, 0, 0, + 4, 0, 0, 0, 4, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 3, 0, 0, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0 +}; diff --git a/demo/d3d/shaders/meshPS.hlsl b/demo/d3d/shaders/meshPS.hlsl new file mode 100644 index 0000000..a78d249 --- /dev/null +++ b/demo/d3d/shaders/meshPS.hlsl @@ -0,0 +1,123 @@ +#include "shaderCommon.h" + +cbuffer constBuf : register(b0) +{ + MeshShaderConst gParams; +}; + +Texture2D<float> shadowTexture : register(t0); // shadow map +SamplerComparisonState shadowSampler : register(s0); // texture sample used to sample depth from shadow texture in this sample + +// sample shadow map +float shadowSample(float4 lightOffsetPosition) +{ + float3 pos = float3(lightOffsetPosition.xyz / lightOffsetPosition.w); + float3 uvw = (pos.xyz * float3(0.5, 0.5, 1.0)) + float3(0.5, 0.5, 0.0); + + // user clip + if (uvw.x < 0.0 || uvw.x > 1.0) + return 1.0; + if (uvw.y < 0.0 || uvw.y > 1.0) + return 1.0; + + float s = 0.0; + float radius = 0.002; + + const int numTaps = 12; + + // flip uv y-coordinate + uvw.y = 1.0f - uvw.y; + + [unroll] + for (int i = 0; i < numTaps; i++) + { + float2 shadowTaps = gParams.shadowTaps[i].xy; + shadowTaps.y = 1.0f - shadowTaps.y; + s += shadowTexture.SampleCmp(shadowSampler, uvw.xy + shadowTaps * radius, uvw.z); + } + s /= numTaps; + + return s; +} + +float filterwidth(float2 v) +{ + float2 fw = max(abs(ddx(v)), abs(ddy(v))); + return max(fw.x, fw.y); +} + +float2 bump(float2 x) +{ + return (floor((x) / 2) + 2.f * max(((x) / 2) - floor((x) / 2) - .5f, 0.f)); +} + +float checker(float2 uv) +{ + float width = filterwidth(uv); + float2 p0 = uv - 0.5 * width; + float2 p1 = uv + 0.5 * width; + + float2 i = (bump(p1) - bump(p0)) / width; + return i.x * i.y + (1 - i.x) * (1 - i.y); +} + +float4 meshPS(MeshVertexOut input, bool isFrontFace : SV_IsFrontFace) : SV_TARGET +{ + const float4 fogColor = gParams.fogColor; + const float3 lightDir = gParams.lightDir; + const float3 lightPos = gParams.lightPos; + const float spotMin = gParams.spotMin; + const float spotMax = gParams.spotMax; + const int grid = gParams.grid; + const int tex = gParams.tex; + + // calculate lighting + float shadow = max(shadowSample(input.lightOffsetPosition), 0.5); + //float shadow = 0.5f; + + float3 lVec = normalize(input.worldPosition - lightPos); + float3 lPos = float3(input.lightOffsetPosition.xyz / input.lightOffsetPosition.w); + float attenuation = max(smoothstep(spotMax, spotMin, dot(lPos.xy, lPos.xy)), 0.05); + + float3 n = input.worldNormal; + float3 color = input.color.xyz; + + if (!isFrontFace) + { + color = input.secondaryColor.xyz; + n *= -1.0f; + } + + if (grid && (n.y > 0.995)) + { + color *= 1.0 - 0.25 * checker(float2(input.worldPosition.x, input.worldPosition.z)); + } + else if (grid && abs(n.z) > 0.995) + { + color *= 1.0 - 0.25 * checker(float2(input.worldPosition.y, input.worldPosition.x)); + } + + if (tex) + { + //color = texture2D(tex, gl_TexCoord[5].xy).xyz; + } + + // direct light term + float wrap = 0.0; + float3 diffuse = color * float3(1.0, 1.0, 1.0) * max(0.0, (-dot(lightDir, n) + wrap) / (1.0 + wrap) * shadow) * attenuation; + + // wrap ambient term aligned with light dir + float3 light = float3(0.03, 0.025, 0.025) * 1.5; + float3 dark = float3(0.025, 0.025, 0.03); + //float3 ambient = 4.0 * color * lerp(dark, light, -dot(lightDir, n) * 0.5 + 0.5) * attenuation; + float3 ambient = 4.0 * color * lerp(dark, light, -dot(lightDir, n) * float3(0.5, 0.5, 1.0) + float3(0.5, 0.5, 0.0)) * attenuation; + + float3 fog = lerp(fogColor.xyz, diffuse + ambient, exp(input.viewPosition.z * fogColor.w)); + + //outColor = float4(pow(fog, float3(1.0 / 2.2)), 1.0); + const float tmp = 1.0 / 2.2; + + float4 outColor = float4(pow(abs(fog), float3(tmp, tmp, tmp)), 1.0); + + return outColor; +} diff --git a/demo/d3d/shaders/meshPS.hlsl.h b/demo/d3d/shaders/meshPS.hlsl.h new file mode 100644 index 0000000..8223a67 --- /dev/null +++ b/demo/d3d/shaders/meshPS.hlsl.h @@ -0,0 +1,1558 @@ +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// Buffer Definitions: +// +// cbuffer constBuf +// { +// +// struct MeshShaderConst +// { +// +// float4x4 modelViewProjection; // Offset: 0 +// float4x4 modelView; // Offset: 64 +// float4x4 objectTransform; // Offset: 128 +// float4x4 lightTransform; // Offset: 192 +// float4 clipPlane; // Offset: 256 +// float4 fogColor; // Offset: 272 +// float4 color; // Offset: 288 +// float4 secondaryColor; // Offset: 304 +// float4 shadowTaps[12]; // Offset: 320 +// float3 lightPos; // Offset: 512 +// float _pad0; // Offset: 524 +// float3 lightDir; // Offset: 528 +// float _pad1; // Offset: 540 +// float bias; // Offset: 544 +// float expand; // Offset: 548 +// float spotMin; // Offset: 552 +// float spotMax; // Offset: 556 +// int grid; // Offset: 560 +// int tex; // Offset: 564 +// int colorArray; // Offset: 568 +// int increaseGfxLoadForAsyncComputeTesting;// Offset: 572 +// +// } gParams; // Offset: 0 Size: 576 +// +// } +// +// +// Resource Bindings: +// +// Name Type Format Dim Slot Elements +// ------------------------------ ---------- ------- ----------- ---- -------- +// shadowSampler sampler_c NA NA 0 1 +// shadowTexture texture float 2d 0 1 +// constBuf cbuffer NA NA 0 1 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_POSITION 0 xyzw 0 POS float +// TEXCOORD 0 xyz 1 NONE float xyz +// TEXCOORD 1 xyzw 2 NONE float xyzw +// TEXCOORD 2 xyz 3 NONE float +// TEXCOORD 3 xyz 4 NONE float xyz +// TEXCOORD 4 xyzw 5 NONE float xyz +// TEXCOORD 5 xy 6 NONE float +// TEXCOORD 6 xyzw 7 NONE float xyz +// TEXCOORD 7 xyzw 8 NONE float z +// SV_IsFrontFace 0 x 9 FFACE uint x +// +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_TARGET 0 xyzw 0 TARGET float xyzw +// +ps_5_0 +dcl_globalFlags refactoringAllowed +dcl_constantbuffer cb0[36], immediateIndexed +dcl_sampler s0, mode_comparison +dcl_resource_texture2d (float,float,float,float) t0 +dcl_input_ps linear v1.xyz +dcl_input_ps linear v2.xyzw +dcl_input_ps linear v4.xyz +dcl_input_ps linear v5.xyz +dcl_input_ps linear v7.xyz +dcl_input_ps linear v8.z +dcl_input_ps_sgv v9.x, is_front_face +dcl_output o0.xyzw +dcl_temps 6 +div r0.xyz, v2.xyzx, v2.wwww +mad r1.xyz, r0.xyzx, l(0.500000, 0.500000, 1.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000) +lt r0.z, r1.x, l(0.000000) +lt r0.w, l(1.000000), r1.x +or r0.z, r0.w, r0.z +add r0.w, -cb0[20].y, l(1.000000) +mul r2.x, cb0[20].x, l(0.002000) +mul r2.y, r0.w, l(0.002000) +add r1.w, -r1.y, l(1.000000) +add r2.xy, r1.xwxx, r2.xyxx +sample_c_indexable(texture2d)(float,float,float,float) r0.w, r2.xyxx, t0.xxxx, s0, r1.z +add r2.x, -cb0[21].y, l(1.000000) +mul r3.x, cb0[21].x, l(0.002000) +mul r3.y, r2.x, l(0.002000) +add r2.xy, r1.xwxx, r3.xyxx +sample_c_indexable(texture2d)(float,float,float,float) r2.x, r2.xyxx, t0.xxxx, s0, r1.z +add r2.y, -cb0[22].y, l(1.000000) +mul r3.x, cb0[22].x, l(0.002000) +mul r3.y, r2.y, l(0.002000) +add r2.yz, r1.xxwx, r3.xxyx +sample_c_indexable(texture2d)(float,float,float,float) r2.y, r2.yzyy, t0.xxxx, s0, r1.z +add r2.z, -cb0[23].y, l(1.000000) +mul r3.x, cb0[23].x, l(0.002000) +mul r3.y, r2.z, l(0.002000) +add r2.zw, r1.xxxw, r3.xxxy +sample_c_indexable(texture2d)(float,float,float,float) r2.z, r2.zwzz, t0.xxxx, s0, r1.z +add r2.w, -cb0[24].y, l(1.000000) +mul r3.x, cb0[24].x, l(0.002000) +mul r3.y, r2.w, l(0.002000) +add r3.xy, r1.xwxx, r3.xyxx +sample_c_indexable(texture2d)(float,float,float,float) r2.w, r3.xyxx, t0.xxxx, s0, r1.z +add r3.x, -cb0[25].y, l(1.000000) +mul r4.x, cb0[25].x, l(0.002000) +mul r4.y, r3.x, l(0.002000) +add r3.xy, r1.xwxx, r4.xyxx +sample_c_indexable(texture2d)(float,float,float,float) r3.x, r3.xyxx, t0.xxxx, s0, r1.z +add r3.y, -cb0[26].y, l(1.000000) +mul r4.x, cb0[26].x, l(0.002000) +mul r4.y, r3.y, l(0.002000) +add r3.yz, r1.xxwx, r4.xxyx +sample_c_indexable(texture2d)(float,float,float,float) r3.y, r3.yzyy, t0.xxxx, s0, r1.z +add r3.z, -cb0[27].y, l(1.000000) +mul r4.x, cb0[27].x, l(0.002000) +mul r4.y, r3.z, l(0.002000) +add r3.zw, r1.xxxw, r4.xxxy +sample_c_indexable(texture2d)(float,float,float,float) r3.z, r3.zwzz, t0.xxxx, s0, r1.z +add r3.w, -cb0[28].y, l(1.000000) +mul r4.x, cb0[28].x, l(0.002000) +mul r4.y, r3.w, l(0.002000) +add r4.xy, r1.xwxx, r4.xyxx +sample_c_indexable(texture2d)(float,float,float,float) r3.w, r4.xyxx, t0.xxxx, s0, r1.z +add r4.x, -cb0[29].y, l(1.000000) +mul r5.x, cb0[29].x, l(0.002000) +mul r5.y, r4.x, l(0.002000) +add r4.xy, r1.xwxx, r5.xyxx +sample_c_indexable(texture2d)(float,float,float,float) r4.x, r4.xyxx, t0.xxxx, s0, r1.z +add r4.y, -cb0[30].y, l(1.000000) +mul r5.x, cb0[30].x, l(0.002000) +mul r5.y, r4.y, l(0.002000) +add r4.yz, r1.xxwx, r5.xxyx +sample_c_indexable(texture2d)(float,float,float,float) r4.y, r4.yzyy, t0.xxxx, s0, r1.z +add r4.z, -cb0[31].y, l(1.000000) +mul r5.x, cb0[31].x, l(0.002000) +mul r5.y, r4.z, l(0.002000) +add r1.xw, r1.xxxw, r5.xxxy +sample_c_indexable(texture2d)(float,float,float,float) r1.x, r1.xwxx, t0.xxxx, s0, r1.z +if_z r0.z + lt r0.z, r1.y, l(0.000000) + lt r1.y, l(1.000000), r1.y + or r0.z, r0.z, r1.y + if_z r0.z + add r0.z, r0.w, r2.x + add r0.z, r2.y, r0.z + add r0.z, r2.z, r0.z + add r0.z, r2.w, r0.z + add r0.z, r3.x, r0.z + add r0.z, r3.y, r0.z + add r0.z, r3.z, r0.z + add r0.z, r3.w, r0.z + add r0.z, r4.x, r0.z + add r0.z, r4.y, r0.z + add r0.z, r1.x, r0.z + mul r0.z, r0.z, l(0.083333) + else + mov r0.z, l(1.000000) + endif +else + mov r0.z, l(1.000000) +endif +dp2 r0.x, r0.xyxx, r0.xyxx +add r0.y, -cb0[34].w, cb0[34].z +add r0.x, r0.x, -cb0[34].w +div r0.y, l(1.000000, 1.000000, 1.000000, 1.000000), r0.y +mul_sat r0.x, r0.y, r0.x +mad r0.y, r0.x, l(-2.000000), l(3.000000) +mul r0.x, r0.x, r0.x +mul r0.x, r0.x, r0.y +max r0.xz, r0.xxzx, l(0.050000, 0.000000, 0.500000, 0.000000) +movc r1.xyz, v9.xxxx, v1.xyzx, -v1.xyzx +movc r2.xyz, v9.xxxx, v5.xyzx, v7.xyzx +ine r0.y, cb0[35].x, l(0) +lt r0.w, l(0.995000), r1.y +and r0.w, r0.w, r0.y +if_nz r0.w + deriv_rtx_coarse r3.xy, v4.xzxx + deriv_rty_coarse r3.zw, v4.xxxz + max r3.xy, |r3.zwzz|, |r3.xyxx| + max r0.w, r3.y, r3.x + mad r3.xy, -r0.wwww, l(0.500000, 0.500000, 0.000000, 0.000000), v4.xzxx + mad r3.zw, r0.wwww, l(0.000000, 0.000000, 0.500000, 0.500000), v4.xxxz + mul r4.xy, r3.zwzz, l(0.500000, 0.500000, 0.000000, 0.000000) + round_ni r4.xy, r4.xyxx + mad r3.zw, r3.zzzw, l(0.000000, 0.000000, 0.500000, 0.500000), -r4.xxxy + add r3.zw, r3.zzzw, l(0.000000, 0.000000, -0.500000, -0.500000) + max r3.zw, r3.zzzw, l(0.000000, 0.000000, 0.000000, 0.000000) + mad r3.zw, r3.zzzw, l(0.000000, 0.000000, 2.000000, 2.000000), r4.xxxy + mul r4.xy, r3.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000) + round_ni r4.xy, r4.xyxx + mad r3.xy, r3.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000), -r4.xyxx + add r3.xy, r3.xyxx, l(-0.500000, -0.500000, 0.000000, 0.000000) + max r3.xy, r3.xyxx, l(0.000000, 0.000000, 0.000000, 0.000000) + mad r3.xy, r3.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), r4.xyxx + add r3.xy, -r3.xyxx, r3.zwzz + div r3.xy, r3.xyxx, r0.wwww + add r3.zw, -r3.xxxy, l(0.000000, 0.000000, 1.000000, 1.000000) + mul r0.w, r3.w, r3.z + mad r0.w, r3.x, r3.y, r0.w + mad r0.w, -r0.w, l(0.250000), l(1.000000) + mul r3.xyz, r0.wwww, r2.xyzx +else + lt r0.w, l(0.995000), |r1.z| + and r0.y, r0.w, r0.y + deriv_rtx_coarse r4.xy, v4.yxyy + deriv_rty_coarse r4.zw, v4.yyyx + max r4.xy, |r4.zwzz|, |r4.xyxx| + max r0.w, r4.y, r4.x + mad r4.xy, -r0.wwww, l(0.500000, 0.500000, 0.000000, 0.000000), v4.yxyy + mad r4.zw, r0.wwww, l(0.000000, 0.000000, 0.500000, 0.500000), v4.yyyx + mul r5.xy, r4.zwzz, l(0.500000, 0.500000, 0.000000, 0.000000) + round_ni r5.xy, r5.xyxx + mad r4.zw, r4.zzzw, l(0.000000, 0.000000, 0.500000, 0.500000), -r5.xxxy + add r4.zw, r4.zzzw, l(0.000000, 0.000000, -0.500000, -0.500000) + max r4.zw, r4.zzzw, l(0.000000, 0.000000, 0.000000, 0.000000) + mad r4.zw, r4.zzzw, l(0.000000, 0.000000, 2.000000, 2.000000), r5.xxxy + mul r5.xy, r4.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000) + round_ni r5.xy, r5.xyxx + mad r4.xy, r4.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000), -r5.xyxx + add r4.xy, r4.xyxx, l(-0.500000, -0.500000, 0.000000, 0.000000) + max r4.xy, r4.xyxx, l(0.000000, 0.000000, 0.000000, 0.000000) + mad r4.xy, r4.xyxx, l(2.000000, 2.000000, 0.000000, 0.000000), r5.xyxx + add r4.xy, -r4.xyxx, r4.zwzz + div r4.xy, r4.xyxx, r0.wwww + add r4.zw, -r4.xxxy, l(0.000000, 0.000000, 1.000000, 1.000000) + mul r0.w, r4.w, r4.z + mad r0.w, r4.x, r4.y, r0.w + mad r0.w, -r0.w, l(0.250000), l(1.000000) + mul r4.xyz, r0.wwww, r2.xyzx + movc r3.xyz, r0.yyyy, r4.xyzx, r2.xyzx +endif +dp3 r0.y, cb0[33].xyzx, r1.xyzx +mul r0.z, r0.z, -r0.y +max r0.z, r0.z, l(0.000000) +mul r1.xyz, r0.zzzz, r3.xyzx +mul r2.xyz, r3.xyzx, l(4.000000, 4.000000, 4.000000, 0.000000) +mad r0.yzw, r0.yyyy, l(0.000000, -0.500000, -0.500000, -1.000000), l(0.000000, 0.500000, 0.500000, 0.000000) +mad r0.yzw, r0.yyzw, l(0.000000, 0.020000, 0.012500, 0.007500), l(0.000000, 0.025000, 0.025000, 0.030000) +mul r0.yzw, r0.yyzw, r2.xxyz +mul r0.yzw, r0.xxxx, r0.yyzw +mad r0.xyz, r1.xyzx, r0.xxxx, r0.yzwy +mul r0.w, v8.z, cb0[17].w +mul r0.w, r0.w, l(1.442695) +exp r0.w, r0.w +add r0.xyz, r0.xyzx, -cb0[17].xyzx +mad r0.xyz, r0.wwww, r0.xyzx, cb0[17].xyzx +log r0.xyz, |r0.xyzx| +mul r0.xyz, r0.xyzx, l(0.454545, 0.454545, 0.454545, 0.000000) +exp o0.xyz, r0.xyzx +mov o0.w, l(1.000000) +ret +// Approximately 179 instruction slots used +#endif + +const BYTE g_meshPS[] = +{ + 68, 88, 66, 67, 72, 67, + 173, 99, 108, 111, 205, 171, + 203, 27, 188, 233, 104, 15, + 95, 167, 1, 0, 0, 0, + 40, 30, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, + 148, 4, 0, 0, 184, 5, + 0, 0, 236, 5, 0, 0, + 140, 29, 0, 0, 82, 68, + 69, 70, 88, 4, 0, 0, + 1, 0, 0, 0, 196, 0, + 0, 0, 3, 0, 0, 0, + 60, 0, 0, 0, 0, 5, + 255, 255, 0, 1, 0, 0, + 36, 4, 0, 0, 82, 68, + 49, 49, 60, 0, 0, 0, + 24, 0, 0, 0, 32, 0, + 0, 0, 40, 0, 0, 0, + 36, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 156, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 3, 0, + 0, 0, 170, 0, 0, 0, + 2, 0, 0, 0, 5, 0, + 0, 0, 4, 0, 0, 0, + 255, 255, 255, 255, 0, 0, + 0, 0, 1, 0, 0, 0, + 1, 0, 0, 0, 184, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 1, 0, 0, 0, + 115, 104, 97, 100, 111, 119, + 83, 97, 109, 112, 108, 101, + 114, 0, 115, 104, 97, 100, + 111, 119, 84, 101, 120, 116, + 117, 114, 101, 0, 99, 111, + 110, 115, 116, 66, 117, 102, + 0, 171, 171, 171, 184, 0, + 0, 0, 1, 0, 0, 0, + 220, 0, 0, 0, 64, 2, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 4, 1, + 0, 0, 0, 0, 0, 0, + 64, 2, 0, 0, 2, 0, + 0, 0, 0, 4, 0, 0, + 0, 0, 0, 0, 255, 255, + 255, 255, 0, 0, 0, 0, + 255, 255, 255, 255, 0, 0, + 0, 0, 103, 80, 97, 114, + 97, 109, 115, 0, 77, 101, + 115, 104, 83, 104, 97, 100, + 101, 114, 67, 111, 110, 115, + 116, 0, 109, 111, 100, 101, + 108, 86, 105, 101, 119, 80, + 114, 111, 106, 101, 99, 116, + 105, 111, 110, 0, 102, 108, + 111, 97, 116, 52, 120, 52, + 0, 171, 171, 171, 3, 0, + 3, 0, 4, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 48, 1, 0, 0, 109, 111, + 100, 101, 108, 86, 105, 101, + 119, 0, 111, 98, 106, 101, + 99, 116, 84, 114, 97, 110, + 115, 102, 111, 114, 109, 0, + 108, 105, 103, 104, 116, 84, + 114, 97, 110, 115, 102, 111, + 114, 109, 0, 99, 108, 105, + 112, 80, 108, 97, 110, 101, + 0, 102, 108, 111, 97, 116, + 52, 0, 171, 171, 1, 0, + 3, 0, 1, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 147, 1, 0, 0, 102, 111, + 103, 67, 111, 108, 111, 114, + 0, 99, 111, 108, 111, 114, + 0, 115, 101, 99, 111, 110, + 100, 97, 114, 121, 67, 111, + 108, 111, 114, 0, 115, 104, + 97, 100, 111, 119, 84, 97, + 112, 115, 0, 171, 171, 171, + 1, 0, 3, 0, 1, 0, + 4, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 147, 1, 0, 0, + 108, 105, 103, 104, 116, 80, + 111, 115, 0, 102, 108, 111, + 97, 116, 51, 0, 1, 0, + 3, 0, 1, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 25, 2, 0, 0, 95, 112, + 97, 100, 48, 0, 102, 108, + 111, 97, 116, 0, 0, 0, + 3, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 74, 2, 0, 0, 108, 105, + 103, 104, 116, 68, 105, 114, + 0, 95, 112, 97, 100, 49, + 0, 98, 105, 97, 115, 0, + 101, 120, 112, 97, 110, 100, + 0, 115, 112, 111, 116, 77, + 105, 110, 0, 115, 112, 111, + 116, 77, 97, 120, 0, 103, + 114, 105, 100, 0, 105, 110, + 116, 0, 0, 0, 2, 0, + 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 164, 2, + 0, 0, 116, 101, 120, 0, + 99, 111, 108, 111, 114, 65, + 114, 114, 97, 121, 0, 105, + 110, 99, 114, 101, 97, 115, + 101, 71, 102, 120, 76, 111, + 97, 100, 70, 111, 114, 65, + 115, 121, 110, 99, 67, 111, + 109, 112, 117, 116, 101, 84, + 101, 115, 116, 105, 110, 103, + 0, 171, 171, 171, 28, 1, + 0, 0, 60, 1, 0, 0, + 0, 0, 0, 0, 96, 1, + 0, 0, 60, 1, 0, 0, + 64, 0, 0, 0, 106, 1, + 0, 0, 60, 1, 0, 0, + 128, 0, 0, 0, 122, 1, + 0, 0, 60, 1, 0, 0, + 192, 0, 0, 0, 137, 1, + 0, 0, 156, 1, 0, 0, + 0, 1, 0, 0, 192, 1, + 0, 0, 156, 1, 0, 0, + 16, 1, 0, 0, 201, 1, + 0, 0, 156, 1, 0, 0, + 32, 1, 0, 0, 207, 1, + 0, 0, 156, 1, 0, 0, + 48, 1, 0, 0, 222, 1, + 0, 0, 236, 1, 0, 0, + 64, 1, 0, 0, 16, 2, + 0, 0, 32, 2, 0, 0, + 0, 2, 0, 0, 68, 2, + 0, 0, 80, 2, 0, 0, + 12, 2, 0, 0, 116, 2, + 0, 0, 32, 2, 0, 0, + 16, 2, 0, 0, 125, 2, + 0, 0, 80, 2, 0, 0, + 28, 2, 0, 0, 131, 2, + 0, 0, 80, 2, 0, 0, + 32, 2, 0, 0, 136, 2, + 0, 0, 80, 2, 0, 0, + 36, 2, 0, 0, 143, 2, + 0, 0, 80, 2, 0, 0, + 40, 2, 0, 0, 151, 2, + 0, 0, 80, 2, 0, 0, + 44, 2, 0, 0, 159, 2, + 0, 0, 168, 2, 0, 0, + 48, 2, 0, 0, 204, 2, + 0, 0, 168, 2, 0, 0, + 52, 2, 0, 0, 208, 2, + 0, 0, 168, 2, 0, 0, + 56, 2, 0, 0, 219, 2, + 0, 0, 168, 2, 0, 0, + 60, 2, 0, 0, 5, 0, + 0, 0, 1, 0, 144, 0, + 0, 0, 21, 0, 4, 3, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 12, 1, 0, 0, 77, 105, + 99, 114, 111, 115, 111, 102, + 116, 32, 40, 82, 41, 32, + 72, 76, 83, 76, 32, 83, + 104, 97, 100, 101, 114, 32, + 67, 111, 109, 112, 105, 108, + 101, 114, 32, 54, 46, 51, + 46, 57, 54, 48, 48, 46, + 49, 54, 51, 56, 52, 0, + 171, 171, 73, 83, 71, 78, + 28, 1, 0, 0, 10, 0, + 0, 0, 8, 0, 0, 0, + 248, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 15, 0, 0, 0, + 4, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 1, 0, + 0, 0, 7, 7, 0, 0, + 4, 1, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 2, 0, + 0, 0, 15, 15, 0, 0, + 4, 1, 0, 0, 2, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 3, 0, + 0, 0, 7, 0, 0, 0, + 4, 1, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 4, 0, + 0, 0, 7, 7, 0, 0, + 4, 1, 0, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 5, 0, + 0, 0, 15, 7, 0, 0, + 4, 1, 0, 0, 5, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 6, 0, + 0, 0, 3, 0, 0, 0, + 4, 1, 0, 0, 6, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 7, 0, + 0, 0, 15, 7, 0, 0, + 4, 1, 0, 0, 7, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 8, 0, + 0, 0, 15, 4, 0, 0, + 13, 1, 0, 0, 0, 0, + 0, 0, 9, 0, 0, 0, + 1, 0, 0, 0, 9, 0, + 0, 0, 1, 1, 0, 0, + 83, 86, 95, 80, 79, 83, + 73, 84, 73, 79, 78, 0, + 84, 69, 88, 67, 79, 79, + 82, 68, 0, 83, 86, 95, + 73, 115, 70, 114, 111, 110, + 116, 70, 97, 99, 101, 0, + 79, 83, 71, 78, 44, 0, + 0, 0, 1, 0, 0, 0, + 8, 0, 0, 0, 32, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 83, 86, + 95, 84, 65, 82, 71, 69, + 84, 0, 171, 171, 83, 72, + 69, 88, 152, 23, 0, 0, + 80, 0, 0, 0, 230, 5, + 0, 0, 106, 8, 0, 1, + 89, 0, 0, 4, 70, 142, + 32, 0, 0, 0, 0, 0, + 36, 0, 0, 0, 90, 8, + 0, 3, 0, 96, 16, 0, + 0, 0, 0, 0, 88, 24, + 0, 4, 0, 112, 16, 0, + 0, 0, 0, 0, 85, 85, + 0, 0, 98, 16, 0, 3, + 114, 16, 16, 0, 1, 0, + 0, 0, 98, 16, 0, 3, + 242, 16, 16, 0, 2, 0, + 0, 0, 98, 16, 0, 3, + 114, 16, 16, 0, 4, 0, + 0, 0, 98, 16, 0, 3, + 114, 16, 16, 0, 5, 0, + 0, 0, 98, 16, 0, 3, + 114, 16, 16, 0, 7, 0, + 0, 0, 98, 16, 0, 3, + 66, 16, 16, 0, 8, 0, + 0, 0, 99, 8, 0, 4, + 18, 16, 16, 0, 9, 0, + 0, 0, 9, 0, 0, 0, + 101, 0, 0, 3, 242, 32, + 16, 0, 0, 0, 0, 0, + 104, 0, 0, 2, 6, 0, + 0, 0, 14, 0, 0, 7, + 114, 0, 16, 0, 0, 0, + 0, 0, 70, 18, 16, 0, + 2, 0, 0, 0, 246, 31, + 16, 0, 2, 0, 0, 0, + 50, 0, 0, 15, 114, 0, + 16, 0, 1, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 63, 0, 0, + 0, 63, 0, 0, 128, 63, + 0, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 63, + 0, 0, 0, 63, 0, 0, + 0, 0, 0, 0, 0, 0, + 49, 0, 0, 7, 66, 0, + 16, 0, 0, 0, 0, 0, + 10, 0, 16, 0, 1, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 0, 0, 49, 0, + 0, 7, 130, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 10, 0, 16, 0, 1, 0, + 0, 0, 60, 0, 0, 7, + 66, 0, 16, 0, 0, 0, + 0, 0, 58, 0, 16, 0, + 0, 0, 0, 0, 42, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 0, 9, 130, 0, + 16, 0, 0, 0, 0, 0, + 26, 128, 32, 128, 65, 0, + 0, 0, 0, 0, 0, 0, + 20, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 56, 0, 0, 8, 18, 0, + 16, 0, 2, 0, 0, 0, + 10, 128, 32, 0, 0, 0, + 0, 0, 20, 0, 0, 0, + 1, 64, 0, 0, 111, 18, + 3, 59, 56, 0, 0, 7, + 34, 0, 16, 0, 2, 0, + 0, 0, 58, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 3, 59, + 0, 0, 0, 8, 130, 0, + 16, 0, 1, 0, 0, 0, + 26, 0, 16, 128, 65, 0, + 0, 0, 1, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 0, 0, 0, 7, + 50, 0, 16, 0, 2, 0, + 0, 0, 198, 0, 16, 0, + 1, 0, 0, 0, 70, 0, + 16, 0, 2, 0, 0, 0, + 70, 0, 0, 141, 194, 0, + 0, 128, 67, 85, 21, 0, + 130, 0, 16, 0, 0, 0, + 0, 0, 70, 0, 16, 0, + 2, 0, 0, 0, 6, 112, + 16, 0, 0, 0, 0, 0, + 0, 96, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 1, 0, 0, 0, 0, 0, + 0, 9, 18, 0, 16, 0, + 2, 0, 0, 0, 26, 128, + 32, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 21, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 56, 0, + 0, 8, 18, 0, 16, 0, + 3, 0, 0, 0, 10, 128, + 32, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 3, 59, + 56, 0, 0, 7, 34, 0, + 16, 0, 3, 0, 0, 0, + 10, 0, 16, 0, 2, 0, + 0, 0, 1, 64, 0, 0, + 111, 18, 3, 59, 0, 0, + 0, 7, 50, 0, 16, 0, + 2, 0, 0, 0, 198, 0, + 16, 0, 1, 0, 0, 0, + 70, 0, 16, 0, 3, 0, + 0, 0, 70, 0, 0, 141, + 194, 0, 0, 128, 67, 85, + 21, 0, 18, 0, 16, 0, + 2, 0, 0, 0, 70, 0, + 16, 0, 2, 0, 0, 0, + 6, 112, 16, 0, 0, 0, + 0, 0, 0, 96, 16, 0, + 0, 0, 0, 0, 42, 0, + 16, 0, 1, 0, 0, 0, + 0, 0, 0, 9, 34, 0, + 16, 0, 2, 0, 0, 0, + 26, 128, 32, 128, 65, 0, + 0, 0, 0, 0, 0, 0, + 22, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 56, 0, 0, 8, 18, 0, + 16, 0, 3, 0, 0, 0, + 10, 128, 32, 0, 0, 0, + 0, 0, 22, 0, 0, 0, + 1, 64, 0, 0, 111, 18, + 3, 59, 56, 0, 0, 7, + 34, 0, 16, 0, 3, 0, + 0, 0, 26, 0, 16, 0, + 2, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 3, 59, + 0, 0, 0, 7, 98, 0, + 16, 0, 2, 0, 0, 0, + 6, 3, 16, 0, 1, 0, + 0, 0, 6, 1, 16, 0, + 3, 0, 0, 0, 70, 0, + 0, 141, 194, 0, 0, 128, + 67, 85, 21, 0, 34, 0, + 16, 0, 2, 0, 0, 0, + 150, 5, 16, 0, 2, 0, + 0, 0, 6, 112, 16, 0, + 0, 0, 0, 0, 0, 96, + 16, 0, 0, 0, 0, 0, + 42, 0, 16, 0, 1, 0, + 0, 0, 0, 0, 0, 9, + 66, 0, 16, 0, 2, 0, + 0, 0, 26, 128, 32, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 23, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 56, 0, 0, 8, + 18, 0, 16, 0, 3, 0, + 0, 0, 10, 128, 32, 0, + 0, 0, 0, 0, 23, 0, + 0, 0, 1, 64, 0, 0, + 111, 18, 3, 59, 56, 0, + 0, 7, 34, 0, 16, 0, + 3, 0, 0, 0, 42, 0, + 16, 0, 2, 0, 0, 0, + 1, 64, 0, 0, 111, 18, + 3, 59, 0, 0, 0, 7, + 194, 0, 16, 0, 2, 0, + 0, 0, 6, 12, 16, 0, + 1, 0, 0, 0, 6, 4, + 16, 0, 3, 0, 0, 0, + 70, 0, 0, 141, 194, 0, + 0, 128, 67, 85, 21, 0, + 66, 0, 16, 0, 2, 0, + 0, 0, 230, 10, 16, 0, + 2, 0, 0, 0, 6, 112, + 16, 0, 0, 0, 0, 0, + 0, 96, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 1, 0, 0, 0, 0, 0, + 0, 9, 130, 0, 16, 0, + 2, 0, 0, 0, 26, 128, + 32, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 24, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 56, 0, + 0, 8, 18, 0, 16, 0, + 3, 0, 0, 0, 10, 128, + 32, 0, 0, 0, 0, 0, + 24, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 3, 59, + 56, 0, 0, 7, 34, 0, + 16, 0, 3, 0, 0, 0, + 58, 0, 16, 0, 2, 0, + 0, 0, 1, 64, 0, 0, + 111, 18, 3, 59, 0, 0, + 0, 7, 50, 0, 16, 0, + 3, 0, 0, 0, 198, 0, + 16, 0, 1, 0, 0, 0, + 70, 0, 16, 0, 3, 0, + 0, 0, 70, 0, 0, 141, + 194, 0, 0, 128, 67, 85, + 21, 0, 130, 0, 16, 0, + 2, 0, 0, 0, 70, 0, + 16, 0, 3, 0, 0, 0, + 6, 112, 16, 0, 0, 0, + 0, 0, 0, 96, 16, 0, + 0, 0, 0, 0, 42, 0, + 16, 0, 1, 0, 0, 0, + 0, 0, 0, 9, 18, 0, + 16, 0, 3, 0, 0, 0, + 26, 128, 32, 128, 65, 0, + 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 56, 0, 0, 8, 18, 0, + 16, 0, 4, 0, 0, 0, + 10, 128, 32, 0, 0, 0, + 0, 0, 25, 0, 0, 0, + 1, 64, 0, 0, 111, 18, + 3, 59, 56, 0, 0, 7, + 34, 0, 16, 0, 4, 0, + 0, 0, 10, 0, 16, 0, + 3, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 3, 59, + 0, 0, 0, 7, 50, 0, + 16, 0, 3, 0, 0, 0, + 198, 0, 16, 0, 1, 0, + 0, 0, 70, 0, 16, 0, + 4, 0, 0, 0, 70, 0, + 0, 141, 194, 0, 0, 128, + 67, 85, 21, 0, 18, 0, + 16, 0, 3, 0, 0, 0, + 70, 0, 16, 0, 3, 0, + 0, 0, 6, 112, 16, 0, + 0, 0, 0, 0, 0, 96, + 16, 0, 0, 0, 0, 0, + 42, 0, 16, 0, 1, 0, + 0, 0, 0, 0, 0, 9, + 34, 0, 16, 0, 3, 0, + 0, 0, 26, 128, 32, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 26, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 56, 0, 0, 8, + 18, 0, 16, 0, 4, 0, + 0, 0, 10, 128, 32, 0, + 0, 0, 0, 0, 26, 0, + 0, 0, 1, 64, 0, 0, + 111, 18, 3, 59, 56, 0, + 0, 7, 34, 0, 16, 0, + 4, 0, 0, 0, 26, 0, + 16, 0, 3, 0, 0, 0, + 1, 64, 0, 0, 111, 18, + 3, 59, 0, 0, 0, 7, + 98, 0, 16, 0, 3, 0, + 0, 0, 6, 3, 16, 0, + 1, 0, 0, 0, 6, 1, + 16, 0, 4, 0, 0, 0, + 70, 0, 0, 141, 194, 0, + 0, 128, 67, 85, 21, 0, + 34, 0, 16, 0, 3, 0, + 0, 0, 150, 5, 16, 0, + 3, 0, 0, 0, 6, 112, + 16, 0, 0, 0, 0, 0, + 0, 96, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 1, 0, 0, 0, 0, 0, + 0, 9, 66, 0, 16, 0, + 3, 0, 0, 0, 26, 128, + 32, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 27, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 56, 0, + 0, 8, 18, 0, 16, 0, + 4, 0, 0, 0, 10, 128, + 32, 0, 0, 0, 0, 0, + 27, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 3, 59, + 56, 0, 0, 7, 34, 0, + 16, 0, 4, 0, 0, 0, + 42, 0, 16, 0, 3, 0, + 0, 0, 1, 64, 0, 0, + 111, 18, 3, 59, 0, 0, + 0, 7, 194, 0, 16, 0, + 3, 0, 0, 0, 6, 12, + 16, 0, 1, 0, 0, 0, + 6, 4, 16, 0, 4, 0, + 0, 0, 70, 0, 0, 141, + 194, 0, 0, 128, 67, 85, + 21, 0, 66, 0, 16, 0, + 3, 0, 0, 0, 230, 10, + 16, 0, 3, 0, 0, 0, + 6, 112, 16, 0, 0, 0, + 0, 0, 0, 96, 16, 0, + 0, 0, 0, 0, 42, 0, + 16, 0, 1, 0, 0, 0, + 0, 0, 0, 9, 130, 0, + 16, 0, 3, 0, 0, 0, + 26, 128, 32, 128, 65, 0, + 0, 0, 0, 0, 0, 0, + 28, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 56, 0, 0, 8, 18, 0, + 16, 0, 4, 0, 0, 0, + 10, 128, 32, 0, 0, 0, + 0, 0, 28, 0, 0, 0, + 1, 64, 0, 0, 111, 18, + 3, 59, 56, 0, 0, 7, + 34, 0, 16, 0, 4, 0, + 0, 0, 58, 0, 16, 0, + 3, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 3, 59, + 0, 0, 0, 7, 50, 0, + 16, 0, 4, 0, 0, 0, + 198, 0, 16, 0, 1, 0, + 0, 0, 70, 0, 16, 0, + 4, 0, 0, 0, 70, 0, + 0, 141, 194, 0, 0, 128, + 67, 85, 21, 0, 130, 0, + 16, 0, 3, 0, 0, 0, + 70, 0, 16, 0, 4, 0, + 0, 0, 6, 112, 16, 0, + 0, 0, 0, 0, 0, 96, + 16, 0, 0, 0, 0, 0, + 42, 0, 16, 0, 1, 0, + 0, 0, 0, 0, 0, 9, + 18, 0, 16, 0, 4, 0, + 0, 0, 26, 128, 32, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 29, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 56, 0, 0, 8, + 18, 0, 16, 0, 5, 0, + 0, 0, 10, 128, 32, 0, + 0, 0, 0, 0, 29, 0, + 0, 0, 1, 64, 0, 0, + 111, 18, 3, 59, 56, 0, + 0, 7, 34, 0, 16, 0, + 5, 0, 0, 0, 10, 0, + 16, 0, 4, 0, 0, 0, + 1, 64, 0, 0, 111, 18, + 3, 59, 0, 0, 0, 7, + 50, 0, 16, 0, 4, 0, + 0, 0, 198, 0, 16, 0, + 1, 0, 0, 0, 70, 0, + 16, 0, 5, 0, 0, 0, + 70, 0, 0, 141, 194, 0, + 0, 128, 67, 85, 21, 0, + 18, 0, 16, 0, 4, 0, + 0, 0, 70, 0, 16, 0, + 4, 0, 0, 0, 6, 112, + 16, 0, 0, 0, 0, 0, + 0, 96, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 1, 0, 0, 0, 0, 0, + 0, 9, 34, 0, 16, 0, + 4, 0, 0, 0, 26, 128, + 32, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 30, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 56, 0, + 0, 8, 18, 0, 16, 0, + 5, 0, 0, 0, 10, 128, + 32, 0, 0, 0, 0, 0, + 30, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 3, 59, + 56, 0, 0, 7, 34, 0, + 16, 0, 5, 0, 0, 0, + 26, 0, 16, 0, 4, 0, + 0, 0, 1, 64, 0, 0, + 111, 18, 3, 59, 0, 0, + 0, 7, 98, 0, 16, 0, + 4, 0, 0, 0, 6, 3, + 16, 0, 1, 0, 0, 0, + 6, 1, 16, 0, 5, 0, + 0, 0, 70, 0, 0, 141, + 194, 0, 0, 128, 67, 85, + 21, 0, 34, 0, 16, 0, + 4, 0, 0, 0, 150, 5, + 16, 0, 4, 0, 0, 0, + 6, 112, 16, 0, 0, 0, + 0, 0, 0, 96, 16, 0, + 0, 0, 0, 0, 42, 0, + 16, 0, 1, 0, 0, 0, + 0, 0, 0, 9, 66, 0, + 16, 0, 4, 0, 0, 0, + 26, 128, 32, 128, 65, 0, + 0, 0, 0, 0, 0, 0, + 31, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 56, 0, 0, 8, 18, 0, + 16, 0, 5, 0, 0, 0, + 10, 128, 32, 0, 0, 0, + 0, 0, 31, 0, 0, 0, + 1, 64, 0, 0, 111, 18, + 3, 59, 56, 0, 0, 7, + 34, 0, 16, 0, 5, 0, + 0, 0, 42, 0, 16, 0, + 4, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 3, 59, + 0, 0, 0, 7, 146, 0, + 16, 0, 1, 0, 0, 0, + 6, 12, 16, 0, 1, 0, + 0, 0, 6, 4, 16, 0, + 5, 0, 0, 0, 70, 0, + 0, 141, 194, 0, 0, 128, + 67, 85, 21, 0, 18, 0, + 16, 0, 1, 0, 0, 0, + 198, 0, 16, 0, 1, 0, + 0, 0, 6, 112, 16, 0, + 0, 0, 0, 0, 0, 96, + 16, 0, 0, 0, 0, 0, + 42, 0, 16, 0, 1, 0, + 0, 0, 31, 0, 0, 3, + 42, 0, 16, 0, 0, 0, + 0, 0, 49, 0, 0, 7, + 66, 0, 16, 0, 0, 0, + 0, 0, 26, 0, 16, 0, + 1, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 0, + 49, 0, 0, 7, 34, 0, + 16, 0, 1, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 26, 0, 16, 0, + 1, 0, 0, 0, 60, 0, + 0, 7, 66, 0, 16, 0, + 0, 0, 0, 0, 42, 0, + 16, 0, 0, 0, 0, 0, + 26, 0, 16, 0, 1, 0, + 0, 0, 31, 0, 0, 3, + 42, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 7, + 66, 0, 16, 0, 0, 0, + 0, 0, 58, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 2, 0, 0, 0, + 0, 0, 0, 7, 66, 0, + 16, 0, 0, 0, 0, 0, + 26, 0, 16, 0, 2, 0, + 0, 0, 42, 0, 16, 0, + 0, 0, 0, 0, 0, 0, + 0, 7, 66, 0, 16, 0, + 0, 0, 0, 0, 42, 0, + 16, 0, 2, 0, 0, 0, + 42, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 7, + 66, 0, 16, 0, 0, 0, + 0, 0, 58, 0, 16, 0, + 2, 0, 0, 0, 42, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 0, 7, 66, 0, + 16, 0, 0, 0, 0, 0, + 10, 0, 16, 0, 3, 0, + 0, 0, 42, 0, 16, 0, + 0, 0, 0, 0, 0, 0, + 0, 7, 66, 0, 16, 0, + 0, 0, 0, 0, 26, 0, + 16, 0, 3, 0, 0, 0, + 42, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 7, + 66, 0, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 3, 0, 0, 0, 42, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 0, 7, 66, 0, + 16, 0, 0, 0, 0, 0, + 58, 0, 16, 0, 3, 0, + 0, 0, 42, 0, 16, 0, + 0, 0, 0, 0, 0, 0, + 0, 7, 66, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 4, 0, 0, 0, + 42, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 7, + 66, 0, 16, 0, 0, 0, + 0, 0, 26, 0, 16, 0, + 4, 0, 0, 0, 42, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 0, 7, 66, 0, + 16, 0, 0, 0, 0, 0, + 10, 0, 16, 0, 1, 0, + 0, 0, 42, 0, 16, 0, + 0, 0, 0, 0, 56, 0, + 0, 7, 66, 0, 16, 0, + 0, 0, 0, 0, 42, 0, + 16, 0, 0, 0, 0, 0, + 1, 64, 0, 0, 171, 170, + 170, 61, 18, 0, 0, 1, + 54, 0, 0, 5, 66, 0, + 16, 0, 0, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 21, 0, 0, 1, + 18, 0, 0, 1, 54, 0, + 0, 5, 66, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 21, 0, 0, 1, 15, 0, + 0, 7, 18, 0, 16, 0, + 0, 0, 0, 0, 70, 0, + 16, 0, 0, 0, 0, 0, + 70, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 10, + 34, 0, 16, 0, 0, 0, + 0, 0, 58, 128, 32, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 34, 0, 0, 0, + 42, 128, 32, 0, 0, 0, + 0, 0, 34, 0, 0, 0, + 0, 0, 0, 9, 18, 0, + 16, 0, 0, 0, 0, 0, + 10, 0, 16, 0, 0, 0, + 0, 0, 58, 128, 32, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 34, 0, 0, 0, + 14, 0, 0, 10, 34, 0, + 16, 0, 0, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 128, 63, 0, 0, 128, 63, + 0, 0, 128, 63, 0, 0, + 128, 63, 26, 0, 16, 0, + 0, 0, 0, 0, 56, 32, + 0, 7, 18, 0, 16, 0, + 0, 0, 0, 0, 26, 0, + 16, 0, 0, 0, 0, 0, + 10, 0, 16, 0, 0, 0, + 0, 0, 50, 0, 0, 9, + 34, 0, 16, 0, 0, 0, + 0, 0, 10, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 192, + 1, 64, 0, 0, 0, 0, + 64, 64, 56, 0, 0, 7, + 18, 0, 16, 0, 0, 0, + 0, 0, 10, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 0, 0, 0, 0, + 56, 0, 0, 7, 18, 0, + 16, 0, 0, 0, 0, 0, + 10, 0, 16, 0, 0, 0, + 0, 0, 26, 0, 16, 0, + 0, 0, 0, 0, 52, 0, + 0, 10, 82, 0, 16, 0, + 0, 0, 0, 0, 6, 2, + 16, 0, 0, 0, 0, 0, + 2, 64, 0, 0, 205, 204, + 76, 61, 0, 0, 0, 0, + 0, 0, 0, 63, 0, 0, + 0, 0, 55, 0, 0, 10, + 114, 0, 16, 0, 1, 0, + 0, 0, 6, 16, 16, 0, + 9, 0, 0, 0, 70, 18, + 16, 0, 1, 0, 0, 0, + 70, 18, 16, 128, 65, 0, + 0, 0, 1, 0, 0, 0, + 55, 0, 0, 9, 114, 0, + 16, 0, 2, 0, 0, 0, + 6, 16, 16, 0, 9, 0, + 0, 0, 70, 18, 16, 0, + 5, 0, 0, 0, 70, 18, + 16, 0, 7, 0, 0, 0, + 39, 0, 0, 8, 34, 0, + 16, 0, 0, 0, 0, 0, + 10, 128, 32, 0, 0, 0, + 0, 0, 35, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 0, 0, 49, 0, 0, 7, + 130, 0, 16, 0, 0, 0, + 0, 0, 1, 64, 0, 0, + 82, 184, 126, 63, 26, 0, + 16, 0, 1, 0, 0, 0, + 1, 0, 0, 7, 130, 0, + 16, 0, 0, 0, 0, 0, + 58, 0, 16, 0, 0, 0, + 0, 0, 26, 0, 16, 0, + 0, 0, 0, 0, 31, 0, + 4, 3, 58, 0, 16, 0, + 0, 0, 0, 0, 122, 0, + 0, 5, 50, 0, 16, 0, + 3, 0, 0, 0, 134, 16, + 16, 0, 4, 0, 0, 0, + 124, 0, 0, 5, 194, 0, + 16, 0, 3, 0, 0, 0, + 6, 24, 16, 0, 4, 0, + 0, 0, 52, 0, 0, 9, + 50, 0, 16, 0, 3, 0, + 0, 0, 230, 10, 16, 128, + 129, 0, 0, 0, 3, 0, + 0, 0, 70, 0, 16, 128, + 129, 0, 0, 0, 3, 0, + 0, 0, 52, 0, 0, 7, + 130, 0, 16, 0, 0, 0, + 0, 0, 26, 0, 16, 0, + 3, 0, 0, 0, 10, 0, + 16, 0, 3, 0, 0, 0, + 50, 0, 0, 13, 50, 0, + 16, 0, 3, 0, 0, 0, + 246, 15, 16, 128, 65, 0, + 0, 0, 0, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 63, 0, 0, 0, 63, + 0, 0, 0, 0, 0, 0, + 0, 0, 134, 16, 16, 0, + 4, 0, 0, 0, 50, 0, + 0, 12, 194, 0, 16, 0, + 3, 0, 0, 0, 246, 15, + 16, 0, 0, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 63, 0, 0, + 0, 63, 6, 24, 16, 0, + 4, 0, 0, 0, 56, 0, + 0, 10, 50, 0, 16, 0, + 4, 0, 0, 0, 230, 10, + 16, 0, 3, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 63, 0, 0, 0, 63, + 0, 0, 0, 0, 0, 0, + 0, 0, 65, 0, 0, 5, + 50, 0, 16, 0, 4, 0, + 0, 0, 70, 0, 16, 0, + 4, 0, 0, 0, 50, 0, + 0, 13, 194, 0, 16, 0, + 3, 0, 0, 0, 166, 14, + 16, 0, 3, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 63, 0, 0, + 0, 63, 6, 4, 16, 128, + 65, 0, 0, 0, 4, 0, + 0, 0, 0, 0, 0, 10, + 194, 0, 16, 0, 3, 0, + 0, 0, 166, 14, 16, 0, + 3, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 191, 0, 0, 0, 191, + 52, 0, 0, 10, 194, 0, + 16, 0, 3, 0, 0, 0, + 166, 14, 16, 0, 3, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 0, + 0, 12, 194, 0, 16, 0, + 3, 0, 0, 0, 166, 14, + 16, 0, 3, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 64, 0, 0, + 0, 64, 6, 4, 16, 0, + 4, 0, 0, 0, 56, 0, + 0, 10, 50, 0, 16, 0, + 4, 0, 0, 0, 70, 0, + 16, 0, 3, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 63, 0, 0, 0, 63, + 0, 0, 0, 0, 0, 0, + 0, 0, 65, 0, 0, 5, + 50, 0, 16, 0, 4, 0, + 0, 0, 70, 0, 16, 0, + 4, 0, 0, 0, 50, 0, + 0, 13, 50, 0, 16, 0, + 3, 0, 0, 0, 70, 0, + 16, 0, 3, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 63, 0, 0, 0, 63, + 0, 0, 0, 0, 0, 0, + 0, 0, 70, 0, 16, 128, + 65, 0, 0, 0, 4, 0, + 0, 0, 0, 0, 0, 10, + 50, 0, 16, 0, 3, 0, + 0, 0, 70, 0, 16, 0, + 3, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 191, + 0, 0, 0, 191, 0, 0, + 0, 0, 0, 0, 0, 0, + 52, 0, 0, 10, 50, 0, + 16, 0, 3, 0, 0, 0, + 70, 0, 16, 0, 3, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 0, + 0, 12, 50, 0, 16, 0, + 3, 0, 0, 0, 70, 0, + 16, 0, 3, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 64, 0, 0, 0, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 70, 0, 16, 0, + 4, 0, 0, 0, 0, 0, + 0, 8, 50, 0, 16, 0, + 3, 0, 0, 0, 70, 0, + 16, 128, 65, 0, 0, 0, + 3, 0, 0, 0, 230, 10, + 16, 0, 3, 0, 0, 0, + 14, 0, 0, 7, 50, 0, + 16, 0, 3, 0, 0, 0, + 70, 0, 16, 0, 3, 0, + 0, 0, 246, 15, 16, 0, + 0, 0, 0, 0, 0, 0, + 0, 11, 194, 0, 16, 0, + 3, 0, 0, 0, 6, 4, + 16, 128, 65, 0, 0, 0, + 3, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 128, 63, 0, 0, 128, 63, + 56, 0, 0, 7, 130, 0, + 16, 0, 0, 0, 0, 0, + 58, 0, 16, 0, 3, 0, + 0, 0, 42, 0, 16, 0, + 3, 0, 0, 0, 50, 0, + 0, 9, 130, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 3, 0, 0, 0, + 26, 0, 16, 0, 3, 0, + 0, 0, 58, 0, 16, 0, + 0, 0, 0, 0, 50, 0, + 0, 10, 130, 0, 16, 0, + 0, 0, 0, 0, 58, 0, + 16, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 62, + 1, 64, 0, 0, 0, 0, + 128, 63, 56, 0, 0, 7, + 114, 0, 16, 0, 3, 0, + 0, 0, 246, 15, 16, 0, + 0, 0, 0, 0, 70, 2, + 16, 0, 2, 0, 0, 0, + 18, 0, 0, 1, 49, 0, + 0, 8, 130, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 82, 184, 126, 63, + 42, 0, 16, 128, 129, 0, + 0, 0, 1, 0, 0, 0, + 1, 0, 0, 7, 34, 0, + 16, 0, 0, 0, 0, 0, + 58, 0, 16, 0, 0, 0, + 0, 0, 26, 0, 16, 0, + 0, 0, 0, 0, 122, 0, + 0, 5, 50, 0, 16, 0, + 4, 0, 0, 0, 22, 21, + 16, 0, 4, 0, 0, 0, + 124, 0, 0, 5, 194, 0, + 16, 0, 4, 0, 0, 0, + 86, 17, 16, 0, 4, 0, + 0, 0, 52, 0, 0, 9, + 50, 0, 16, 0, 4, 0, + 0, 0, 230, 10, 16, 128, + 129, 0, 0, 0, 4, 0, + 0, 0, 70, 0, 16, 128, + 129, 0, 0, 0, 4, 0, + 0, 0, 52, 0, 0, 7, + 130, 0, 16, 0, 0, 0, + 0, 0, 26, 0, 16, 0, + 4, 0, 0, 0, 10, 0, + 16, 0, 4, 0, 0, 0, + 50, 0, 0, 13, 50, 0, + 16, 0, 4, 0, 0, 0, + 246, 15, 16, 128, 65, 0, + 0, 0, 0, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 63, 0, 0, 0, 63, + 0, 0, 0, 0, 0, 0, + 0, 0, 22, 21, 16, 0, + 4, 0, 0, 0, 50, 0, + 0, 12, 194, 0, 16, 0, + 4, 0, 0, 0, 246, 15, + 16, 0, 0, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 63, 0, 0, + 0, 63, 86, 17, 16, 0, + 4, 0, 0, 0, 56, 0, + 0, 10, 50, 0, 16, 0, + 5, 0, 0, 0, 230, 10, + 16, 0, 4, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 63, 0, 0, 0, 63, + 0, 0, 0, 0, 0, 0, + 0, 0, 65, 0, 0, 5, + 50, 0, 16, 0, 5, 0, + 0, 0, 70, 0, 16, 0, + 5, 0, 0, 0, 50, 0, + 0, 13, 194, 0, 16, 0, + 4, 0, 0, 0, 166, 14, + 16, 0, 4, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 63, 0, 0, + 0, 63, 6, 4, 16, 128, + 65, 0, 0, 0, 5, 0, + 0, 0, 0, 0, 0, 10, + 194, 0, 16, 0, 4, 0, + 0, 0, 166, 14, 16, 0, + 4, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 191, 0, 0, 0, 191, + 52, 0, 0, 10, 194, 0, + 16, 0, 4, 0, 0, 0, + 166, 14, 16, 0, 4, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 0, + 0, 12, 194, 0, 16, 0, + 4, 0, 0, 0, 166, 14, + 16, 0, 4, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 64, 0, 0, + 0, 64, 6, 4, 16, 0, + 5, 0, 0, 0, 56, 0, + 0, 10, 50, 0, 16, 0, + 5, 0, 0, 0, 70, 0, + 16, 0, 4, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 63, 0, 0, 0, 63, + 0, 0, 0, 0, 0, 0, + 0, 0, 65, 0, 0, 5, + 50, 0, 16, 0, 5, 0, + 0, 0, 70, 0, 16, 0, + 5, 0, 0, 0, 50, 0, + 0, 13, 50, 0, 16, 0, + 4, 0, 0, 0, 70, 0, + 16, 0, 4, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 63, 0, 0, 0, 63, + 0, 0, 0, 0, 0, 0, + 0, 0, 70, 0, 16, 128, + 65, 0, 0, 0, 5, 0, + 0, 0, 0, 0, 0, 10, + 50, 0, 16, 0, 4, 0, + 0, 0, 70, 0, 16, 0, + 4, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 191, + 0, 0, 0, 191, 0, 0, + 0, 0, 0, 0, 0, 0, + 52, 0, 0, 10, 50, 0, + 16, 0, 4, 0, 0, 0, + 70, 0, 16, 0, 4, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 0, + 0, 12, 50, 0, 16, 0, + 4, 0, 0, 0, 70, 0, + 16, 0, 4, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 64, 0, 0, 0, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 70, 0, 16, 0, + 5, 0, 0, 0, 0, 0, + 0, 8, 50, 0, 16, 0, + 4, 0, 0, 0, 70, 0, + 16, 128, 65, 0, 0, 0, + 4, 0, 0, 0, 230, 10, + 16, 0, 4, 0, 0, 0, + 14, 0, 0, 7, 50, 0, + 16, 0, 4, 0, 0, 0, + 70, 0, 16, 0, 4, 0, + 0, 0, 246, 15, 16, 0, + 0, 0, 0, 0, 0, 0, + 0, 11, 194, 0, 16, 0, + 4, 0, 0, 0, 6, 4, + 16, 128, 65, 0, 0, 0, + 4, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 128, 63, 0, 0, 128, 63, + 56, 0, 0, 7, 130, 0, + 16, 0, 0, 0, 0, 0, + 58, 0, 16, 0, 4, 0, + 0, 0, 42, 0, 16, 0, + 4, 0, 0, 0, 50, 0, + 0, 9, 130, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 4, 0, 0, 0, + 26, 0, 16, 0, 4, 0, + 0, 0, 58, 0, 16, 0, + 0, 0, 0, 0, 50, 0, + 0, 10, 130, 0, 16, 0, + 0, 0, 0, 0, 58, 0, + 16, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 62, + 1, 64, 0, 0, 0, 0, + 128, 63, 56, 0, 0, 7, + 114, 0, 16, 0, 4, 0, + 0, 0, 246, 15, 16, 0, + 0, 0, 0, 0, 70, 2, + 16, 0, 2, 0, 0, 0, + 55, 0, 0, 9, 114, 0, + 16, 0, 3, 0, 0, 0, + 86, 5, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 4, 0, 0, 0, 70, 2, + 16, 0, 2, 0, 0, 0, + 21, 0, 0, 1, 16, 0, + 0, 8, 34, 0, 16, 0, + 0, 0, 0, 0, 70, 130, + 32, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 70, 2, + 16, 0, 1, 0, 0, 0, + 56, 0, 0, 8, 66, 0, + 16, 0, 0, 0, 0, 0, + 42, 0, 16, 0, 0, 0, + 0, 0, 26, 0, 16, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 52, 0, 0, 7, + 66, 0, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 0, + 56, 0, 0, 7, 114, 0, + 16, 0, 1, 0, 0, 0, + 166, 10, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 3, 0, 0, 0, 56, 0, + 0, 10, 114, 0, 16, 0, + 2, 0, 0, 0, 70, 2, + 16, 0, 3, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 128, 64, 0, 0, 128, 64, + 0, 0, 128, 64, 0, 0, + 0, 0, 50, 0, 0, 15, + 226, 0, 16, 0, 0, 0, + 0, 0, 86, 5, 16, 0, + 0, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 191, 0, 0, + 0, 191, 0, 0, 128, 191, + 2, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 63, + 0, 0, 0, 63, 0, 0, + 0, 0, 50, 0, 0, 15, + 226, 0, 16, 0, 0, 0, + 0, 0, 86, 14, 16, 0, + 0, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 0, + 11, 215, 163, 60, 206, 204, + 76, 60, 148, 194, 245, 59, + 2, 64, 0, 0, 0, 0, + 0, 0, 205, 204, 204, 60, + 205, 204, 204, 60, 143, 194, + 245, 60, 56, 0, 0, 7, + 226, 0, 16, 0, 0, 0, + 0, 0, 86, 14, 16, 0, + 0, 0, 0, 0, 6, 9, + 16, 0, 2, 0, 0, 0, + 56, 0, 0, 7, 226, 0, + 16, 0, 0, 0, 0, 0, + 6, 0, 16, 0, 0, 0, + 0, 0, 86, 14, 16, 0, + 0, 0, 0, 0, 50, 0, + 0, 9, 114, 0, 16, 0, + 0, 0, 0, 0, 70, 2, + 16, 0, 1, 0, 0, 0, + 6, 0, 16, 0, 0, 0, + 0, 0, 150, 7, 16, 0, + 0, 0, 0, 0, 56, 0, + 0, 8, 130, 0, 16, 0, + 0, 0, 0, 0, 42, 16, + 16, 0, 8, 0, 0, 0, + 58, 128, 32, 0, 0, 0, + 0, 0, 17, 0, 0, 0, + 56, 0, 0, 7, 130, 0, + 16, 0, 0, 0, 0, 0, + 58, 0, 16, 0, 0, 0, + 0, 0, 1, 64, 0, 0, + 59, 170, 184, 63, 25, 0, + 0, 5, 130, 0, 16, 0, + 0, 0, 0, 0, 58, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 0, 9, 114, 0, + 16, 0, 0, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 70, 130, 32, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 17, 0, 0, 0, + 50, 0, 0, 10, 114, 0, + 16, 0, 0, 0, 0, 0, + 246, 15, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 70, 130, + 32, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 47, 0, + 0, 6, 114, 0, 16, 0, + 0, 0, 0, 0, 70, 2, + 16, 128, 129, 0, 0, 0, + 0, 0, 0, 0, 56, 0, + 0, 10, 114, 0, 16, 0, + 0, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 2, 64, 0, 0, 47, 186, + 232, 62, 47, 186, 232, 62, + 47, 186, 232, 62, 0, 0, + 0, 0, 25, 0, 0, 5, + 114, 32, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 54, 0, + 0, 5, 130, 32, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 62, 0, 0, 1, 83, 84, + 65, 84, 148, 0, 0, 0, + 179, 0, 0, 0, 6, 0, + 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 146, 0, + 0, 0, 1, 0, 0, 0, + 4, 0, 0, 0, 4, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 3, 0, 0, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0 +}; diff --git a/demo/d3d/shaders/meshShadowPS.hlsl b/demo/d3d/shaders/meshShadowPS.hlsl new file mode 100644 index 0000000..96d7371 --- /dev/null +++ b/demo/d3d/shaders/meshShadowPS.hlsl @@ -0,0 +1,12 @@ +#include "shaderCommon.h" + +cbuffer constBuf : register(b0) +{ + MeshShaderConst gParams; +}; + + +void meshPS_Shadow(MeshVertexOut input) +{ +} + diff --git a/demo/d3d/shaders/meshShadowPS.hlsl.h b/demo/d3d/shaders/meshShadowPS.hlsl.h new file mode 100644 index 0000000..f921264 --- /dev/null +++ b/demo/d3d/shaders/meshShadowPS.hlsl.h @@ -0,0 +1,139 @@ +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_POSITION 0 xyzw 0 POS float +// TEXCOORD 0 xyz 1 NONE float +// TEXCOORD 1 xyzw 2 NONE float +// TEXCOORD 2 xyz 3 NONE float +// TEXCOORD 3 xyz 4 NONE float +// TEXCOORD 4 xyzw 5 NONE float +// TEXCOORD 5 xy 6 NONE float +// TEXCOORD 6 xyzw 7 NONE float +// TEXCOORD 7 xyzw 8 NONE float +// +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// no Output +ps_5_0 +dcl_globalFlags refactoringAllowed +ret +// Approximately 1 instruction slots used +#endif + +const BYTE g_meshPS_Shadow[] = +{ + 68, 88, 66, 67, 92, 14, + 98, 50, 73, 255, 171, 211, + 114, 130, 157, 79, 70, 204, + 106, 183, 1, 0, 0, 0, + 112, 2, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, + 172, 0, 0, 0, 172, 1, + 0, 0, 188, 1, 0, 0, + 212, 1, 0, 0, 82, 68, + 69, 70, 112, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 60, 0, 0, 0, 0, 5, + 255, 255, 0, 1, 0, 0, + 60, 0, 0, 0, 82, 68, + 49, 49, 60, 0, 0, 0, + 24, 0, 0, 0, 32, 0, + 0, 0, 40, 0, 0, 0, + 36, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 77, 105, 99, 114, 111, 115, + 111, 102, 116, 32, 40, 82, + 41, 32, 72, 76, 83, 76, + 32, 83, 104, 97, 100, 101, + 114, 32, 67, 111, 109, 112, + 105, 108, 101, 114, 32, 54, + 46, 51, 46, 57, 54, 48, + 48, 46, 49, 54, 51, 56, + 52, 0, 171, 171, 73, 83, + 71, 78, 248, 0, 0, 0, + 9, 0, 0, 0, 8, 0, + 0, 0, 224, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 15, 0, + 0, 0, 236, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 7, 0, + 0, 0, 236, 0, 0, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 2, 0, 0, 0, 15, 0, + 0, 0, 236, 0, 0, 0, + 2, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 3, 0, 0, 0, 7, 0, + 0, 0, 236, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 4, 0, 0, 0, 7, 0, + 0, 0, 236, 0, 0, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 5, 0, 0, 0, 15, 0, + 0, 0, 236, 0, 0, 0, + 5, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 6, 0, 0, 0, 3, 0, + 0, 0, 236, 0, 0, 0, + 6, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 7, 0, 0, 0, 15, 0, + 0, 0, 236, 0, 0, 0, + 7, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 8, 0, 0, 0, 15, 0, + 0, 0, 83, 86, 95, 80, + 79, 83, 73, 84, 73, 79, + 78, 0, 84, 69, 88, 67, + 79, 79, 82, 68, 0, 171, + 171, 171, 79, 83, 71, 78, + 8, 0, 0, 0, 0, 0, + 0, 0, 8, 0, 0, 0, + 83, 72, 69, 88, 16, 0, + 0, 0, 80, 0, 0, 0, + 4, 0, 0, 0, 106, 8, + 0, 1, 62, 0, 0, 1, + 83, 84, 65, 84, 148, 0, + 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0 +}; diff --git a/demo/d3d/shaders/meshVS.hlsl b/demo/d3d/shaders/meshVS.hlsl new file mode 100644 index 0000000..d2fa9e5 --- /dev/null +++ b/demo/d3d/shaders/meshVS.hlsl @@ -0,0 +1,35 @@ +#include "shaderCommon.h" + +cbuffer constBuf : register(b0) +{ + MeshShaderConst gParams; +}; + +MeshVertexOut meshVS(MeshVertexIn input) +{ + const float4x4 modelViewProjectionMatrix = gParams.modelViewProjection; + const float4x4 modelViewMatrix = gParams.modelView; + const float4x4 objectTransform = gParams.objectTransform; + const float4x4 lightTransform = gParams.lightTransform; + + float3 n = normalize(mul(objectTransform, float4(input.normal, 0.0)).xyz); + float3 p = mul(objectTransform, float4(input.position.xyz, 1.0)).xyz; + + // calculate window-space point size + MeshVertexOut output; + output.position = mul(modelViewProjectionMatrix, float4(p + gParams.expand * n, 1.0)); + + output.worldNormal = n; + output.lightOffsetPosition = mul(lightTransform, float4(p + n * gParams.bias, 1.0)); + output.viewLightDir = mul(modelViewMatrix, float4(gParams.lightDir, 0.0)); + output.worldPosition = p; + if (gParams.colorArray) + output.color = input.color; + else + output.color = gParams.color; + output.texCoord = float2(input.texCoord.x, 1.0f - input.texCoord.y); // flip the y component of uv (glsl to hlsl conversion) + output.secondaryColor = gParams.secondaryColor; + output.viewPosition = mul(modelViewMatrix, float4(input.position.xyz, 1.0)); + + return output; +} diff --git a/demo/d3d/shaders/meshVS.hlsl.h b/demo/d3d/shaders/meshVS.hlsl.h new file mode 100644 index 0000000..15198ae --- /dev/null +++ b/demo/d3d/shaders/meshVS.hlsl.h @@ -0,0 +1,625 @@ +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// Buffer Definitions: +// +// cbuffer constBuf +// { +// +// struct MeshShaderConst +// { +// +// float4x4 modelViewProjection; // Offset: 0 +// float4x4 modelView; // Offset: 64 +// float4x4 objectTransform; // Offset: 128 +// float4x4 lightTransform; // Offset: 192 +// float4 clipPlane; // Offset: 256 +// float4 fogColor; // Offset: 272 +// float4 color; // Offset: 288 +// float4 secondaryColor; // Offset: 304 +// float4 shadowTaps[12]; // Offset: 320 +// float3 lightPos; // Offset: 512 +// float _pad0; // Offset: 524 +// float3 lightDir; // Offset: 528 +// float _pad1; // Offset: 540 +// float bias; // Offset: 544 +// float expand; // Offset: 548 +// float spotMin; // Offset: 552 +// float spotMax; // Offset: 556 +// int grid; // Offset: 560 +// int tex; // Offset: 564 +// int colorArray; // Offset: 568 +// int increaseGfxLoadForAsyncComputeTesting;// Offset: 572 +// +// } gParams; // Offset: 0 Size: 576 +// +// } +// +// +// Resource Bindings: +// +// Name Type Format Dim Slot Elements +// ------------------------------ ---------- ------- ----------- ---- -------- +// constBuf cbuffer NA NA 0 1 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// POSITION 0 xyz 0 NONE float xyz +// NORMAL 0 xyz 1 NONE float xyz +// TEXCOORD 0 xy 2 NONE float xy +// COLOR 0 xyzw 3 NONE float xyzw +// +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_POSITION 0 xyzw 0 POS float xyzw +// TEXCOORD 0 xyz 1 NONE float xyz +// TEXCOORD 1 xyzw 2 NONE float xyzw +// TEXCOORD 2 xyz 3 NONE float xyz +// TEXCOORD 3 xyz 4 NONE float xyz +// TEXCOORD 4 xyzw 5 NONE float xyzw +// TEXCOORD 5 xy 6 NONE float xy +// TEXCOORD 6 xyzw 7 NONE float xyzw +// TEXCOORD 7 xyzw 8 NONE float xyzw +// +vs_5_0 +dcl_globalFlags refactoringAllowed +dcl_constantbuffer cb0[36], immediateIndexed +dcl_input v0.xyz +dcl_input v1.xyz +dcl_input v2.xy +dcl_input v3.xyzw +dcl_output_siv o0.xyzw, position +dcl_output o1.xyz +dcl_output o2.xyzw +dcl_output o3.xyz +dcl_output o4.xyz +dcl_output o5.xyzw +dcl_output o6.xy +dcl_output o7.xyzw +dcl_output o8.xyzw +dcl_temps 4 +mul r0.xyz, v1.yyyy, cb0[9].xyzx +mad r0.xyz, cb0[8].xyzx, v1.xxxx, r0.xyzx +mad r0.xyz, cb0[10].xyzx, v1.zzzz, r0.xyzx +dp3 r0.w, r0.xyzx, r0.xyzx +rsq r0.w, r0.w +mul r0.xyz, r0.wwww, r0.xyzx +mul r1.xyz, v0.yyyy, cb0[9].xyzx +mad r1.xyz, cb0[8].xyzx, v0.xxxx, r1.xyzx +mad r1.xyz, cb0[10].xyzx, v0.zzzz, r1.xyzx +add r1.xyz, r1.xyzx, cb0[11].xyzx +mad r2.xyz, cb0[34].yyyy, r0.xyzx, r1.xyzx +mul r3.xyzw, r2.yyyy, cb0[1].xyzw +mad r3.xyzw, cb0[0].xyzw, r2.xxxx, r3.xyzw +mad r2.xyzw, cb0[2].xyzw, r2.zzzz, r3.xyzw +add o0.xyzw, r2.xyzw, cb0[3].xyzw +mov o1.xyz, r0.xyzx +mad r0.xyz, r0.xyzx, cb0[34].xxxx, r1.xyzx +mov o4.xyz, r1.xyzx +mul r1.xyzw, r0.yyyy, cb0[13].xyzw +mad r1.xyzw, cb0[12].xyzw, r0.xxxx, r1.xyzw +mad r0.xyzw, cb0[14].xyzw, r0.zzzz, r1.xyzw +add o2.xyzw, r0.xyzw, cb0[15].xyzw +mul r0.xyz, cb0[5].xyzx, cb0[33].yyyy +mad r0.xyz, cb0[4].xyzx, cb0[33].xxxx, r0.xyzx +mad o3.xyz, cb0[6].xyzx, cb0[33].zzzz, r0.xyzx +movc o5.xyzw, cb0[35].zzzz, v3.xyzw, cb0[18].xyzw +mad o6.xy, v2.xyxx, l(1.000000, -1.000000, 0.000000, 0.000000), l(0.000000, 1.000000, 0.000000, 0.000000) +mov o7.xyzw, cb0[19].xyzw +mul r0.xyzw, v0.yyyy, cb0[5].xyzw +mad r0.xyzw, cb0[4].xyzw, v0.xxxx, r0.xyzw +mad r0.xyzw, cb0[6].xyzw, v0.zzzz, r0.xyzw +add o8.xyzw, r0.xyzw, cb0[7].xyzw +ret +// Approximately 33 instruction slots used +#endif + +const BYTE g_meshVS[] = +{ + 68, 88, 66, 67, 224, 200, + 225, 174, 179, 134, 152, 85, + 252, 211, 193, 254, 28, 42, + 106, 184, 1, 0, 0, 0, + 164, 11, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, + 56, 4, 0, 0, 200, 4, + 0, 0, 200, 5, 0, 0, + 8, 11, 0, 0, 82, 68, + 69, 70, 252, 3, 0, 0, + 1, 0, 0, 0, 104, 0, + 0, 0, 1, 0, 0, 0, + 60, 0, 0, 0, 0, 5, + 254, 255, 0, 1, 0, 0, + 200, 3, 0, 0, 82, 68, + 49, 49, 60, 0, 0, 0, + 24, 0, 0, 0, 32, 0, + 0, 0, 40, 0, 0, 0, + 36, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 1, 0, + 0, 0, 99, 111, 110, 115, + 116, 66, 117, 102, 0, 171, + 171, 171, 92, 0, 0, 0, + 1, 0, 0, 0, 128, 0, + 0, 0, 64, 2, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 168, 0, 0, 0, + 0, 0, 0, 0, 64, 2, + 0, 0, 2, 0, 0, 0, + 164, 3, 0, 0, 0, 0, + 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 255, 255, + 255, 255, 0, 0, 0, 0, + 103, 80, 97, 114, 97, 109, + 115, 0, 77, 101, 115, 104, + 83, 104, 97, 100, 101, 114, + 67, 111, 110, 115, 116, 0, + 109, 111, 100, 101, 108, 86, + 105, 101, 119, 80, 114, 111, + 106, 101, 99, 116, 105, 111, + 110, 0, 102, 108, 111, 97, + 116, 52, 120, 52, 0, 171, + 171, 171, 3, 0, 3, 0, + 4, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 212, 0, + 0, 0, 109, 111, 100, 101, + 108, 86, 105, 101, 119, 0, + 111, 98, 106, 101, 99, 116, + 84, 114, 97, 110, 115, 102, + 111, 114, 109, 0, 108, 105, + 103, 104, 116, 84, 114, 97, + 110, 115, 102, 111, 114, 109, + 0, 99, 108, 105, 112, 80, + 108, 97, 110, 101, 0, 102, + 108, 111, 97, 116, 52, 0, + 171, 171, 1, 0, 3, 0, + 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 55, 1, + 0, 0, 102, 111, 103, 67, + 111, 108, 111, 114, 0, 99, + 111, 108, 111, 114, 0, 115, + 101, 99, 111, 110, 100, 97, + 114, 121, 67, 111, 108, 111, + 114, 0, 115, 104, 97, 100, + 111, 119, 84, 97, 112, 115, + 0, 171, 171, 171, 1, 0, + 3, 0, 1, 0, 4, 0, + 12, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 55, 1, 0, 0, 108, 105, + 103, 104, 116, 80, 111, 115, + 0, 102, 108, 111, 97, 116, + 51, 0, 1, 0, 3, 0, + 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 189, 1, + 0, 0, 95, 112, 97, 100, + 48, 0, 102, 108, 111, 97, + 116, 0, 0, 0, 3, 0, + 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 238, 1, + 0, 0, 108, 105, 103, 104, + 116, 68, 105, 114, 0, 95, + 112, 97, 100, 49, 0, 98, + 105, 97, 115, 0, 101, 120, + 112, 97, 110, 100, 0, 115, + 112, 111, 116, 77, 105, 110, + 0, 115, 112, 111, 116, 77, + 97, 120, 0, 103, 114, 105, + 100, 0, 105, 110, 116, 0, + 0, 0, 2, 0, 1, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 72, 2, 0, 0, + 116, 101, 120, 0, 99, 111, + 108, 111, 114, 65, 114, 114, + 97, 121, 0, 105, 110, 99, + 114, 101, 97, 115, 101, 71, + 102, 120, 76, 111, 97, 100, + 70, 111, 114, 65, 115, 121, + 110, 99, 67, 111, 109, 112, + 117, 116, 101, 84, 101, 115, + 116, 105, 110, 103, 0, 171, + 171, 171, 192, 0, 0, 0, + 224, 0, 0, 0, 0, 0, + 0, 0, 4, 1, 0, 0, + 224, 0, 0, 0, 64, 0, + 0, 0, 14, 1, 0, 0, + 224, 0, 0, 0, 128, 0, + 0, 0, 30, 1, 0, 0, + 224, 0, 0, 0, 192, 0, + 0, 0, 45, 1, 0, 0, + 64, 1, 0, 0, 0, 1, + 0, 0, 100, 1, 0, 0, + 64, 1, 0, 0, 16, 1, + 0, 0, 109, 1, 0, 0, + 64, 1, 0, 0, 32, 1, + 0, 0, 115, 1, 0, 0, + 64, 1, 0, 0, 48, 1, + 0, 0, 130, 1, 0, 0, + 144, 1, 0, 0, 64, 1, + 0, 0, 180, 1, 0, 0, + 196, 1, 0, 0, 0, 2, + 0, 0, 232, 1, 0, 0, + 244, 1, 0, 0, 12, 2, + 0, 0, 24, 2, 0, 0, + 196, 1, 0, 0, 16, 2, + 0, 0, 33, 2, 0, 0, + 244, 1, 0, 0, 28, 2, + 0, 0, 39, 2, 0, 0, + 244, 1, 0, 0, 32, 2, + 0, 0, 44, 2, 0, 0, + 244, 1, 0, 0, 36, 2, + 0, 0, 51, 2, 0, 0, + 244, 1, 0, 0, 40, 2, + 0, 0, 59, 2, 0, 0, + 244, 1, 0, 0, 44, 2, + 0, 0, 67, 2, 0, 0, + 76, 2, 0, 0, 48, 2, + 0, 0, 112, 2, 0, 0, + 76, 2, 0, 0, 52, 2, + 0, 0, 116, 2, 0, 0, + 76, 2, 0, 0, 56, 2, + 0, 0, 127, 2, 0, 0, + 76, 2, 0, 0, 60, 2, + 0, 0, 5, 0, 0, 0, + 1, 0, 144, 0, 0, 0, + 21, 0, 168, 2, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 176, 0, + 0, 0, 77, 105, 99, 114, + 111, 115, 111, 102, 116, 32, + 40, 82, 41, 32, 72, 76, + 83, 76, 32, 83, 104, 97, + 100, 101, 114, 32, 67, 111, + 109, 112, 105, 108, 101, 114, + 32, 54, 46, 51, 46, 57, + 54, 48, 48, 46, 49, 54, + 51, 56, 52, 0, 171, 171, + 73, 83, 71, 78, 136, 0, + 0, 0, 4, 0, 0, 0, + 8, 0, 0, 0, 104, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 7, 7, 0, 0, 113, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 1, 0, 0, 0, + 7, 7, 0, 0, 120, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 2, 0, 0, 0, + 3, 3, 0, 0, 129, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 3, 0, 0, 0, + 15, 15, 0, 0, 80, 79, + 83, 73, 84, 73, 79, 78, + 0, 78, 79, 82, 77, 65, + 76, 0, 84, 69, 88, 67, + 79, 79, 82, 68, 0, 67, + 79, 76, 79, 82, 0, 171, + 79, 83, 71, 78, 248, 0, + 0, 0, 9, 0, 0, 0, + 8, 0, 0, 0, 224, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 236, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 1, 0, 0, 0, + 7, 8, 0, 0, 236, 0, + 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 2, 0, 0, 0, + 15, 0, 0, 0, 236, 0, + 0, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 3, 0, 0, 0, + 7, 8, 0, 0, 236, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 4, 0, 0, 0, + 7, 8, 0, 0, 236, 0, + 0, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 5, 0, 0, 0, + 15, 0, 0, 0, 236, 0, + 0, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 6, 0, 0, 0, + 3, 12, 0, 0, 236, 0, + 0, 0, 6, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 7, 0, 0, 0, + 15, 0, 0, 0, 236, 0, + 0, 0, 7, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 8, 0, 0, 0, + 15, 0, 0, 0, 83, 86, + 95, 80, 79, 83, 73, 84, + 73, 79, 78, 0, 84, 69, + 88, 67, 79, 79, 82, 68, + 0, 171, 171, 171, 83, 72, + 69, 88, 56, 5, 0, 0, + 80, 0, 1, 0, 78, 1, + 0, 0, 106, 8, 0, 1, + 89, 0, 0, 4, 70, 142, + 32, 0, 0, 0, 0, 0, + 36, 0, 0, 0, 95, 0, + 0, 3, 114, 16, 16, 0, + 0, 0, 0, 0, 95, 0, + 0, 3, 114, 16, 16, 0, + 1, 0, 0, 0, 95, 0, + 0, 3, 50, 16, 16, 0, + 2, 0, 0, 0, 95, 0, + 0, 3, 242, 16, 16, 0, + 3, 0, 0, 0, 103, 0, + 0, 4, 242, 32, 16, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 101, 0, 0, 3, + 114, 32, 16, 0, 1, 0, + 0, 0, 101, 0, 0, 3, + 242, 32, 16, 0, 2, 0, + 0, 0, 101, 0, 0, 3, + 114, 32, 16, 0, 3, 0, + 0, 0, 101, 0, 0, 3, + 114, 32, 16, 0, 4, 0, + 0, 0, 101, 0, 0, 3, + 242, 32, 16, 0, 5, 0, + 0, 0, 101, 0, 0, 3, + 50, 32, 16, 0, 6, 0, + 0, 0, 101, 0, 0, 3, + 242, 32, 16, 0, 7, 0, + 0, 0, 101, 0, 0, 3, + 242, 32, 16, 0, 8, 0, + 0, 0, 104, 0, 0, 2, + 4, 0, 0, 0, 56, 0, + 0, 8, 114, 0, 16, 0, + 0, 0, 0, 0, 86, 21, + 16, 0, 1, 0, 0, 0, + 70, 130, 32, 0, 0, 0, + 0, 0, 9, 0, 0, 0, + 50, 0, 0, 10, 114, 0, + 16, 0, 0, 0, 0, 0, + 70, 130, 32, 0, 0, 0, + 0, 0, 8, 0, 0, 0, + 6, 16, 16, 0, 1, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 50, 0, + 0, 10, 114, 0, 16, 0, + 0, 0, 0, 0, 70, 130, + 32, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 166, 26, + 16, 0, 1, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 16, 0, 0, 7, + 130, 0, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 68, 0, 0, 5, 130, 0, + 16, 0, 0, 0, 0, 0, + 58, 0, 16, 0, 0, 0, + 0, 0, 56, 0, 0, 7, + 114, 0, 16, 0, 0, 0, + 0, 0, 246, 15, 16, 0, + 0, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 56, 0, 0, 8, 114, 0, + 16, 0, 1, 0, 0, 0, + 86, 21, 16, 0, 0, 0, + 0, 0, 70, 130, 32, 0, + 0, 0, 0, 0, 9, 0, + 0, 0, 50, 0, 0, 10, + 114, 0, 16, 0, 1, 0, + 0, 0, 70, 130, 32, 0, + 0, 0, 0, 0, 8, 0, + 0, 0, 6, 16, 16, 0, + 0, 0, 0, 0, 70, 2, + 16, 0, 1, 0, 0, 0, + 50, 0, 0, 10, 114, 0, + 16, 0, 1, 0, 0, 0, + 70, 130, 32, 0, 0, 0, + 0, 0, 10, 0, 0, 0, + 166, 26, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 1, 0, 0, 0, 0, 0, + 0, 8, 114, 0, 16, 0, + 1, 0, 0, 0, 70, 2, + 16, 0, 1, 0, 0, 0, + 70, 130, 32, 0, 0, 0, + 0, 0, 11, 0, 0, 0, + 50, 0, 0, 10, 114, 0, + 16, 0, 2, 0, 0, 0, + 86, 133, 32, 0, 0, 0, + 0, 0, 34, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 1, 0, 0, 0, 56, 0, + 0, 8, 242, 0, 16, 0, + 3, 0, 0, 0, 86, 5, + 16, 0, 2, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 50, 0, 0, 10, 242, 0, + 16, 0, 3, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 6, 0, 16, 0, 2, 0, + 0, 0, 70, 14, 16, 0, + 3, 0, 0, 0, 50, 0, + 0, 10, 242, 0, 16, 0, + 2, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 166, 10, + 16, 0, 2, 0, 0, 0, + 70, 14, 16, 0, 3, 0, + 0, 0, 0, 0, 0, 8, + 242, 32, 16, 0, 0, 0, + 0, 0, 70, 14, 16, 0, + 2, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 54, 0, + 0, 5, 114, 32, 16, 0, + 1, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 50, 0, 0, 10, 114, 0, + 16, 0, 0, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 6, 128, 32, 0, + 0, 0, 0, 0, 34, 0, + 0, 0, 70, 2, 16, 0, + 1, 0, 0, 0, 54, 0, + 0, 5, 114, 32, 16, 0, + 4, 0, 0, 0, 70, 2, + 16, 0, 1, 0, 0, 0, + 56, 0, 0, 8, 242, 0, + 16, 0, 1, 0, 0, 0, + 86, 5, 16, 0, 0, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 13, 0, + 0, 0, 50, 0, 0, 10, + 242, 0, 16, 0, 1, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 12, 0, + 0, 0, 6, 0, 16, 0, + 0, 0, 0, 0, 70, 14, + 16, 0, 1, 0, 0, 0, + 50, 0, 0, 10, 242, 0, + 16, 0, 0, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 14, 0, 0, 0, + 166, 10, 16, 0, 0, 0, + 0, 0, 70, 14, 16, 0, + 1, 0, 0, 0, 0, 0, + 0, 8, 242, 32, 16, 0, + 2, 0, 0, 0, 70, 14, + 16, 0, 0, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 15, 0, 0, 0, + 56, 0, 0, 9, 114, 0, + 16, 0, 0, 0, 0, 0, + 70, 130, 32, 0, 0, 0, + 0, 0, 5, 0, 0, 0, + 86, 133, 32, 0, 0, 0, + 0, 0, 33, 0, 0, 0, + 50, 0, 0, 11, 114, 0, + 16, 0, 0, 0, 0, 0, + 70, 130, 32, 0, 0, 0, + 0, 0, 4, 0, 0, 0, + 6, 128, 32, 0, 0, 0, + 0, 0, 33, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 50, 0, 0, 11, + 114, 32, 16, 0, 3, 0, + 0, 0, 70, 130, 32, 0, + 0, 0, 0, 0, 6, 0, + 0, 0, 166, 138, 32, 0, + 0, 0, 0, 0, 33, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 55, 0, + 0, 11, 242, 32, 16, 0, + 5, 0, 0, 0, 166, 138, + 32, 0, 0, 0, 0, 0, + 35, 0, 0, 0, 70, 30, + 16, 0, 3, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 18, 0, 0, 0, + 50, 0, 0, 15, 50, 32, + 16, 0, 6, 0, 0, 0, + 70, 16, 16, 0, 2, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 128, 63, 0, 0, + 128, 191, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 128, 63, 0, 0, + 0, 0, 0, 0, 0, 0, + 54, 0, 0, 6, 242, 32, + 16, 0, 7, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 19, 0, 0, 0, + 56, 0, 0, 8, 242, 0, + 16, 0, 0, 0, 0, 0, + 86, 21, 16, 0, 0, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 5, 0, + 0, 0, 50, 0, 0, 10, + 242, 0, 16, 0, 0, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 4, 0, + 0, 0, 6, 16, 16, 0, + 0, 0, 0, 0, 70, 14, + 16, 0, 0, 0, 0, 0, + 50, 0, 0, 10, 242, 0, + 16, 0, 0, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 6, 0, 0, 0, + 166, 26, 16, 0, 0, 0, + 0, 0, 70, 14, 16, 0, + 0, 0, 0, 0, 0, 0, + 0, 8, 242, 32, 16, 0, + 8, 0, 0, 0, 70, 14, + 16, 0, 0, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 7, 0, 0, 0, + 62, 0, 0, 1, 83, 84, + 65, 84, 148, 0, 0, 0, + 33, 0, 0, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 28, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0 +}; diff --git a/demo/d3d/shaders/passThroughVS.hlsl b/demo/d3d/shaders/passThroughVS.hlsl new file mode 100644 index 0000000..f8005d7 --- /dev/null +++ b/demo/d3d/shaders/passThroughVS.hlsl @@ -0,0 +1,14 @@ +#include "shaderCommon.h" + +cbuffer constBuf : register(b0) +{ + FluidShaderConst gParams; +}; + +PassthroughVertexOut passThroughVS(MeshVertexIn input) +{ + PassthroughVertexOut output; + output.position = float4(input.position, 1.0f); + output.texCoord = input.texCoord; + return output; +} diff --git a/demo/d3d/shaders/passThroughVS.hlsl.h b/demo/d3d/shaders/passThroughVS.hlsl.h new file mode 100644 index 0000000..3ff9109 --- /dev/null +++ b/demo/d3d/shaders/passThroughVS.hlsl.h @@ -0,0 +1,155 @@ +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// POSITION 0 xyz 0 NONE float xyz +// NORMAL 0 xyz 1 NONE float +// TEXCOORD 0 xy 2 NONE float xy +// COLOR 0 xyzw 3 NONE float +// +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_POSITION 0 xyzw 0 POS float xyzw +// TEXCOORD 0 xy 1 NONE float xy +// +vs_5_0 +dcl_globalFlags refactoringAllowed +dcl_input v0.xyz +dcl_input v2.xy +dcl_output_siv o0.xyzw, position +dcl_output o1.xy +mov o0.xyz, v0.xyzx +mov o0.w, l(1.000000) +mov o1.xy, v2.xyxx +ret +// Approximately 4 instruction slots used +#endif + +const BYTE g_passThroughVS[] = +{ + 68, 88, 66, 67, 185, 168, + 119, 184, 113, 66, 215, 46, + 63, 211, 78, 140, 226, 35, + 139, 164, 1, 0, 0, 0, + 184, 2, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, + 172, 0, 0, 0, 60, 1, + 0, 0, 148, 1, 0, 0, + 28, 2, 0, 0, 82, 68, + 69, 70, 112, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 60, 0, 0, 0, 0, 5, + 254, 255, 0, 1, 0, 0, + 60, 0, 0, 0, 82, 68, + 49, 49, 60, 0, 0, 0, + 24, 0, 0, 0, 32, 0, + 0, 0, 40, 0, 0, 0, + 36, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 77, 105, 99, 114, 111, 115, + 111, 102, 116, 32, 40, 82, + 41, 32, 72, 76, 83, 76, + 32, 83, 104, 97, 100, 101, + 114, 32, 67, 111, 109, 112, + 105, 108, 101, 114, 32, 54, + 46, 51, 46, 57, 54, 48, + 48, 46, 49, 54, 51, 56, + 52, 0, 171, 171, 73, 83, + 71, 78, 136, 0, 0, 0, + 4, 0, 0, 0, 8, 0, + 0, 0, 104, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 7, 7, + 0, 0, 113, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 7, 0, + 0, 0, 120, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 2, 0, 0, 0, 3, 3, + 0, 0, 129, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 3, 0, 0, 0, 15, 0, + 0, 0, 80, 79, 83, 73, + 84, 73, 79, 78, 0, 78, + 79, 82, 77, 65, 76, 0, + 84, 69, 88, 67, 79, 79, + 82, 68, 0, 67, 79, 76, + 79, 82, 0, 171, 79, 83, + 71, 78, 80, 0, 0, 0, + 2, 0, 0, 0, 8, 0, + 0, 0, 56, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 15, 0, + 0, 0, 68, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 3, 12, + 0, 0, 83, 86, 95, 80, + 79, 83, 73, 84, 73, 79, + 78, 0, 84, 69, 88, 67, + 79, 79, 82, 68, 0, 171, + 171, 171, 83, 72, 69, 88, + 128, 0, 0, 0, 80, 0, + 1, 0, 32, 0, 0, 0, + 106, 8, 0, 1, 95, 0, + 0, 3, 114, 16, 16, 0, + 0, 0, 0, 0, 95, 0, + 0, 3, 50, 16, 16, 0, + 2, 0, 0, 0, 103, 0, + 0, 4, 242, 32, 16, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 101, 0, 0, 3, + 50, 32, 16, 0, 1, 0, + 0, 0, 54, 0, 0, 5, + 114, 32, 16, 0, 0, 0, + 0, 0, 70, 18, 16, 0, + 0, 0, 0, 0, 54, 0, + 0, 5, 130, 32, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 54, 0, 0, 5, 50, 32, + 16, 0, 1, 0, 0, 0, + 70, 16, 16, 0, 2, 0, + 0, 0, 62, 0, 0, 1, + 83, 84, 65, 84, 148, 0, + 0, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0 +}; diff --git a/demo/d3d/shaders/pointGS.hlsl b/demo/d3d/shaders/pointGS.hlsl new file mode 100644 index 0000000..4d654af --- /dev/null +++ b/demo/d3d/shaders/pointGS.hlsl @@ -0,0 +1,68 @@ +#include "shaderCommon.h" + +cbuffer constBuf : register(b0) +{ + PointShaderConst gParams; +}; + +static const float2 corners[4] = +{ + float2(0.0, 1.0), float2(0.0, 0.0), float2(1.0, 1.0), float2(1.0, 0.0) +}; + +[maxvertexcount(4)] +void pointGS(point PointVertexOut input[1], inout TriangleStream<PointGeoOut> triStream) +{ + const float4x4 modelViewMatrix = gParams.modelView; + const float pointRadius = gParams.pointRadius; + const float pointScale = gParams.pointScale; + const float4x4 lightTransform = gParams.lightTransform; + const float3 lightDir = gParams.lightDir.xyz; + const int mode = gParams.mode; + + const float4 viewPosition = input[0].viewPosition; + const float density = input[0].density; + const unsigned int phase = input[0].phase; + const float4 modelPosition = input[0].modelPosition; + + //float spriteSize = (pointRadius / viewPos.z); + const float spriteSize = pointRadius * 2; + + PointGeoOut output; + for (int i = 0; i < 4; ++i) + { + const float2 corner = corners[i]; + float4 eyePos = viewPosition; // start with point position + eyePos.xy += spriteSize * (corner - float2(0.5, 0.5)); // add corner position + output.position = mul(gParams.projection, eyePos); // complete transformation + + // use corner as texCoord, flip the y component of uv (glsl to hlsl conversion) + output.texCoord = float2(corner.x, 1.0f - corner.y); + output.lightOffsetPosition = mul(lightTransform, float4(modelPosition.xyz - lightDir * pointRadius * 2.0, 1.0)); + output.viewLightDir = mul(modelViewMatrix, float4(lightDir, 0.0)).xyz; + + if (mode == 1) + { + // density visualization + if (density < 0.0f) + output.reflectance = float4(lerp(float3(0.1, 0.1, 1.0), float3(0.1, 1.0, 1.0), -density), 0); + else + output.reflectance = float4(lerp(float3(1.0, 1.0, 1.0), float3(0.1, 0.2, 1.0), density), 0); + } + else if (mode == 2) + { + //gl_PointSize *= clamp(inPosition.w * 0.25, 0.0f, 1.0); + float tmp = clamp(modelPosition.w * 0.05, 0.0f, 1.0); + output.reflectance = float4(tmp, tmp, tmp, tmp); + } + else + { + output.reflectance = float4(lerp(gParams.colors[phase % 8].xyz * 2.0, float3(1.0, 1.0, 1.0), 0.1), 0); + } + + output.modelPosition= modelPosition.xyz; + output.viewPosition = viewPosition.xyz; + + triStream.Append(output); + } +} diff --git a/demo/d3d/shaders/pointGS.hlsl.h b/demo/d3d/shaders/pointGS.hlsl.h new file mode 100644 index 0000000..46806ac --- /dev/null +++ b/demo/d3d/shaders/pointGS.hlsl.h @@ -0,0 +1,713 @@ +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// Buffer Definitions: +// +// cbuffer constBuf +// { +// +// struct PointShaderConst +// { +// +// float4x4 modelView; // Offset: 0 +// float4x4 projection; // Offset: 64 +// float4x4 lightTransform; // Offset: 128 +// float4 colors[8]; // Offset: 192 +// float4 shadowTaps[12]; // Offset: 320 +// float3 lightPos; // Offset: 512 +// float _pad0; // Offset: 524 +// float3 lightDir; // Offset: 528 +// float _pad1; // Offset: 540 +// float pointRadius; // Offset: 544 +// float pointScale; // Offset: 548 +// float spotMin; // Offset: 552 +// float spotMax; // Offset: 556 +// int mode; // Offset: 560 +// int _pad2[3]; // Offset: 576 +// +// } gParams; // Offset: 0 Size: 612 +// +// } +// +// +// Resource Bindings: +// +// Name Type Format Dim Slot Elements +// ------------------------------ ---------- ------- ----------- ---- -------- +// constBuf cbuffer NA NA 0 1 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// POSITION 0 xyzw 0 NONE float xyzw +// DENSITY 0 x 1 NONE float x +// PHASE 0 x 2 NONE int x +// VERTEX 0 xyzw 3 NONE float xyzw +// +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_POSITION 0 xyzw 0 POS float xyzw +// TEXCOORD 0 xy 1 NONE float xy +// TEXCOORD 1 xyzw 2 NONE float xyzw +// TEXCOORD 2 xyz 3 NONE float xyz +// TEXCOORD 3 xyzw 4 NONE float xyzw +// TEXCOORD 4 xyz 5 NONE float xyz +// TEXCOORD 5 xyz 6 NONE float xyz +// +gs_5_0 +dcl_globalFlags refactoringAllowed +dcl_immediateConstantBuffer { { 0, 1.000000, 0, 0}, + { 0, 0, 0, 0}, + { 1.000000, 1.000000, 0, 0}, + { 1.000000, 0, 0, 0} } +dcl_constantbuffer cb0[36], dynamicIndexed +dcl_input v[1][0].xyzw +dcl_input v[1][1].x +dcl_input v[1][2].x +dcl_input v[1][3].xyzw +dcl_temps 8 +dcl_inputprimitive point +dcl_stream m0 +dcl_outputtopology trianglestrip +dcl_output_siv o0.xyzw, position +dcl_output o1.xy +dcl_output o2.xyzw +dcl_output o3.xyz +dcl_output o4.xyzw +dcl_output o5.xyz +dcl_output o6.xyz +dcl_maxout 4 +add r0.x, cb0[34].x, cb0[34].x +mul r0.yzw, cb0[33].xxyz, cb0[34].xxxx +mad r0.yzw, -r0.yyzw, l(0.000000, 2.000000, 2.000000, 2.000000), v[0][3].xxyz +mul r1.xyzw, r0.zzzz, cb0[9].xyzw +mad r1.xyzw, cb0[8].xyzw, r0.yyyy, r1.xyzw +mad r1.xyzw, cb0[10].xyzw, r0.wwww, r1.xyzw +add r1.xyzw, r1.xyzw, cb0[11].xyzw +mul r0.yzw, cb0[1].xxyz, cb0[33].yyyy +mad r0.yzw, cb0[0].xxyz, cb0[33].xxxx, r0.yyzw +mad r0.yzw, cb0[2].xxyz, cb0[33].zzzz, r0.yyzw +lt r2.x, v[0][1].x, l(0.000000) +mad r2.yzw, v[0][1].xxxx, l(0.000000, -0.900000, -0.800000, 0.000000), l(0.000000, 1.000000, 1.000000, 1.000000) +mov r3.xz, l(0.100000,0,1.000000,0) +mad r3.y, v[0][1].x, l(-0.900000), l(0.100000) +movc r2.xyz, r2.xxxx, r3.xyzx, r2.yzwy +mov r2.w, l(0) +ieq r3.xy, l(1, 2, 0, 0), cb0[35].xxxx +mul r3.z, l(0.050000), v[0][3].w +mov_sat r4.xyzw, r3.zzzz +and r3.z, l(7), v[0][2].x +add r5.xyz, cb0[r3.z + 12].xyzx, cb0[r3.z + 12].xyzx +mad r6.xyz, -cb0[r3.z + 12].xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(1.000000, 1.000000, 1.000000, 0.000000) +mad r5.xyz, r6.xyzx, l(0.100000, 0.100000, 0.100000, 0.000000), r5.xyzx +mov r5.w, l(0) +mov r3.z, l(0) +loop + ige r3.w, r3.z, l(4) + breakc_nz r3.w + add r6.xy, l(-0.500000, -0.500000, 0.000000, 0.000000), icb[r3.z + 0].xyxx + mad r6.xy, r0.xxxx, r6.xyxx, v[0][0].xyxx + mul r7.xyzw, r6.yyyy, cb0[5].xyzw + mad r6.xyzw, cb0[4].xyzw, r6.xxxx, r7.xyzw + mad r6.xyzw, cb0[6].xyzw, v[0][0].zzzz, r6.xyzw + mad r6.xyzw, cb0[7].xyzw, v[0][0].wwww, r6.xyzw + add r3.w, l(1.000000), -icb[r3.z + 0].y + if_nz r3.x + mov r7.xyzw, r2.xyzw + else + if_nz r3.y + mov r7.xyzw, r4.xyzw + else + mov r7.xyzw, r5.xyzw + endif + endif + mov o0.xyzw, r6.xyzw + mov o1.x, icb[r3.z + 0].x + mov o1.y, r3.w + mov o2.xyzw, r1.xyzw + mov o3.xyz, r0.yzwy + mov o4.xyzw, r7.xyzw + mov o5.xyz, v[0][3].xyzx + mov o6.xyz, v[0][0].xyzx + emit_stream m0 + iadd r3.z, r3.z, l(1) +endloop +ret +// Approximately 56 instruction slots used +#endif + +const BYTE g_pointGS[] = +{ + 68, 88, 66, 67, 225, 171, + 155, 174, 109, 180, 8, 136, + 18, 164, 43, 168, 152, 216, + 179, 151, 1, 0, 0, 0, + 56, 13, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, + 176, 3, 0, 0, 64, 4, + 0, 0, 44, 5, 0, 0, + 156, 12, 0, 0, 82, 68, + 69, 70, 116, 3, 0, 0, + 1, 0, 0, 0, 104, 0, + 0, 0, 1, 0, 0, 0, + 60, 0, 0, 0, 0, 5, + 83, 71, 0, 1, 0, 0, + 64, 3, 0, 0, 82, 68, + 49, 49, 60, 0, 0, 0, + 24, 0, 0, 0, 32, 0, + 0, 0, 40, 0, 0, 0, + 36, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 1, 0, + 0, 0, 99, 111, 110, 115, + 116, 66, 117, 102, 0, 171, + 171, 171, 92, 0, 0, 0, + 1, 0, 0, 0, 128, 0, + 0, 0, 112, 2, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 168, 0, 0, 0, + 0, 0, 0, 0, 100, 2, + 0, 0, 2, 0, 0, 0, + 28, 3, 0, 0, 0, 0, + 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 255, 255, + 255, 255, 0, 0, 0, 0, + 103, 80, 97, 114, 97, 109, + 115, 0, 80, 111, 105, 110, + 116, 83, 104, 97, 100, 101, + 114, 67, 111, 110, 115, 116, + 0, 109, 111, 100, 101, 108, + 86, 105, 101, 119, 0, 102, + 108, 111, 97, 116, 52, 120, + 52, 0, 3, 0, 3, 0, + 4, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 203, 0, + 0, 0, 112, 114, 111, 106, + 101, 99, 116, 105, 111, 110, + 0, 108, 105, 103, 104, 116, + 84, 114, 97, 110, 115, 102, + 111, 114, 109, 0, 99, 111, + 108, 111, 114, 115, 0, 102, + 108, 111, 97, 116, 52, 0, + 1, 0, 3, 0, 1, 0, + 4, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 25, 1, 0, 0, + 115, 104, 97, 100, 111, 119, + 84, 97, 112, 115, 0, 171, + 1, 0, 3, 0, 1, 0, + 4, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 25, 1, 0, 0, + 108, 105, 103, 104, 116, 80, + 111, 115, 0, 102, 108, 111, + 97, 116, 51, 0, 1, 0, + 3, 0, 1, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 125, 1, 0, 0, 95, 112, + 97, 100, 48, 0, 102, 108, + 111, 97, 116, 0, 0, 0, + 3, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 174, 1, 0, 0, 108, 105, + 103, 104, 116, 68, 105, 114, + 0, 95, 112, 97, 100, 49, + 0, 112, 111, 105, 110, 116, + 82, 97, 100, 105, 117, 115, + 0, 112, 111, 105, 110, 116, + 83, 99, 97, 108, 101, 0, + 115, 112, 111, 116, 77, 105, + 110, 0, 115, 112, 111, 116, + 77, 97, 120, 0, 109, 111, + 100, 101, 0, 105, 110, 116, + 0, 171, 0, 0, 2, 0, + 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 19, 2, + 0, 0, 95, 112, 97, 100, + 50, 0, 171, 171, 0, 0, + 2, 0, 1, 0, 1, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 19, 2, 0, 0, 193, 0, + 0, 0, 212, 0, 0, 0, + 0, 0, 0, 0, 248, 0, + 0, 0, 212, 0, 0, 0, + 64, 0, 0, 0, 3, 1, + 0, 0, 212, 0, 0, 0, + 128, 0, 0, 0, 18, 1, + 0, 0, 32, 1, 0, 0, + 192, 0, 0, 0, 68, 1, + 0, 0, 80, 1, 0, 0, + 64, 1, 0, 0, 116, 1, + 0, 0, 132, 1, 0, 0, + 0, 2, 0, 0, 168, 1, + 0, 0, 180, 1, 0, 0, + 12, 2, 0, 0, 216, 1, + 0, 0, 132, 1, 0, 0, + 16, 2, 0, 0, 225, 1, + 0, 0, 180, 1, 0, 0, + 28, 2, 0, 0, 231, 1, + 0, 0, 180, 1, 0, 0, + 32, 2, 0, 0, 243, 1, + 0, 0, 180, 1, 0, 0, + 36, 2, 0, 0, 254, 1, + 0, 0, 180, 1, 0, 0, + 40, 2, 0, 0, 6, 2, + 0, 0, 180, 1, 0, 0, + 44, 2, 0, 0, 14, 2, + 0, 0, 24, 2, 0, 0, + 48, 2, 0, 0, 60, 2, + 0, 0, 68, 2, 0, 0, + 64, 2, 0, 0, 5, 0, + 0, 0, 1, 0, 144, 0, + 0, 0, 15, 0, 104, 2, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 176, 0, 0, 0, 77, 105, + 99, 114, 111, 115, 111, 102, + 116, 32, 40, 82, 41, 32, + 72, 76, 83, 76, 32, 83, + 104, 97, 100, 101, 114, 32, + 67, 111, 109, 112, 105, 108, + 101, 114, 32, 54, 46, 51, + 46, 57, 54, 48, 48, 46, + 49, 54, 51, 56, 52, 0, + 171, 171, 73, 83, 71, 78, + 136, 0, 0, 0, 4, 0, + 0, 0, 8, 0, 0, 0, + 104, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 15, 15, 0, 0, + 113, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 1, 0, + 0, 0, 1, 1, 0, 0, + 121, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 2, 0, + 0, 0, 1, 1, 0, 0, + 127, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 3, 0, + 0, 0, 15, 15, 0, 0, + 80, 79, 83, 73, 84, 73, + 79, 78, 0, 68, 69, 78, + 83, 73, 84, 89, 0, 80, + 72, 65, 83, 69, 0, 86, + 69, 82, 84, 69, 88, 0, + 171, 171, 79, 83, 71, 53, + 228, 0, 0, 0, 7, 0, + 0, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 204, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 0, 0, + 0, 0, 216, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 3, 12, + 0, 0, 0, 0, 0, 0, + 216, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 2, 0, + 0, 0, 15, 0, 0, 0, + 0, 0, 0, 0, 216, 0, + 0, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 3, 0, 0, 0, + 7, 8, 0, 0, 0, 0, + 0, 0, 216, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 4, 0, 0, 0, 15, 0, + 0, 0, 0, 0, 0, 0, + 216, 0, 0, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 5, 0, + 0, 0, 7, 8, 0, 0, + 0, 0, 0, 0, 216, 0, + 0, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 6, 0, 0, 0, + 7, 8, 0, 0, 83, 86, + 95, 80, 79, 83, 73, 84, + 73, 79, 78, 0, 84, 69, + 88, 67, 79, 79, 82, 68, + 0, 171, 171, 171, 83, 72, + 69, 88, 104, 7, 0, 0, + 80, 0, 2, 0, 218, 1, + 0, 0, 106, 8, 0, 1, + 53, 24, 0, 0, 18, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 128, 63, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 128, 63, 0, 0, 128, 63, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 128, 63, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 89, 8, 0, 4, 70, 142, + 32, 0, 0, 0, 0, 0, + 36, 0, 0, 0, 95, 0, + 0, 4, 242, 16, 32, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 95, 0, 0, 4, + 18, 16, 32, 0, 1, 0, + 0, 0, 1, 0, 0, 0, + 95, 0, 0, 4, 18, 16, + 32, 0, 1, 0, 0, 0, + 2, 0, 0, 0, 95, 0, + 0, 4, 242, 16, 32, 0, + 1, 0, 0, 0, 3, 0, + 0, 0, 104, 0, 0, 2, + 8, 0, 0, 0, 93, 8, + 0, 1, 143, 0, 0, 3, + 0, 0, 17, 0, 0, 0, + 0, 0, 92, 40, 0, 1, + 103, 0, 0, 4, 242, 32, + 16, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 101, 0, + 0, 3, 50, 32, 16, 0, + 1, 0, 0, 0, 101, 0, + 0, 3, 242, 32, 16, 0, + 2, 0, 0, 0, 101, 0, + 0, 3, 114, 32, 16, 0, + 3, 0, 0, 0, 101, 0, + 0, 3, 242, 32, 16, 0, + 4, 0, 0, 0, 101, 0, + 0, 3, 114, 32, 16, 0, + 5, 0, 0, 0, 101, 0, + 0, 3, 114, 32, 16, 0, + 6, 0, 0, 0, 94, 0, + 0, 2, 4, 0, 0, 0, + 0, 0, 0, 9, 18, 0, + 16, 0, 0, 0, 0, 0, + 10, 128, 32, 0, 0, 0, + 0, 0, 34, 0, 0, 0, + 10, 128, 32, 0, 0, 0, + 0, 0, 34, 0, 0, 0, + 56, 0, 0, 9, 226, 0, + 16, 0, 0, 0, 0, 0, + 6, 137, 32, 0, 0, 0, + 0, 0, 33, 0, 0, 0, + 6, 128, 32, 0, 0, 0, + 0, 0, 34, 0, 0, 0, + 50, 0, 0, 14, 226, 0, + 16, 0, 0, 0, 0, 0, + 86, 14, 16, 128, 65, 0, + 0, 0, 0, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 64, + 0, 0, 0, 64, 0, 0, + 0, 64, 6, 25, 32, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 56, 0, 0, 8, + 242, 0, 16, 0, 1, 0, + 0, 0, 166, 10, 16, 0, + 0, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 50, 0, + 0, 10, 242, 0, 16, 0, + 1, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 86, 5, + 16, 0, 0, 0, 0, 0, + 70, 14, 16, 0, 1, 0, + 0, 0, 50, 0, 0, 10, + 242, 0, 16, 0, 1, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 10, 0, + 0, 0, 246, 15, 16, 0, + 0, 0, 0, 0, 70, 14, + 16, 0, 1, 0, 0, 0, + 0, 0, 0, 8, 242, 0, + 16, 0, 1, 0, 0, 0, + 70, 14, 16, 0, 1, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 11, 0, + 0, 0, 56, 0, 0, 9, + 226, 0, 16, 0, 0, 0, + 0, 0, 6, 137, 32, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 86, 133, 32, 0, + 0, 0, 0, 0, 33, 0, + 0, 0, 50, 0, 0, 11, + 226, 0, 16, 0, 0, 0, + 0, 0, 6, 137, 32, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 6, 128, 32, 0, + 0, 0, 0, 0, 33, 0, + 0, 0, 86, 14, 16, 0, + 0, 0, 0, 0, 50, 0, + 0, 11, 226, 0, 16, 0, + 0, 0, 0, 0, 6, 137, + 32, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 166, 138, + 32, 0, 0, 0, 0, 0, + 33, 0, 0, 0, 86, 14, + 16, 0, 0, 0, 0, 0, + 49, 0, 0, 8, 18, 0, + 16, 0, 2, 0, 0, 0, + 10, 16, 32, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 0, 0, 50, 0, 0, 16, + 226, 0, 16, 0, 2, 0, + 0, 0, 6, 16, 32, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 0, 102, 102, + 102, 191, 205, 204, 76, 191, + 0, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 128, 63, 0, 0, + 128, 63, 0, 0, 128, 63, + 54, 0, 0, 8, 82, 0, + 16, 0, 3, 0, 0, 0, + 2, 64, 0, 0, 205, 204, + 204, 61, 0, 0, 0, 0, + 0, 0, 128, 63, 0, 0, + 0, 0, 50, 0, 0, 10, + 34, 0, 16, 0, 3, 0, + 0, 0, 10, 16, 32, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 1, 64, 0, 0, + 102, 102, 102, 191, 1, 64, + 0, 0, 205, 204, 204, 61, + 55, 0, 0, 9, 114, 0, + 16, 0, 2, 0, 0, 0, + 6, 0, 16, 0, 2, 0, + 0, 0, 70, 2, 16, 0, + 3, 0, 0, 0, 150, 7, + 16, 0, 2, 0, 0, 0, + 54, 0, 0, 5, 130, 0, + 16, 0, 2, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 0, 0, 32, 0, 0, 11, + 50, 0, 16, 0, 3, 0, + 0, 0, 2, 64, 0, 0, + 1, 0, 0, 0, 2, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 6, 128, + 32, 0, 0, 0, 0, 0, + 35, 0, 0, 0, 56, 0, + 0, 8, 66, 0, 16, 0, + 3, 0, 0, 0, 1, 64, + 0, 0, 205, 204, 76, 61, + 58, 16, 32, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 54, 32, 0, 5, 242, 0, + 16, 0, 4, 0, 0, 0, + 166, 10, 16, 0, 3, 0, + 0, 0, 1, 0, 0, 8, + 66, 0, 16, 0, 3, 0, + 0, 0, 1, 64, 0, 0, + 7, 0, 0, 0, 10, 16, + 32, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, + 0, 13, 114, 0, 16, 0, + 5, 0, 0, 0, 70, 130, + 32, 6, 0, 0, 0, 0, + 12, 0, 0, 0, 42, 0, + 16, 0, 3, 0, 0, 0, + 70, 130, 32, 6, 0, 0, + 0, 0, 12, 0, 0, 0, + 42, 0, 16, 0, 3, 0, + 0, 0, 50, 0, 0, 19, + 114, 0, 16, 0, 6, 0, + 0, 0, 70, 130, 32, 134, + 65, 0, 0, 0, 0, 0, + 0, 0, 12, 0, 0, 0, + 42, 0, 16, 0, 3, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 64, 0, 0, + 0, 64, 0, 0, 0, 64, + 0, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 128, 63, + 0, 0, 128, 63, 0, 0, + 128, 63, 0, 0, 0, 0, + 50, 0, 0, 12, 114, 0, + 16, 0, 5, 0, 0, 0, + 70, 2, 16, 0, 6, 0, + 0, 0, 2, 64, 0, 0, + 205, 204, 204, 61, 205, 204, + 204, 61, 205, 204, 204, 61, + 0, 0, 0, 0, 70, 2, + 16, 0, 5, 0, 0, 0, + 54, 0, 0, 5, 130, 0, + 16, 0, 5, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 0, 0, 54, 0, 0, 5, + 66, 0, 16, 0, 3, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 0, 0, 48, 0, + 0, 1, 33, 0, 0, 7, + 130, 0, 16, 0, 3, 0, + 0, 0, 42, 0, 16, 0, + 3, 0, 0, 0, 1, 64, + 0, 0, 4, 0, 0, 0, + 3, 0, 4, 3, 58, 0, + 16, 0, 3, 0, 0, 0, + 0, 0, 0, 11, 50, 0, + 16, 0, 6, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 191, 0, 0, 0, 191, + 0, 0, 0, 0, 0, 0, + 0, 0, 70, 144, 144, 0, + 42, 0, 16, 0, 3, 0, + 0, 0, 50, 0, 0, 10, + 50, 0, 16, 0, 6, 0, + 0, 0, 6, 0, 16, 0, + 0, 0, 0, 0, 70, 0, + 16, 0, 6, 0, 0, 0, + 70, 16, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 56, 0, 0, 8, 242, 0, + 16, 0, 7, 0, 0, 0, + 86, 5, 16, 0, 6, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 5, 0, + 0, 0, 50, 0, 0, 10, + 242, 0, 16, 0, 6, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 4, 0, + 0, 0, 6, 0, 16, 0, + 6, 0, 0, 0, 70, 14, + 16, 0, 7, 0, 0, 0, + 50, 0, 0, 11, 242, 0, + 16, 0, 6, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 6, 0, 0, 0, + 166, 26, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 70, 14, 16, 0, 6, 0, + 0, 0, 50, 0, 0, 11, + 242, 0, 16, 0, 6, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 7, 0, + 0, 0, 246, 31, 32, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 70, 14, 16, 0, + 6, 0, 0, 0, 0, 0, + 0, 9, 130, 0, 16, 0, + 3, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 26, 144, 144, 128, 65, 0, + 0, 0, 42, 0, 16, 0, + 3, 0, 0, 0, 31, 0, + 4, 3, 10, 0, 16, 0, + 3, 0, 0, 0, 54, 0, + 0, 5, 242, 0, 16, 0, + 7, 0, 0, 0, 70, 14, + 16, 0, 2, 0, 0, 0, + 18, 0, 0, 1, 31, 0, + 4, 3, 26, 0, 16, 0, + 3, 0, 0, 0, 54, 0, + 0, 5, 242, 0, 16, 0, + 7, 0, 0, 0, 70, 14, + 16, 0, 4, 0, 0, 0, + 18, 0, 0, 1, 54, 0, + 0, 5, 242, 0, 16, 0, + 7, 0, 0, 0, 70, 14, + 16, 0, 5, 0, 0, 0, + 21, 0, 0, 1, 21, 0, + 0, 1, 54, 0, 0, 5, + 242, 32, 16, 0, 0, 0, + 0, 0, 70, 14, 16, 0, + 6, 0, 0, 0, 54, 0, + 0, 6, 18, 32, 16, 0, + 1, 0, 0, 0, 10, 144, + 144, 0, 42, 0, 16, 0, + 3, 0, 0, 0, 54, 0, + 0, 5, 34, 32, 16, 0, + 1, 0, 0, 0, 58, 0, + 16, 0, 3, 0, 0, 0, + 54, 0, 0, 5, 242, 32, + 16, 0, 2, 0, 0, 0, + 70, 14, 16, 0, 1, 0, + 0, 0, 54, 0, 0, 5, + 114, 32, 16, 0, 3, 0, + 0, 0, 150, 7, 16, 0, + 0, 0, 0, 0, 54, 0, + 0, 5, 242, 32, 16, 0, + 4, 0, 0, 0, 70, 14, + 16, 0, 7, 0, 0, 0, + 54, 0, 0, 6, 114, 32, + 16, 0, 5, 0, 0, 0, + 70, 18, 32, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 54, 0, 0, 6, 114, 32, + 16, 0, 6, 0, 0, 0, + 70, 18, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 117, 0, 0, 3, 0, 0, + 17, 0, 0, 0, 0, 0, + 30, 0, 0, 7, 66, 0, + 16, 0, 3, 0, 0, 0, + 42, 0, 16, 0, 3, 0, + 0, 0, 1, 64, 0, 0, + 1, 0, 0, 0, 22, 0, + 0, 1, 62, 0, 0, 1, + 83, 84, 65, 84, 148, 0, + 0, 0, 56, 0, 0, 0, + 8, 0, 0, 0, 4, 0, + 0, 0, 11, 0, 0, 0, + 24, 0, 0, 0, 3, 0, + 0, 0, 1, 0, 0, 0, + 3, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 5, 0, 0, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0 +}; diff --git a/demo/d3d/shaders/pointPS.hlsl b/demo/d3d/shaders/pointPS.hlsl new file mode 100644 index 0000000..62c8ab4 --- /dev/null +++ b/demo/d3d/shaders/pointPS.hlsl @@ -0,0 +1,81 @@ +#include "shaderCommon.h" + +cbuffer constBuf : register(b0) +{ + PointShaderConst gParams; +}; + +Texture2D<float> shadowTexture : register(t0); // shadow map + +SamplerComparisonState shadowSampler : register(s0); // texture sample used to sample depth from shadow texture in this sample + +float sqr(float x) { return x * x; } + +float shadowSample(float4 lightOffsetPosition) +{ + float3 pos = float3(lightOffsetPosition.xyz / lightOffsetPosition.w); + //float3 uvw = (pos.xyz * 0.5) + vec3(0.5); + float3 uvw = (pos.xyz * float3(0.5, 0.5, 1.0)) + float3(0.5, 0.5, 0.0); + + // user clip + if (uvw.x < 0.0 || uvw.x > 1.0) + return 1.0; + if (uvw.y < 0.0 || uvw.y > 1.0) + return 1.0; + + float s = 0.0; + float radius = 0.002; + + // flip uv y-coordinate + uvw.y = 1.0f - uvw.y; + + [unroll] + for (int i = 0; i < 8; i++) + { + float2 shadowTaps = gParams.shadowTaps[i].xy; + shadowTaps.y = 1.0f - shadowTaps.y; + + //s += shadow2D(shadowTex, vec3(uvw.xy + shadowTaps[i] * radius, uvw.z)).r; + s += shadowTexture.SampleCmp(shadowSampler, uvw.xy + shadowTaps * radius, uvw.z); + } + s /= 8.0; + + return s; +} + +float4 pointPS(PointGeoOut input) : SV_TARGET +{ + const float spotMin = gParams.spotMin; + const float spotMax = gParams.spotMax; + + // calculate normal from texture coordinates + float3 normal; + normal.xy = input.texCoord * float2(2.0, -2.0) + float2(-1.0, 1.0); + float mag = dot(normal.xy, normal.xy); + if (mag > 1.0) + { + discard; // kill pixels outside circle + } + + normal.z = sqrt(1.0 - mag); + + if (gParams.mode == 2) + { + float alpha = normal.z * input.reflectance.w; + return float4(input.reflectance.xyz * alpha, alpha); + } + + // calculate lighting + float shadow = shadowSample(input.lightOffsetPosition); + + float3 lPos = float3(input.lightOffsetPosition.xyz / input.lightOffsetPosition.w); + float attenuation = max(smoothstep(spotMax, spotMin, dot(lPos.xy, lPos.xy)), 0.05); + + float3 diffuse = float3(0.9, 0.9, 0.9); + float3 reflectance = input.reflectance.xyz; + + float3 lo = diffuse * reflectance * max(0.0, sqr(-dot(input.viewLightDir, normal) * 0.5 + 0.5)) * max(0.2, shadow) * attenuation; + + const float tmp = 1.0 / 2.2; + return float4(pow(abs(lo), float3(tmp, tmp, tmp)), 1.0); +} diff --git a/demo/d3d/shaders/pointPS.hlsl.h b/demo/d3d/shaders/pointPS.hlsl.h new file mode 100644 index 0000000..1320e1d --- /dev/null +++ b/demo/d3d/shaders/pointPS.hlsl.h @@ -0,0 +1,947 @@ +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// Buffer Definitions: +// +// cbuffer constBuf +// { +// +// struct PointShaderConst +// { +// +// float4x4 modelView; // Offset: 0 +// float4x4 projection; // Offset: 64 +// float4x4 lightTransform; // Offset: 128 +// float4 colors[8]; // Offset: 192 +// float4 shadowTaps[12]; // Offset: 320 +// float3 lightPos; // Offset: 512 +// float _pad0; // Offset: 524 +// float3 lightDir; // Offset: 528 +// float _pad1; // Offset: 540 +// float pointRadius; // Offset: 544 +// float pointScale; // Offset: 548 +// float spotMin; // Offset: 552 +// float spotMax; // Offset: 556 +// int mode; // Offset: 560 +// int _pad2[3]; // Offset: 576 +// +// } gParams; // Offset: 0 Size: 612 +// +// } +// +// +// Resource Bindings: +// +// Name Type Format Dim Slot Elements +// ------------------------------ ---------- ------- ----------- ---- -------- +// shadowSampler sampler_c NA NA 0 1 +// shadowTexture texture float 2d 0 1 +// constBuf cbuffer NA NA 0 1 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_POSITION 0 xyzw 0 POS float +// TEXCOORD 0 xy 1 NONE float xy +// TEXCOORD 1 xyzw 2 NONE float xyzw +// TEXCOORD 2 xyz 3 NONE float xyz +// TEXCOORD 3 xyzw 4 NONE float xyzw +// TEXCOORD 4 xyz 5 NONE float +// TEXCOORD 5 xyz 6 NONE float +// +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_TARGET 0 xyzw 0 TARGET float xyzw +// +ps_5_0 +dcl_globalFlags refactoringAllowed +dcl_constantbuffer cb0[36], immediateIndexed +dcl_sampler s0, mode_comparison +dcl_resource_texture2d (float,float,float,float) t0 +dcl_input_ps linear v1.xy +dcl_input_ps linear v2.xyzw +dcl_input_ps linear v3.xyz +dcl_input_ps linear v4.xyzw +dcl_output o0.xyzw +dcl_temps 6 +mad r0.xy, v1.xyxx, l(2.000000, -2.000000, 0.000000, 0.000000), l(-1.000000, 1.000000, 0.000000, 0.000000) +dp2 r0.x, r0.xyxx, r0.xyxx +lt r0.y, l(1.000000), r0.x +discard_nz r0.y +add r0.x, -r0.x, l(1.000000) +sqrt r0.z, r0.x +ieq r0.w, cb0[35].x, l(2) +if_nz r0.w + mul r0.w, r0.z, v4.w + mul o0.xyz, r0.wwww, v4.xyzx + mov o0.w, r0.w + ret +endif +div r1.xyz, v2.xyzx, v2.wwww +mad r2.xyz, r1.xyzx, l(0.500000, 0.500000, 1.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000) +lt r0.w, r2.x, l(0.000000) +lt r1.z, l(1.000000), r2.x +or r0.w, r0.w, r1.z +add r1.z, -cb0[20].y, l(1.000000) +mul r3.x, cb0[20].x, l(0.002000) +mul r3.y, r1.z, l(0.002000) +add r2.w, -r2.y, l(1.000000) +add r1.zw, r2.xxxw, r3.xxxy +sample_c_indexable(texture2d)(float,float,float,float) r1.z, r1.zwzz, t0.xxxx, s0, r2.z +add r1.w, -cb0[21].y, l(1.000000) +mul r3.x, cb0[21].x, l(0.002000) +mul r3.y, r1.w, l(0.002000) +add r3.xy, r2.xwxx, r3.xyxx +sample_c_indexable(texture2d)(float,float,float,float) r1.w, r3.xyxx, t0.xxxx, s0, r2.z +add r3.x, -cb0[22].y, l(1.000000) +mul r4.x, cb0[22].x, l(0.002000) +mul r4.y, r3.x, l(0.002000) +add r3.xy, r2.xwxx, r4.xyxx +sample_c_indexable(texture2d)(float,float,float,float) r3.x, r3.xyxx, t0.xxxx, s0, r2.z +add r3.y, -cb0[23].y, l(1.000000) +mul r4.x, cb0[23].x, l(0.002000) +mul r4.y, r3.y, l(0.002000) +add r3.yz, r2.xxwx, r4.xxyx +sample_c_indexable(texture2d)(float,float,float,float) r3.y, r3.yzyy, t0.xxxx, s0, r2.z +add r3.z, -cb0[24].y, l(1.000000) +mul r4.x, cb0[24].x, l(0.002000) +mul r4.y, r3.z, l(0.002000) +add r3.zw, r2.xxxw, r4.xxxy +sample_c_indexable(texture2d)(float,float,float,float) r3.z, r3.zwzz, t0.xxxx, s0, r2.z +add r3.w, -cb0[25].y, l(1.000000) +mul r4.x, cb0[25].x, l(0.002000) +mul r4.y, r3.w, l(0.002000) +add r4.xy, r2.xwxx, r4.xyxx +sample_c_indexable(texture2d)(float,float,float,float) r3.w, r4.xyxx, t0.xxxx, s0, r2.z +add r4.x, -cb0[26].y, l(1.000000) +mul r5.x, cb0[26].x, l(0.002000) +mul r5.y, r4.x, l(0.002000) +add r4.xy, r2.xwxx, r5.xyxx +sample_c_indexable(texture2d)(float,float,float,float) r4.x, r4.xyxx, t0.xxxx, s0, r2.z +add r4.y, -cb0[27].y, l(1.000000) +mul r5.x, cb0[27].x, l(0.002000) +mul r5.y, r4.y, l(0.002000) +add r2.xw, r2.xxxw, r5.xxxy +sample_c_indexable(texture2d)(float,float,float,float) r2.x, r2.xwxx, t0.xxxx, s0, r2.z +if_z r0.w + lt r0.w, r2.y, l(0.000000) + lt r2.y, l(1.000000), r2.y + or r0.w, r0.w, r2.y + if_z r0.w + add r0.w, r1.w, r1.z + add r0.w, r3.x, r0.w + add r0.w, r3.y, r0.w + add r0.w, r3.z, r0.w + add r0.w, r3.w, r0.w + add r0.w, r4.x, r0.w + add r0.w, r2.x, r0.w + mul r0.w, r0.w, l(0.125000) + else + mov r0.w, l(1.000000) + endif +else + mov r0.w, l(1.000000) +endif +dp2 r1.x, r1.xyxx, r1.xyxx +add r1.y, -cb0[34].w, cb0[34].z +add r1.x, r1.x, -cb0[34].w +div r1.y, l(1.000000, 1.000000, 1.000000, 1.000000), r1.y +mul_sat r1.x, r1.y, r1.x +mad r1.y, r1.x, l(-2.000000), l(3.000000) +mul r1.x, r1.x, r1.x +mul r1.x, r1.x, r1.y +max r1.x, r1.x, l(0.050000) +mul r1.yzw, v4.xxyz, l(0.000000, 0.900000, 0.900000, 0.900000) +mad r0.xy, v1.xyxx, l(2.000000, -2.000000, 0.000000, 0.000000), l(-1.000000, 1.000000, 0.000000, 0.000000) +dp3 r0.x, v3.xyzx, r0.xyzx +mad r0.x, r0.x, l(-0.500000), l(0.500000) +mul r0.x, r0.x, r0.x +mul r0.xyz, r0.xxxx, r1.yzwy +max r0.w, r0.w, l(0.200000) +mul r0.xyz, r0.wwww, r0.xyzx +mul r0.xyz, r1.xxxx, r0.xyzx +log r0.xyz, |r0.xyzx| +mul r0.xyz, r0.xyzx, l(0.454545, 0.454545, 0.454545, 0.000000) +exp o0.xyz, r0.xyzx +mov o0.w, l(1.000000) +ret +// Approximately 101 instruction slots used +#endif + +const BYTE g_pointPS[] = +{ + 68, 88, 66, 67, 132, 161, + 61, 72, 143, 190, 218, 225, + 129, 194, 219, 86, 52, 88, + 26, 5, 1, 0, 0, 0, + 244, 17, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, + 12, 4, 0, 0, 220, 4, + 0, 0, 16, 5, 0, 0, + 88, 17, 0, 0, 82, 68, + 69, 70, 208, 3, 0, 0, + 1, 0, 0, 0, 196, 0, + 0, 0, 3, 0, 0, 0, + 60, 0, 0, 0, 0, 5, + 255, 255, 0, 1, 0, 0, + 156, 3, 0, 0, 82, 68, + 49, 49, 60, 0, 0, 0, + 24, 0, 0, 0, 32, 0, + 0, 0, 40, 0, 0, 0, + 36, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 156, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 3, 0, + 0, 0, 170, 0, 0, 0, + 2, 0, 0, 0, 5, 0, + 0, 0, 4, 0, 0, 0, + 255, 255, 255, 255, 0, 0, + 0, 0, 1, 0, 0, 0, + 1, 0, 0, 0, 184, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 1, 0, 0, 0, + 115, 104, 97, 100, 111, 119, + 83, 97, 109, 112, 108, 101, + 114, 0, 115, 104, 97, 100, + 111, 119, 84, 101, 120, 116, + 117, 114, 101, 0, 99, 111, + 110, 115, 116, 66, 117, 102, + 0, 171, 171, 171, 184, 0, + 0, 0, 1, 0, 0, 0, + 220, 0, 0, 0, 112, 2, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 4, 1, + 0, 0, 0, 0, 0, 0, + 100, 2, 0, 0, 2, 0, + 0, 0, 120, 3, 0, 0, + 0, 0, 0, 0, 255, 255, + 255, 255, 0, 0, 0, 0, + 255, 255, 255, 255, 0, 0, + 0, 0, 103, 80, 97, 114, + 97, 109, 115, 0, 80, 111, + 105, 110, 116, 83, 104, 97, + 100, 101, 114, 67, 111, 110, + 115, 116, 0, 109, 111, 100, + 101, 108, 86, 105, 101, 119, + 0, 102, 108, 111, 97, 116, + 52, 120, 52, 0, 3, 0, + 3, 0, 4, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 39, 1, 0, 0, 112, 114, + 111, 106, 101, 99, 116, 105, + 111, 110, 0, 108, 105, 103, + 104, 116, 84, 114, 97, 110, + 115, 102, 111, 114, 109, 0, + 99, 111, 108, 111, 114, 115, + 0, 102, 108, 111, 97, 116, + 52, 0, 1, 0, 3, 0, + 1, 0, 4, 0, 8, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 117, 1, + 0, 0, 115, 104, 97, 100, + 111, 119, 84, 97, 112, 115, + 0, 171, 1, 0, 3, 0, + 1, 0, 4, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 117, 1, + 0, 0, 108, 105, 103, 104, + 116, 80, 111, 115, 0, 102, + 108, 111, 97, 116, 51, 0, + 1, 0, 3, 0, 1, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 217, 1, 0, 0, + 95, 112, 97, 100, 48, 0, + 102, 108, 111, 97, 116, 0, + 0, 0, 3, 0, 1, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 10, 2, 0, 0, + 108, 105, 103, 104, 116, 68, + 105, 114, 0, 95, 112, 97, + 100, 49, 0, 112, 111, 105, + 110, 116, 82, 97, 100, 105, + 117, 115, 0, 112, 111, 105, + 110, 116, 83, 99, 97, 108, + 101, 0, 115, 112, 111, 116, + 77, 105, 110, 0, 115, 112, + 111, 116, 77, 97, 120, 0, + 109, 111, 100, 101, 0, 105, + 110, 116, 0, 171, 0, 0, + 2, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 111, 2, 0, 0, 95, 112, + 97, 100, 50, 0, 171, 171, + 0, 0, 2, 0, 1, 0, + 1, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 111, 2, 0, 0, + 29, 1, 0, 0, 48, 1, + 0, 0, 0, 0, 0, 0, + 84, 1, 0, 0, 48, 1, + 0, 0, 64, 0, 0, 0, + 95, 1, 0, 0, 48, 1, + 0, 0, 128, 0, 0, 0, + 110, 1, 0, 0, 124, 1, + 0, 0, 192, 0, 0, 0, + 160, 1, 0, 0, 172, 1, + 0, 0, 64, 1, 0, 0, + 208, 1, 0, 0, 224, 1, + 0, 0, 0, 2, 0, 0, + 4, 2, 0, 0, 16, 2, + 0, 0, 12, 2, 0, 0, + 52, 2, 0, 0, 224, 1, + 0, 0, 16, 2, 0, 0, + 61, 2, 0, 0, 16, 2, + 0, 0, 28, 2, 0, 0, + 67, 2, 0, 0, 16, 2, + 0, 0, 32, 2, 0, 0, + 79, 2, 0, 0, 16, 2, + 0, 0, 36, 2, 0, 0, + 90, 2, 0, 0, 16, 2, + 0, 0, 40, 2, 0, 0, + 98, 2, 0, 0, 16, 2, + 0, 0, 44, 2, 0, 0, + 106, 2, 0, 0, 116, 2, + 0, 0, 48, 2, 0, 0, + 152, 2, 0, 0, 160, 2, + 0, 0, 64, 2, 0, 0, + 5, 0, 0, 0, 1, 0, + 144, 0, 0, 0, 15, 0, + 196, 2, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 12, 1, 0, 0, + 77, 105, 99, 114, 111, 115, + 111, 102, 116, 32, 40, 82, + 41, 32, 72, 76, 83, 76, + 32, 83, 104, 97, 100, 101, + 114, 32, 67, 111, 109, 112, + 105, 108, 101, 114, 32, 54, + 46, 51, 46, 57, 54, 48, + 48, 46, 49, 54, 51, 56, + 52, 0, 171, 171, 73, 83, + 71, 78, 200, 0, 0, 0, + 7, 0, 0, 0, 8, 0, + 0, 0, 176, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 15, 0, + 0, 0, 188, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 3, 3, + 0, 0, 188, 0, 0, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 2, 0, 0, 0, 15, 15, + 0, 0, 188, 0, 0, 0, + 2, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 3, 0, 0, 0, 7, 7, + 0, 0, 188, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 4, 0, 0, 0, 15, 15, + 0, 0, 188, 0, 0, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 5, 0, 0, 0, 7, 0, + 0, 0, 188, 0, 0, 0, + 5, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 6, 0, 0, 0, 7, 0, + 0, 0, 83, 86, 95, 80, + 79, 83, 73, 84, 73, 79, + 78, 0, 84, 69, 88, 67, + 79, 79, 82, 68, 0, 171, + 171, 171, 79, 83, 71, 78, + 44, 0, 0, 0, 1, 0, + 0, 0, 8, 0, 0, 0, + 32, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 15, 0, 0, 0, + 83, 86, 95, 84, 65, 82, + 71, 69, 84, 0, 171, 171, + 83, 72, 69, 88, 64, 12, + 0, 0, 80, 0, 0, 0, + 16, 3, 0, 0, 106, 8, + 0, 1, 89, 0, 0, 4, + 70, 142, 32, 0, 0, 0, + 0, 0, 36, 0, 0, 0, + 90, 8, 0, 3, 0, 96, + 16, 0, 0, 0, 0, 0, + 88, 24, 0, 4, 0, 112, + 16, 0, 0, 0, 0, 0, + 85, 85, 0, 0, 98, 16, + 0, 3, 50, 16, 16, 0, + 1, 0, 0, 0, 98, 16, + 0, 3, 242, 16, 16, 0, + 2, 0, 0, 0, 98, 16, + 0, 3, 114, 16, 16, 0, + 3, 0, 0, 0, 98, 16, + 0, 3, 242, 16, 16, 0, + 4, 0, 0, 0, 101, 0, + 0, 3, 242, 32, 16, 0, + 0, 0, 0, 0, 104, 0, + 0, 2, 6, 0, 0, 0, + 50, 0, 0, 15, 50, 0, + 16, 0, 0, 0, 0, 0, + 70, 16, 16, 0, 1, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 64, 0, 0, + 0, 192, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 128, 191, + 0, 0, 128, 63, 0, 0, + 0, 0, 0, 0, 0, 0, + 15, 0, 0, 7, 18, 0, + 16, 0, 0, 0, 0, 0, + 70, 0, 16, 0, 0, 0, + 0, 0, 70, 0, 16, 0, + 0, 0, 0, 0, 49, 0, + 0, 7, 34, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 10, 0, 16, 0, 0, 0, + 0, 0, 13, 0, 4, 3, + 26, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 8, + 18, 0, 16, 0, 0, 0, + 0, 0, 10, 0, 16, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 75, 0, + 0, 5, 66, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 0, 0, 0, 0, + 32, 0, 0, 8, 130, 0, + 16, 0, 0, 0, 0, 0, + 10, 128, 32, 0, 0, 0, + 0, 0, 35, 0, 0, 0, + 1, 64, 0, 0, 2, 0, + 0, 0, 31, 0, 4, 3, + 58, 0, 16, 0, 0, 0, + 0, 0, 56, 0, 0, 7, + 130, 0, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 0, 0, 0, 0, 58, 16, + 16, 0, 4, 0, 0, 0, + 56, 0, 0, 7, 114, 32, + 16, 0, 0, 0, 0, 0, + 246, 15, 16, 0, 0, 0, + 0, 0, 70, 18, 16, 0, + 4, 0, 0, 0, 54, 0, + 0, 5, 130, 32, 16, 0, + 0, 0, 0, 0, 58, 0, + 16, 0, 0, 0, 0, 0, + 62, 0, 0, 1, 21, 0, + 0, 1, 14, 0, 0, 7, + 114, 0, 16, 0, 1, 0, + 0, 0, 70, 18, 16, 0, + 2, 0, 0, 0, 246, 31, + 16, 0, 2, 0, 0, 0, + 50, 0, 0, 15, 114, 0, + 16, 0, 2, 0, 0, 0, + 70, 2, 16, 0, 1, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 63, 0, 0, + 0, 63, 0, 0, 128, 63, + 0, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 63, + 0, 0, 0, 63, 0, 0, + 0, 0, 0, 0, 0, 0, + 49, 0, 0, 7, 130, 0, + 16, 0, 0, 0, 0, 0, + 10, 0, 16, 0, 2, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 0, 0, 49, 0, + 0, 7, 66, 0, 16, 0, + 1, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 10, 0, 16, 0, 2, 0, + 0, 0, 60, 0, 0, 7, + 130, 0, 16, 0, 0, 0, + 0, 0, 58, 0, 16, 0, + 0, 0, 0, 0, 42, 0, + 16, 0, 1, 0, 0, 0, + 0, 0, 0, 9, 66, 0, + 16, 0, 1, 0, 0, 0, + 26, 128, 32, 128, 65, 0, + 0, 0, 0, 0, 0, 0, + 20, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 56, 0, 0, 8, 18, 0, + 16, 0, 3, 0, 0, 0, + 10, 128, 32, 0, 0, 0, + 0, 0, 20, 0, 0, 0, + 1, 64, 0, 0, 111, 18, + 3, 59, 56, 0, 0, 7, + 34, 0, 16, 0, 3, 0, + 0, 0, 42, 0, 16, 0, + 1, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 3, 59, + 0, 0, 0, 8, 130, 0, + 16, 0, 2, 0, 0, 0, + 26, 0, 16, 128, 65, 0, + 0, 0, 2, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 0, 0, 0, 7, + 194, 0, 16, 0, 1, 0, + 0, 0, 6, 12, 16, 0, + 2, 0, 0, 0, 6, 4, + 16, 0, 3, 0, 0, 0, + 70, 0, 0, 141, 194, 0, + 0, 128, 67, 85, 21, 0, + 66, 0, 16, 0, 1, 0, + 0, 0, 230, 10, 16, 0, + 1, 0, 0, 0, 6, 112, + 16, 0, 0, 0, 0, 0, + 0, 96, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 2, 0, 0, 0, 0, 0, + 0, 9, 130, 0, 16, 0, + 1, 0, 0, 0, 26, 128, + 32, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 21, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 56, 0, + 0, 8, 18, 0, 16, 0, + 3, 0, 0, 0, 10, 128, + 32, 0, 0, 0, 0, 0, + 21, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 3, 59, + 56, 0, 0, 7, 34, 0, + 16, 0, 3, 0, 0, 0, + 58, 0, 16, 0, 1, 0, + 0, 0, 1, 64, 0, 0, + 111, 18, 3, 59, 0, 0, + 0, 7, 50, 0, 16, 0, + 3, 0, 0, 0, 198, 0, + 16, 0, 2, 0, 0, 0, + 70, 0, 16, 0, 3, 0, + 0, 0, 70, 0, 0, 141, + 194, 0, 0, 128, 67, 85, + 21, 0, 130, 0, 16, 0, + 1, 0, 0, 0, 70, 0, + 16, 0, 3, 0, 0, 0, + 6, 112, 16, 0, 0, 0, + 0, 0, 0, 96, 16, 0, + 0, 0, 0, 0, 42, 0, + 16, 0, 2, 0, 0, 0, + 0, 0, 0, 9, 18, 0, + 16, 0, 3, 0, 0, 0, + 26, 128, 32, 128, 65, 0, + 0, 0, 0, 0, 0, 0, + 22, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 56, 0, 0, 8, 18, 0, + 16, 0, 4, 0, 0, 0, + 10, 128, 32, 0, 0, 0, + 0, 0, 22, 0, 0, 0, + 1, 64, 0, 0, 111, 18, + 3, 59, 56, 0, 0, 7, + 34, 0, 16, 0, 4, 0, + 0, 0, 10, 0, 16, 0, + 3, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 3, 59, + 0, 0, 0, 7, 50, 0, + 16, 0, 3, 0, 0, 0, + 198, 0, 16, 0, 2, 0, + 0, 0, 70, 0, 16, 0, + 4, 0, 0, 0, 70, 0, + 0, 141, 194, 0, 0, 128, + 67, 85, 21, 0, 18, 0, + 16, 0, 3, 0, 0, 0, + 70, 0, 16, 0, 3, 0, + 0, 0, 6, 112, 16, 0, + 0, 0, 0, 0, 0, 96, + 16, 0, 0, 0, 0, 0, + 42, 0, 16, 0, 2, 0, + 0, 0, 0, 0, 0, 9, + 34, 0, 16, 0, 3, 0, + 0, 0, 26, 128, 32, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 23, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 56, 0, 0, 8, + 18, 0, 16, 0, 4, 0, + 0, 0, 10, 128, 32, 0, + 0, 0, 0, 0, 23, 0, + 0, 0, 1, 64, 0, 0, + 111, 18, 3, 59, 56, 0, + 0, 7, 34, 0, 16, 0, + 4, 0, 0, 0, 26, 0, + 16, 0, 3, 0, 0, 0, + 1, 64, 0, 0, 111, 18, + 3, 59, 0, 0, 0, 7, + 98, 0, 16, 0, 3, 0, + 0, 0, 6, 3, 16, 0, + 2, 0, 0, 0, 6, 1, + 16, 0, 4, 0, 0, 0, + 70, 0, 0, 141, 194, 0, + 0, 128, 67, 85, 21, 0, + 34, 0, 16, 0, 3, 0, + 0, 0, 150, 5, 16, 0, + 3, 0, 0, 0, 6, 112, + 16, 0, 0, 0, 0, 0, + 0, 96, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 2, 0, 0, 0, 0, 0, + 0, 9, 66, 0, 16, 0, + 3, 0, 0, 0, 26, 128, + 32, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 24, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 56, 0, + 0, 8, 18, 0, 16, 0, + 4, 0, 0, 0, 10, 128, + 32, 0, 0, 0, 0, 0, + 24, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 3, 59, + 56, 0, 0, 7, 34, 0, + 16, 0, 4, 0, 0, 0, + 42, 0, 16, 0, 3, 0, + 0, 0, 1, 64, 0, 0, + 111, 18, 3, 59, 0, 0, + 0, 7, 194, 0, 16, 0, + 3, 0, 0, 0, 6, 12, + 16, 0, 2, 0, 0, 0, + 6, 4, 16, 0, 4, 0, + 0, 0, 70, 0, 0, 141, + 194, 0, 0, 128, 67, 85, + 21, 0, 66, 0, 16, 0, + 3, 0, 0, 0, 230, 10, + 16, 0, 3, 0, 0, 0, + 6, 112, 16, 0, 0, 0, + 0, 0, 0, 96, 16, 0, + 0, 0, 0, 0, 42, 0, + 16, 0, 2, 0, 0, 0, + 0, 0, 0, 9, 130, 0, + 16, 0, 3, 0, 0, 0, + 26, 128, 32, 128, 65, 0, + 0, 0, 0, 0, 0, 0, + 25, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 56, 0, 0, 8, 18, 0, + 16, 0, 4, 0, 0, 0, + 10, 128, 32, 0, 0, 0, + 0, 0, 25, 0, 0, 0, + 1, 64, 0, 0, 111, 18, + 3, 59, 56, 0, 0, 7, + 34, 0, 16, 0, 4, 0, + 0, 0, 58, 0, 16, 0, + 3, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 3, 59, + 0, 0, 0, 7, 50, 0, + 16, 0, 4, 0, 0, 0, + 198, 0, 16, 0, 2, 0, + 0, 0, 70, 0, 16, 0, + 4, 0, 0, 0, 70, 0, + 0, 141, 194, 0, 0, 128, + 67, 85, 21, 0, 130, 0, + 16, 0, 3, 0, 0, 0, + 70, 0, 16, 0, 4, 0, + 0, 0, 6, 112, 16, 0, + 0, 0, 0, 0, 0, 96, + 16, 0, 0, 0, 0, 0, + 42, 0, 16, 0, 2, 0, + 0, 0, 0, 0, 0, 9, + 18, 0, 16, 0, 4, 0, + 0, 0, 26, 128, 32, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 26, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 56, 0, 0, 8, + 18, 0, 16, 0, 5, 0, + 0, 0, 10, 128, 32, 0, + 0, 0, 0, 0, 26, 0, + 0, 0, 1, 64, 0, 0, + 111, 18, 3, 59, 56, 0, + 0, 7, 34, 0, 16, 0, + 5, 0, 0, 0, 10, 0, + 16, 0, 4, 0, 0, 0, + 1, 64, 0, 0, 111, 18, + 3, 59, 0, 0, 0, 7, + 50, 0, 16, 0, 4, 0, + 0, 0, 198, 0, 16, 0, + 2, 0, 0, 0, 70, 0, + 16, 0, 5, 0, 0, 0, + 70, 0, 0, 141, 194, 0, + 0, 128, 67, 85, 21, 0, + 18, 0, 16, 0, 4, 0, + 0, 0, 70, 0, 16, 0, + 4, 0, 0, 0, 6, 112, + 16, 0, 0, 0, 0, 0, + 0, 96, 16, 0, 0, 0, + 0, 0, 42, 0, 16, 0, + 2, 0, 0, 0, 0, 0, + 0, 9, 34, 0, 16, 0, + 4, 0, 0, 0, 26, 128, + 32, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 27, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 56, 0, + 0, 8, 18, 0, 16, 0, + 5, 0, 0, 0, 10, 128, + 32, 0, 0, 0, 0, 0, + 27, 0, 0, 0, 1, 64, + 0, 0, 111, 18, 3, 59, + 56, 0, 0, 7, 34, 0, + 16, 0, 5, 0, 0, 0, + 26, 0, 16, 0, 4, 0, + 0, 0, 1, 64, 0, 0, + 111, 18, 3, 59, 0, 0, + 0, 7, 146, 0, 16, 0, + 2, 0, 0, 0, 6, 12, + 16, 0, 2, 0, 0, 0, + 6, 4, 16, 0, 5, 0, + 0, 0, 70, 0, 0, 141, + 194, 0, 0, 128, 67, 85, + 21, 0, 18, 0, 16, 0, + 2, 0, 0, 0, 198, 0, + 16, 0, 2, 0, 0, 0, + 6, 112, 16, 0, 0, 0, + 0, 0, 0, 96, 16, 0, + 0, 0, 0, 0, 42, 0, + 16, 0, 2, 0, 0, 0, + 31, 0, 0, 3, 58, 0, + 16, 0, 0, 0, 0, 0, + 49, 0, 0, 7, 130, 0, + 16, 0, 0, 0, 0, 0, + 26, 0, 16, 0, 2, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 0, 0, 49, 0, + 0, 7, 34, 0, 16, 0, + 2, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 26, 0, 16, 0, 2, 0, + 0, 0, 60, 0, 0, 7, + 130, 0, 16, 0, 0, 0, + 0, 0, 58, 0, 16, 0, + 0, 0, 0, 0, 26, 0, + 16, 0, 2, 0, 0, 0, + 31, 0, 0, 3, 58, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 0, 7, 130, 0, + 16, 0, 0, 0, 0, 0, + 58, 0, 16, 0, 1, 0, + 0, 0, 42, 0, 16, 0, + 1, 0, 0, 0, 0, 0, + 0, 7, 130, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 3, 0, 0, 0, + 58, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 7, + 130, 0, 16, 0, 0, 0, + 0, 0, 26, 0, 16, 0, + 3, 0, 0, 0, 58, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 0, 7, 130, 0, + 16, 0, 0, 0, 0, 0, + 42, 0, 16, 0, 3, 0, + 0, 0, 58, 0, 16, 0, + 0, 0, 0, 0, 0, 0, + 0, 7, 130, 0, 16, 0, + 0, 0, 0, 0, 58, 0, + 16, 0, 3, 0, 0, 0, + 58, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 7, + 130, 0, 16, 0, 0, 0, + 0, 0, 10, 0, 16, 0, + 4, 0, 0, 0, 58, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 0, 7, 130, 0, + 16, 0, 0, 0, 0, 0, + 10, 0, 16, 0, 2, 0, + 0, 0, 58, 0, 16, 0, + 0, 0, 0, 0, 56, 0, + 0, 7, 130, 0, 16, 0, + 0, 0, 0, 0, 58, 0, + 16, 0, 0, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 0, 62, 18, 0, 0, 1, + 54, 0, 0, 5, 130, 0, + 16, 0, 0, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 21, 0, 0, 1, + 18, 0, 0, 1, 54, 0, + 0, 5, 130, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 21, 0, 0, 1, 15, 0, + 0, 7, 18, 0, 16, 0, + 1, 0, 0, 0, 70, 0, + 16, 0, 1, 0, 0, 0, + 70, 0, 16, 0, 1, 0, + 0, 0, 0, 0, 0, 10, + 34, 0, 16, 0, 1, 0, + 0, 0, 58, 128, 32, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 34, 0, 0, 0, + 42, 128, 32, 0, 0, 0, + 0, 0, 34, 0, 0, 0, + 0, 0, 0, 9, 18, 0, + 16, 0, 1, 0, 0, 0, + 10, 0, 16, 0, 1, 0, + 0, 0, 58, 128, 32, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 34, 0, 0, 0, + 14, 0, 0, 10, 34, 0, + 16, 0, 1, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 128, 63, 0, 0, 128, 63, + 0, 0, 128, 63, 0, 0, + 128, 63, 26, 0, 16, 0, + 1, 0, 0, 0, 56, 32, + 0, 7, 18, 0, 16, 0, + 1, 0, 0, 0, 26, 0, + 16, 0, 1, 0, 0, 0, + 10, 0, 16, 0, 1, 0, + 0, 0, 50, 0, 0, 9, + 34, 0, 16, 0, 1, 0, + 0, 0, 10, 0, 16, 0, + 1, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 192, + 1, 64, 0, 0, 0, 0, + 64, 64, 56, 0, 0, 7, + 18, 0, 16, 0, 1, 0, + 0, 0, 10, 0, 16, 0, + 1, 0, 0, 0, 10, 0, + 16, 0, 1, 0, 0, 0, + 56, 0, 0, 7, 18, 0, + 16, 0, 1, 0, 0, 0, + 10, 0, 16, 0, 1, 0, + 0, 0, 26, 0, 16, 0, + 1, 0, 0, 0, 52, 0, + 0, 7, 18, 0, 16, 0, + 1, 0, 0, 0, 10, 0, + 16, 0, 1, 0, 0, 0, + 1, 64, 0, 0, 205, 204, + 76, 61, 56, 0, 0, 10, + 226, 0, 16, 0, 1, 0, + 0, 0, 6, 25, 16, 0, + 4, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 0, + 102, 102, 102, 63, 102, 102, + 102, 63, 102, 102, 102, 63, + 50, 0, 0, 15, 50, 0, + 16, 0, 0, 0, 0, 0, + 70, 16, 16, 0, 1, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 64, 0, 0, + 0, 192, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 128, 191, + 0, 0, 128, 63, 0, 0, + 0, 0, 0, 0, 0, 0, + 16, 0, 0, 7, 18, 0, + 16, 0, 0, 0, 0, 0, + 70, 18, 16, 0, 3, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 50, 0, + 0, 9, 18, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 0, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 0, 191, 1, 64, 0, 0, + 0, 0, 0, 63, 56, 0, + 0, 7, 18, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 0, 0, 0, 0, + 10, 0, 16, 0, 0, 0, + 0, 0, 56, 0, 0, 7, + 114, 0, 16, 0, 0, 0, + 0, 0, 6, 0, 16, 0, + 0, 0, 0, 0, 150, 7, + 16, 0, 1, 0, 0, 0, + 52, 0, 0, 7, 130, 0, + 16, 0, 0, 0, 0, 0, + 58, 0, 16, 0, 0, 0, + 0, 0, 1, 64, 0, 0, + 205, 204, 76, 62, 56, 0, + 0, 7, 114, 0, 16, 0, + 0, 0, 0, 0, 246, 15, + 16, 0, 0, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 56, 0, 0, 7, + 114, 0, 16, 0, 0, 0, + 0, 0, 6, 0, 16, 0, + 1, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 47, 0, 0, 6, 114, 0, + 16, 0, 0, 0, 0, 0, + 70, 2, 16, 128, 129, 0, + 0, 0, 0, 0, 0, 0, + 56, 0, 0, 10, 114, 0, + 16, 0, 0, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 2, 64, 0, 0, + 47, 186, 232, 62, 47, 186, + 232, 62, 47, 186, 232, 62, + 0, 0, 0, 0, 25, 0, + 0, 5, 114, 32, 16, 0, + 0, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 54, 0, 0, 5, 130, 32, + 16, 0, 0, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 62, 0, 0, 1, + 83, 84, 65, 84, 148, 0, + 0, 0, 101, 0, 0, 0, + 6, 0, 0, 0, 0, 0, + 0, 0, 5, 0, 0, 0, + 75, 0, 0, 0, 1, 0, + 0, 0, 2, 0, 0, 0, + 4, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0 +}; diff --git a/demo/d3d/shaders/pointShadowPS.hlsl b/demo/d3d/shaders/pointShadowPS.hlsl new file mode 100644 index 0000000..d8fcff8 --- /dev/null +++ b/demo/d3d/shaders/pointShadowPS.hlsl @@ -0,0 +1,17 @@ +#include "shaderCommon.h" + +cbuffer constBuf : register(b0) +{ + PointShaderConst gParams; +}; + +void pointShadowPS(PointGeoOut input) +{ + // calculate normal from texture coordinates + float2 normal = input.texCoord.xy - float2(0.5, 0.5); + float mag = dot(normal.xy, normal.xy); + if (mag > 0.5 * 0.5) + { + discard; // kill pixels outside circle + } +} diff --git a/demo/d3d/shaders/pointShadowPS.hlsl.h b/demo/d3d/shaders/pointShadowPS.hlsl.h new file mode 100644 index 0000000..ee3c121 --- /dev/null +++ b/demo/d3d/shaders/pointShadowPS.hlsl.h @@ -0,0 +1,157 @@ +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_POSITION 0 xyzw 0 POS float +// TEXCOORD 0 xy 1 NONE float xy +// TEXCOORD 1 xyzw 2 NONE float +// TEXCOORD 2 xyz 3 NONE float +// TEXCOORD 3 xyzw 4 NONE float +// TEXCOORD 4 xyz 5 NONE float +// TEXCOORD 5 xyz 6 NONE float +// +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// no Output +ps_5_0 +dcl_globalFlags refactoringAllowed +dcl_input_ps linear v1.xy +dcl_temps 1 +add r0.xy, v1.xyxx, l(-0.500000, -0.500000, 0.000000, 0.000000) +dp2 r0.x, r0.xyxx, r0.xyxx +lt r0.x, l(0.250000), r0.x +discard_nz r0.x +ret +// Approximately 5 instruction slots used +#endif + +const BYTE g_pointShadowPS[] = +{ + 68, 88, 66, 67, 124, 19, + 253, 39, 130, 123, 235, 41, + 10, 2, 21, 191, 153, 200, + 242, 4, 1, 0, 0, 0, + 192, 2, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, + 172, 0, 0, 0, 124, 1, + 0, 0, 140, 1, 0, 0, + 36, 2, 0, 0, 82, 68, + 69, 70, 112, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 60, 0, 0, 0, 0, 5, + 255, 255, 0, 1, 0, 0, + 60, 0, 0, 0, 82, 68, + 49, 49, 60, 0, 0, 0, + 24, 0, 0, 0, 32, 0, + 0, 0, 40, 0, 0, 0, + 36, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 77, 105, 99, 114, 111, 115, + 111, 102, 116, 32, 40, 82, + 41, 32, 72, 76, 83, 76, + 32, 83, 104, 97, 100, 101, + 114, 32, 67, 111, 109, 112, + 105, 108, 101, 114, 32, 54, + 46, 51, 46, 57, 54, 48, + 48, 46, 49, 54, 51, 56, + 52, 0, 171, 171, 73, 83, + 71, 78, 200, 0, 0, 0, + 7, 0, 0, 0, 8, 0, + 0, 0, 176, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 15, 0, + 0, 0, 188, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 3, 3, + 0, 0, 188, 0, 0, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 2, 0, 0, 0, 15, 0, + 0, 0, 188, 0, 0, 0, + 2, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 3, 0, 0, 0, 7, 0, + 0, 0, 188, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 4, 0, 0, 0, 15, 0, + 0, 0, 188, 0, 0, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 5, 0, 0, 0, 7, 0, + 0, 0, 188, 0, 0, 0, + 5, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 6, 0, 0, 0, 7, 0, + 0, 0, 83, 86, 95, 80, + 79, 83, 73, 84, 73, 79, + 78, 0, 84, 69, 88, 67, + 79, 79, 82, 68, 0, 171, + 171, 171, 79, 83, 71, 78, + 8, 0, 0, 0, 0, 0, + 0, 0, 8, 0, 0, 0, + 83, 72, 69, 88, 144, 0, + 0, 0, 80, 0, 0, 0, + 36, 0, 0, 0, 106, 8, + 0, 1, 98, 16, 0, 3, + 50, 16, 16, 0, 1, 0, + 0, 0, 104, 0, 0, 2, + 1, 0, 0, 0, 0, 0, + 0, 10, 50, 0, 16, 0, + 0, 0, 0, 0, 70, 16, + 16, 0, 1, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 191, 0, 0, 0, 191, + 0, 0, 0, 0, 0, 0, + 0, 0, 15, 0, 0, 7, + 18, 0, 16, 0, 0, 0, + 0, 0, 70, 0, 16, 0, + 0, 0, 0, 0, 70, 0, + 16, 0, 0, 0, 0, 0, + 49, 0, 0, 7, 18, 0, + 16, 0, 0, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 62, 10, 0, 16, 0, + 0, 0, 0, 0, 13, 0, + 4, 3, 10, 0, 16, 0, + 0, 0, 0, 0, 62, 0, + 0, 1, 83, 84, 65, 84, + 148, 0, 0, 0, 5, 0, + 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0 +}; diff --git a/demo/d3d/shaders/pointVS.hlsl b/demo/d3d/shaders/pointVS.hlsl new file mode 100644 index 0000000..ecd1e38 --- /dev/null +++ b/demo/d3d/shaders/pointVS.hlsl @@ -0,0 +1,25 @@ +#include "shaderCommon.h" + +cbuffer constBuf : register(b0) +{ + PointShaderConst gParams; +}; + +PointVertexOut pointVS(PointVertexIn input, uint instance : SV_VertexID) +{ + const float4 modelPosition = input.position; + const float4x4 modelViewMatrix = gParams.modelView; + + float density = input.density; + int phase = input.phase; + + // calculate window-space point size + float4 viewPos = mul(modelViewMatrix, float4(modelPosition.xyz, 1.0)); + + PointVertexOut output; + output.viewPosition = viewPos; + output.density = density; + output.phase = phase; + output.modelPosition = modelPosition; + return output; +} diff --git a/demo/d3d/shaders/pointVS.hlsl.h b/demo/d3d/shaders/pointVS.hlsl.h new file mode 100644 index 0000000..5051a59 --- /dev/null +++ b/demo/d3d/shaders/pointVS.hlsl.h @@ -0,0 +1,374 @@ +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// Buffer Definitions: +// +// cbuffer constBuf +// { +// +// struct PointShaderConst +// { +// +// float4x4 modelView; // Offset: 0 +// float4x4 projection; // Offset: 64 +// float4x4 lightTransform; // Offset: 128 +// float4 colors[8]; // Offset: 192 +// float4 shadowTaps[12]; // Offset: 320 +// float3 lightPos; // Offset: 512 +// float _pad0; // Offset: 524 +// float3 lightDir; // Offset: 528 +// float _pad1; // Offset: 540 +// float pointRadius; // Offset: 544 +// float pointScale; // Offset: 548 +// float spotMin; // Offset: 552 +// float spotMax; // Offset: 556 +// int mode; // Offset: 560 +// int _pad2[3]; // Offset: 576 +// +// } gParams; // Offset: 0 Size: 612 +// +// } +// +// +// Resource Bindings: +// +// Name Type Format Dim Slot Elements +// ------------------------------ ---------- ------- ----------- ---- -------- +// constBuf cbuffer NA NA 0 1 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// POSITION 0 xyzw 0 NONE float xyzw +// DENSITY 0 x 1 NONE float x +// PHASE 0 x 2 NONE int x +// SV_VertexID 0 x 3 VERTID uint +// +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// POSITION 0 xyzw 0 NONE float xyzw +// DENSITY 0 x 1 NONE float x +// PHASE 0 x 2 NONE int x +// VERTEX 0 xyzw 3 NONE float xyzw +// +vs_5_0 +dcl_globalFlags refactoringAllowed +dcl_constantbuffer cb0[4], immediateIndexed +dcl_input v0.xyzw +dcl_input v1.x +dcl_input v2.x +dcl_output o0.xyzw +dcl_output o1.x +dcl_output o2.x +dcl_output o3.xyzw +dcl_temps 1 +mul r0.xyzw, v0.yyyy, cb0[1].xyzw +mad r0.xyzw, cb0[0].xyzw, v0.xxxx, r0.xyzw +mad r0.xyzw, cb0[2].xyzw, v0.zzzz, r0.xyzw +add o0.xyzw, r0.xyzw, cb0[3].xyzw +mov o1.x, v1.x +mov o2.x, v2.x +mov o3.xyzw, v0.xyzw +ret +// Approximately 8 instruction slots used +#endif + +const BYTE g_pointVS[] = +{ + 68, 88, 66, 67, 214, 36, + 191, 126, 186, 99, 189, 31, + 31, 225, 65, 123, 198, 88, + 217, 159, 1, 0, 0, 0, + 192, 6, 0, 0, 5, 0, + 0, 0, 52, 0, 0, 0, + 176, 3, 0, 0, 68, 4, + 0, 0, 212, 4, 0, 0, + 36, 6, 0, 0, 82, 68, + 69, 70, 116, 3, 0, 0, + 1, 0, 0, 0, 104, 0, + 0, 0, 1, 0, 0, 0, + 60, 0, 0, 0, 0, 5, + 254, 255, 0, 1, 0, 0, + 64, 3, 0, 0, 82, 68, + 49, 49, 60, 0, 0, 0, + 24, 0, 0, 0, 32, 0, + 0, 0, 40, 0, 0, 0, + 36, 0, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, + 92, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 1, 0, + 0, 0, 99, 111, 110, 115, + 116, 66, 117, 102, 0, 171, + 171, 171, 92, 0, 0, 0, + 1, 0, 0, 0, 128, 0, + 0, 0, 112, 2, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 168, 0, 0, 0, + 0, 0, 0, 0, 100, 2, + 0, 0, 2, 0, 0, 0, + 28, 3, 0, 0, 0, 0, + 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 255, 255, + 255, 255, 0, 0, 0, 0, + 103, 80, 97, 114, 97, 109, + 115, 0, 80, 111, 105, 110, + 116, 83, 104, 97, 100, 101, + 114, 67, 111, 110, 115, 116, + 0, 109, 111, 100, 101, 108, + 86, 105, 101, 119, 0, 102, + 108, 111, 97, 116, 52, 120, + 52, 0, 3, 0, 3, 0, + 4, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 203, 0, + 0, 0, 112, 114, 111, 106, + 101, 99, 116, 105, 111, 110, + 0, 108, 105, 103, 104, 116, + 84, 114, 97, 110, 115, 102, + 111, 114, 109, 0, 99, 111, + 108, 111, 114, 115, 0, 102, + 108, 111, 97, 116, 52, 0, + 1, 0, 3, 0, 1, 0, + 4, 0, 8, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 25, 1, 0, 0, + 115, 104, 97, 100, 111, 119, + 84, 97, 112, 115, 0, 171, + 1, 0, 3, 0, 1, 0, + 4, 0, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 25, 1, 0, 0, + 108, 105, 103, 104, 116, 80, + 111, 115, 0, 102, 108, 111, + 97, 116, 51, 0, 1, 0, + 3, 0, 1, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 125, 1, 0, 0, 95, 112, + 97, 100, 48, 0, 102, 108, + 111, 97, 116, 0, 0, 0, + 3, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 174, 1, 0, 0, 108, 105, + 103, 104, 116, 68, 105, 114, + 0, 95, 112, 97, 100, 49, + 0, 112, 111, 105, 110, 116, + 82, 97, 100, 105, 117, 115, + 0, 112, 111, 105, 110, 116, + 83, 99, 97, 108, 101, 0, + 115, 112, 111, 116, 77, 105, + 110, 0, 115, 112, 111, 116, + 77, 97, 120, 0, 109, 111, + 100, 101, 0, 105, 110, 116, + 0, 171, 0, 0, 2, 0, + 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 19, 2, + 0, 0, 95, 112, 97, 100, + 50, 0, 171, 171, 0, 0, + 2, 0, 1, 0, 1, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 19, 2, 0, 0, 193, 0, + 0, 0, 212, 0, 0, 0, + 0, 0, 0, 0, 248, 0, + 0, 0, 212, 0, 0, 0, + 64, 0, 0, 0, 3, 1, + 0, 0, 212, 0, 0, 0, + 128, 0, 0, 0, 18, 1, + 0, 0, 32, 1, 0, 0, + 192, 0, 0, 0, 68, 1, + 0, 0, 80, 1, 0, 0, + 64, 1, 0, 0, 116, 1, + 0, 0, 132, 1, 0, 0, + 0, 2, 0, 0, 168, 1, + 0, 0, 180, 1, 0, 0, + 12, 2, 0, 0, 216, 1, + 0, 0, 132, 1, 0, 0, + 16, 2, 0, 0, 225, 1, + 0, 0, 180, 1, 0, 0, + 28, 2, 0, 0, 231, 1, + 0, 0, 180, 1, 0, 0, + 32, 2, 0, 0, 243, 1, + 0, 0, 180, 1, 0, 0, + 36, 2, 0, 0, 254, 1, + 0, 0, 180, 1, 0, 0, + 40, 2, 0, 0, 6, 2, + 0, 0, 180, 1, 0, 0, + 44, 2, 0, 0, 14, 2, + 0, 0, 24, 2, 0, 0, + 48, 2, 0, 0, 60, 2, + 0, 0, 68, 2, 0, 0, + 64, 2, 0, 0, 5, 0, + 0, 0, 1, 0, 144, 0, + 0, 0, 15, 0, 104, 2, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 176, 0, 0, 0, 77, 105, + 99, 114, 111, 115, 111, 102, + 116, 32, 40, 82, 41, 32, + 72, 76, 83, 76, 32, 83, + 104, 97, 100, 101, 114, 32, + 67, 111, 109, 112, 105, 108, + 101, 114, 32, 54, 46, 51, + 46, 57, 54, 48, 48, 46, + 49, 54, 51, 56, 52, 0, + 171, 171, 73, 83, 71, 78, + 140, 0, 0, 0, 4, 0, + 0, 0, 8, 0, 0, 0, + 104, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 15, 15, 0, 0, + 113, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 1, 0, + 0, 0, 1, 1, 0, 0, + 121, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 2, 0, + 0, 0, 1, 1, 0, 0, + 127, 0, 0, 0, 0, 0, + 0, 0, 6, 0, 0, 0, + 1, 0, 0, 0, 3, 0, + 0, 0, 1, 0, 0, 0, + 80, 79, 83, 73, 84, 73, + 79, 78, 0, 68, 69, 78, + 83, 73, 84, 89, 0, 80, + 72, 65, 83, 69, 0, 83, + 86, 95, 86, 101, 114, 116, + 101, 120, 73, 68, 0, 171, + 79, 83, 71, 78, 136, 0, + 0, 0, 4, 0, 0, 0, + 8, 0, 0, 0, 104, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 113, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 1, 0, 0, 0, + 1, 14, 0, 0, 121, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, + 0, 0, 2, 0, 0, 0, + 1, 14, 0, 0, 127, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 3, 0, 0, 0, + 15, 0, 0, 0, 80, 79, + 83, 73, 84, 73, 79, 78, + 0, 68, 69, 78, 83, 73, + 84, 89, 0, 80, 72, 65, + 83, 69, 0, 86, 69, 82, + 84, 69, 88, 0, 171, 171, + 83, 72, 69, 88, 72, 1, + 0, 0, 80, 0, 1, 0, + 82, 0, 0, 0, 106, 8, + 0, 1, 89, 0, 0, 4, + 70, 142, 32, 0, 0, 0, + 0, 0, 4, 0, 0, 0, + 95, 0, 0, 3, 242, 16, + 16, 0, 0, 0, 0, 0, + 95, 0, 0, 3, 18, 16, + 16, 0, 1, 0, 0, 0, + 95, 0, 0, 3, 18, 16, + 16, 0, 2, 0, 0, 0, + 101, 0, 0, 3, 242, 32, + 16, 0, 0, 0, 0, 0, + 101, 0, 0, 3, 18, 32, + 16, 0, 1, 0, 0, 0, + 101, 0, 0, 3, 18, 32, + 16, 0, 2, 0, 0, 0, + 101, 0, 0, 3, 242, 32, + 16, 0, 3, 0, 0, 0, + 104, 0, 0, 2, 1, 0, + 0, 0, 56, 0, 0, 8, + 242, 0, 16, 0, 0, 0, + 0, 0, 86, 21, 16, 0, + 0, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 50, 0, + 0, 10, 242, 0, 16, 0, + 0, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 6, 16, + 16, 0, 0, 0, 0, 0, + 70, 14, 16, 0, 0, 0, + 0, 0, 50, 0, 0, 10, + 242, 0, 16, 0, 0, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 2, 0, + 0, 0, 166, 26, 16, 0, + 0, 0, 0, 0, 70, 14, + 16, 0, 0, 0, 0, 0, + 0, 0, 0, 8, 242, 32, + 16, 0, 0, 0, 0, 0, + 70, 14, 16, 0, 0, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 54, 0, 0, 5, + 18, 32, 16, 0, 1, 0, + 0, 0, 10, 16, 16, 0, + 1, 0, 0, 0, 54, 0, + 0, 5, 18, 32, 16, 0, + 2, 0, 0, 0, 10, 16, + 16, 0, 2, 0, 0, 0, + 54, 0, 0, 5, 242, 32, + 16, 0, 3, 0, 0, 0, + 70, 30, 16, 0, 0, 0, + 0, 0, 62, 0, 0, 1, + 83, 84, 65, 84, 148, 0, + 0, 0, 8, 0, 0, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 7, 0, 0, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0 +}; diff --git a/demo/d3d/shaders/shaderCommon.h b/demo/d3d/shaders/shaderCommon.h new file mode 100644 index 0000000..2a9cc67 --- /dev/null +++ b/demo/d3d/shaders/shaderCommon.h @@ -0,0 +1,254 @@ +struct MeshShaderConst +{ + float4x4 modelViewProjection; + float4x4 modelView; + float4x4 objectTransform; + float4x4 lightTransform; + + float4 clipPlane; + float4 fogColor; + float4 color; + float4 secondaryColor; + + float4 shadowTaps[12]; + + float3 lightPos; + float _pad0; + float3 lightDir; + float _pad1; + + float bias; + float expand; + float spotMin; + float spotMax; + + int grid; + int tex; + int colorArray; + int increaseGfxLoadForAsyncComputeTesting; +}; + +struct DebugRenderConst +{ + float4x4 modelView; + float4x4 projection; +}; + + +#ifndef EXCLUDE_SHADER_STRUCTS +struct MeshVertexIn +{ + float3 position : POSITION; + float3 normal : NORMAL; + float2 texCoord : TEXCOORD; + float4 color : COLOR; +}; + +struct MeshVertexOut +{ + float4 position : SV_POSITION; + //float3 normal : NORMAL; + //float4 color : COLOR; + //float clipDistance[1] : CLIP_DISTANCE; + + float3 worldNormal: TEXCOORD0; ///< Normal in world space + float4 lightOffsetPosition: TEXCOORD1; ///< Position in light space (offset slightly) + float3 viewLightDir: TEXCOORD2; ///< Light direction in view space + float3 worldPosition: TEXCOORD3; ///< Position in worldspace + float4 color: TEXCOORD4; ///< Color + float2 texCoord: TEXCOORD5; ///< Tex coords + float4 secondaryColor: TEXCOORD6; ///< Secondary color + float4 viewPosition: TEXCOORD7; ///< Position in view space +}; +#endif + +struct PointShaderConst +{ + float4x4 modelView; + float4x4 projection; + float4x4 lightTransform; + + float4 colors[8]; + float4 shadowTaps[12]; + + float3 lightPos; + float _pad0; + float3 lightDir; + float _pad1; + + float pointRadius; // point size in world space + float pointScale; // scale to calculate size in pixels + float spotMin; + float spotMax; + + int mode; + int _pad2[3]; +}; + +#ifndef EXCLUDE_SHADER_STRUCTS +struct PointVertexIn +{ + float4 position : POSITION; + float density : DENSITY; + int phase : PHASE; +}; + +struct PointVertexOut +{ + float4 viewPosition : POSITION; + float density : DENSITY; + int phase : PHASE; + float4 modelPosition : VERTEX; +}; + +struct PointGeoOut +{ + float4 position : SV_POSITION; + + float2 texCoord: TEXCOORD0; + float4 lightOffsetPosition: TEXCOORD1; + float3 viewLightDir: TEXCOORD2; //< Light direction in view space + float4 reflectance: TEXCOORD3; + float3 modelPosition: TEXCOORD4; ///< Model space position + float3 viewPosition : TEXCOORD5; ///< View space position +}; + +#endif + +struct FluidShaderConst +{ + float4x4 modelViewProjection; + float4x4 modelView; + float4x4 projection; // ogl projection + float4x4 inverseModelView; + float4x4 inverseProjection; // ogl inverse projection + + float4 invTexScale; + + float3 invViewport; + float _pad0; + //float3 invProjection; + //float _pad1; + + float blurRadiusWorld; + float blurScale; + float blurFalloff; + int debug; + + float3 lightPos; + float _pad1; + float3 lightDir; + float _pad2; + float4x4 lightTransform; + + float4 color; + float4 clipPosToEye; + + float spotMin; + float spotMax; + float ior; + float _pad3; + + float4 shadowTaps[12]; +}; + +#ifndef EXCLUDE_SHADER_STRUCTS +struct FluidVertexIn +{ + float4 position : POSITION; + float4 q1 : U; + float4 q2 : V; + float4 q3 : W; +}; + +struct FluidVertexOut +{ + float4 position : POSITION; + float4 bounds: TEXCOORD0; // xmin, xmax, ymin, ymax + float4 invQ0: TEXCOORD1; + float4 invQ1: TEXCOORD2; + float4 invQ2: TEXCOORD3; + float4 invQ3: TEXCOORD4; + float4 ndcPos: TEXCOORD5; /// Position in normalized device coordinates (ie /w) +}; + +struct FluidGeoOut +{ + float4 position : SV_POSITION; + float4 invQ0 : TEXCOORD0; + float4 invQ1 : TEXCOORD1; + float4 invQ2 : TEXCOORD2; + float4 invQ3 : TEXCOORD3; +}; + +struct PassthroughVertexOut +{ + float4 position : SV_POSITION; + float2 texCoord : TEXCOORD; +}; +#endif + + +struct DiffuseShaderConst +{ + float3 lightPos; float pad0; + float3 lightDir; float pad1; + float4x4 lightTransform; + float4 color; + + float4x4 modelView; + float4x4 modelViewProjection; + float4x4 projection; + + float4 shadowTaps[12]; + + float diffusion; + float diffuseRadius; // point size in world space + float diffuseScale; // scale to calculate size in pixels + + float spotMin; + float spotMax; + + float motionBlurScale; + + float pad3; + float pad4; + +}; + +#ifndef EXCLUDE_SHADER_STRUCTS + +struct DiffuseVertexIn +{ + float4 position : POSITION; // lifetime in w + float4 velocity : VELOCITY; // holding velocity in u +}; + +struct DiffuseVertexOut +{ + float4 worldPos : POSITION; // lifetime in w + float4 ndcPos : NCDPOS; + float4 viewPos : VIEWPOS; + float4 viewVel : VIEWVEL; + + float4 color : COLOR; +}; + +struct DiffuseGeometryOut +{ + float4 clipPos : SV_POSITION; + + float4 worldPos : POSITION; + + float4 viewPos : VIEWPOS; + float4 viewVel : VIEWVEL; + + float4 lightDir : LIGHTDIR; + float4 color : COLOR; + + float2 uv : UV; + +}; + +#endif + diff --git a/demo/d3d/shadersDemoContext.cpp b/demo/d3d/shadersDemoContext.cpp new file mode 100644 index 0000000..d1e7c99 --- /dev/null +++ b/demo/d3d/shadersDemoContext.cpp @@ -0,0 +1,184 @@ +// to fix min max windows macros +#define NOMINMAX + +// SDL +#include <SDL_syswm.h> + +// This +#include "shadersDemoContext.h" + +DemoContext* s_context = NULL; + +void SetDemoContext(DemoContext* context) +{ + s_context = context; +} + +DemoContext* GetDemoContext() +{ + return s_context; +} + +void ReshapeRender(SDL_Window* window) +{ + int width, height; + SDL_GetWindowSize(window, &width, &height); + s_context->onSizeChanged(width, height, false); +} + +void DestroyRender() +{ + if (s_context) + { + delete s_context; + s_context = nullptr; + } +} + +void StartFrame(Vec4 colorIn) { s_context->startFrame(colorIn); } +void EndFrame() { s_context->endFrame(); } +void PresentFrame(bool fullSync) { s_context->presentFrame(fullSync); } + +void FlushGraphicsAndWait() { s_context->flushGraphicsAndWait(); } + +void ReadFrame(int* backbuffer, int width, int height) +{ + assert(0); +} + +void GetViewRay(int x, int y, Vec3& origin, Vec3& dir) { return s_context->getViewRay(x, y, origin, dir); } + +void SetFillMode(bool wire) { s_context->setFillMode(wire); } + +void SetCullMode(bool enabled) { s_context->setCullMode(enabled); } + +void SetView(Matrix44 view, Matrix44 projection) { return s_context->setView(view, projection); } + +FluidRenderer* CreateFluidRenderer(uint32_t width, uint32_t height) { return s_context->createFluidRenderer(width, height); } + +void DestroyFluidRenderer(FluidRenderer* renderer) { return s_context->destroyFluidRenderer(renderer); } + +FluidRenderBuffers* CreateFluidRenderBuffers(int numParticles, bool enableInterop) { return s_context->createFluidRenderBuffers(numParticles, enableInterop); } + +void UpdateFluidRenderBuffers(FluidRenderBuffers* buffers, Vec4* particles, float* densities, Vec4* anisotropy1, Vec4* anisotropy2, Vec4* anisotropy3, int numParticles, int* indices, int numIndices) +{ + s_context->updateFluidRenderBuffers(buffers, particles, densities, anisotropy1, anisotropy2, anisotropy3, numParticles, indices, numIndices); +} + +void UpdateFluidRenderBuffers(FluidRenderBuffers* buffers, NvFlexSolver* flex, bool anisotropy, bool density) { return s_context->updateFluidRenderBuffers(buffers, flex, anisotropy, density); } + +void DestroyFluidRenderBuffers(FluidRenderBuffers* buffers) { return s_context->destroyFluidRenderBuffers(buffers); } + +ShadowMap* ShadowCreate() { return s_context->shadowCreate(); } + +void ShadowDestroy(ShadowMap* map) { s_context->shadowDestroy(map); } + +void ShadowBegin(ShadowMap* map) { s_context->shadowBegin(map); } + +void ShadowEnd() { s_context->shadowEnd(); } + + +void BindSolidShader(Vec3 lightPos, Vec3 lightTarget, Matrix44 lightTransform, ShadowMap* shadowMap, float bias, Vec4 fogColor) +{ + s_context->bindSolidShader(lightPos, lightTarget, lightTransform, shadowMap, bias, fogColor); +} + +void UnbindSolidShader() { s_context->unbindSolidShader(); } + +void DrawMesh(const Mesh* m, Vec3 color) { s_context->drawMesh(m, color); } + +void DrawCloth(const Vec4* positions, const Vec4* normals, const float* uvs, const int* indices, int numTris, int numPositions, int colorIndex, float expand, bool twosided, bool smooth) +{ + s_context->drawCloth(positions, normals, uvs, indices, numTris, numPositions, colorIndex, expand, twosided, smooth); +} + +void DrawRope(Vec4* positions, int* indices, int numIndices, float radius, int color) +{ + s_context->drawRope(positions, indices, numIndices, radius, color); +} + +void DrawPlane(const Vec4& p, bool color) { s_context->drawPlane(p, color); } + +void DrawPlanes(Vec4* planes, int n, float bias) { s_context->drawPlanes(planes, n, bias); } + +GpuMesh* CreateGpuMesh(const Mesh* m) +{ + return m ? s_context->createGpuMesh(m) : nullptr; +} + +void DestroyGpuMesh(GpuMesh* m) { s_context->destroyGpuMesh(m); } + +void DrawGpuMesh(GpuMesh* m, const Matrix44& xform, const Vec3& color) { s_context->drawGpuMesh(m, xform, color); } + +void DrawGpuMeshInstances(GpuMesh* m, const Matrix44* xforms, int n, const Vec3& color) { s_context->drawGpuMeshInstances(m, xforms, n, color); } + +void DrawPoints(FluidRenderBuffers* buffers, int n, int offset, float radius, float screenWidth, float screenAspect, float fov, Vec3 lightPos, Vec3 lightTarget, Matrix44 lightTransform, ShadowMap* shadowTex, bool showDensity) +{ + s_context->drawPoints(buffers, n, offset, radius, screenWidth, screenAspect, fov, lightPos, lightTarget, lightTransform, shadowTex, showDensity); +} + +void RenderEllipsoids(FluidRenderer* renderer, FluidRenderBuffers* buffers, int n, int offset, float radius, float screenWidth, float screenAspect, float fov, Vec3 lightPos, Vec3 lightTarget, Matrix44 lightTransform, ShadowMap* shadowMap, Vec4 color, float blur, float ior, bool debug) +{ + s_context->renderEllipsoids(renderer, buffers, n, offset, radius, screenWidth, screenAspect, fov, lightPos, lightTarget, lightTransform, shadowMap, color, blur, ior, debug); +} + +DiffuseRenderBuffers* CreateDiffuseRenderBuffers(int numDiffuseParticles, bool& enableInterop) { return s_context->createDiffuseRenderBuffers(numDiffuseParticles, enableInterop); } + +void DestroyDiffuseRenderBuffers(DiffuseRenderBuffers* buffers) { return s_context->destroyDiffuseRenderBuffers(buffers); } + +void UpdateDiffuseRenderBuffers(DiffuseRenderBuffers* buffers, Vec4* diffusePositions, Vec4* diffuseVelocities, int numDiffuseParticles) +{ + s_context->updateDiffuseRenderBuffers(buffers, diffusePositions, diffuseVelocities, numDiffuseParticles); +} + +void UpdateDiffuseRenderBuffers(DiffuseRenderBuffers* buffers, NvFlexSolver* solver) { return s_context->updateDiffuseRenderBuffers(buffers, solver); } + +int GetNumDiffuseRenderParticles(DiffuseRenderBuffers* buffers) { return s_context->getNumDiffuseRenderParticles(buffers); } + +void RenderDiffuse(FluidRenderer* render, DiffuseRenderBuffers* buffers, int n, float radius, float screenWidth, float screenAspect, float fov, Vec4 color, Vec3 lightPos, Vec3 lightTarget, Matrix44 lightTransform, ShadowMap* shadowMap, float motionBlur, float inscatter, float outscatter, bool shadowEnabled, bool front) +{ + s_context->drawDiffuse(render, buffers, n, radius, screenWidth, screenAspect, fov, color, lightPos, lightTarget, lightTransform, shadowMap, motionBlur, inscatter, outscatter, shadowEnabled, front); +} + +void BeginLines() { s_context->beginLines(); } + +void DrawLine(const Vec3& p, const Vec3& q, const Vec4& color) { s_context->drawLine(p, q, color); } + +void EndLines() { s_context->endLines(); } + +void BeginPoints(float size) {} +void DrawPoint(const Vec3& p, const Vec4& color) {} +void EndPoints() {} + +float RendererGetDeviceTimestamps(unsigned long long* begin, unsigned long long* end, unsigned long long* freq) +{ + return s_context->rendererGetDeviceTimestamps(begin, end, freq); +} + +void* GetGraphicsCommandQueue() { return s_context->getGraphicsCommandQueue(); } +void GraphicsTimerBegin() { s_context->graphicsTimerBegin(); } +void GraphicsTimerEnd() { s_context->graphicsTimerEnd(); } + +void StartGpuWork() { s_context->startGpuWork(); } +void EndGpuWork() { s_context->endGpuWork(); } + +void DrawImguiGraph() { return s_context->drawImguiGraph(); } + +void GetRenderDevice(void** deviceOut, void** contextOut) { return s_context->getRenderDevice(deviceOut, contextOut); } + +void InitRender(const RenderInitOptions& options) +{ + if (!s_context) + { + assert(false && "A context has not been set with SetDemoContext!"); + return; + } + if (!s_context->initialize(options)) + { + assert(!"Unable to initialize context!"); + delete s_context; + s_context = nullptr; + return; + } +} + diff --git a/demo/d3d/shadersDemoContext.h b/demo/d3d/shadersDemoContext.h new file mode 100644 index 0000000..030dee6 --- /dev/null +++ b/demo/d3d/shadersDemoContext.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2008-2016, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + +#pragma once + +#include "../shaders.h" + +#include "demoContext.h" + +// This file implements the Shaders.h 'interface' through the DemoContext interface + +void SetDemoContext(DemoContext* context); +DemoContext* GetDemoContext(); + |