aboutsummaryrefslogtreecommitdiff
path: root/demo/d3d11
diff options
context:
space:
mode:
authorMiles Macklin <[email protected]>2017-03-10 14:51:31 +1300
committerMiles Macklin <[email protected]>2017-03-10 14:51:31 +1300
commitad3d90fafe5ee79964bdfe1f1e0704c3ffcdfd5f (patch)
tree4cc6f3288363889d7342f7f8407c0251e6904819 /demo/d3d11
downloadflex-ad3d90fafe5ee79964bdfe1f1e0704c3ffcdfd5f.tar.xz
flex-ad3d90fafe5ee79964bdfe1f1e0704c3ffcdfd5f.zip
Initial 1.1.0 binary release
Diffstat (limited to 'demo/d3d11')
-rw-r--r--demo/d3d11/appD3D11Ctx.cpp761
-rw-r--r--demo/d3d11/appD3D11Ctx.h93
-rw-r--r--demo/d3d11/debugLineRender.h199
-rw-r--r--demo/d3d11/diffuseRender.cpp217
-rw-r--r--demo/d3d11/diffuseRender.h69
-rw-r--r--demo/d3d11/fluidRender.cpp458
-rw-r--r--demo/d3d11/fluidRender.h126
-rw-r--r--demo/d3d11/imguiGraph.cpp472
-rw-r--r--demo/d3d11/imguiGraph.h29
-rw-r--r--demo/d3d11/imguiGraphD3D11.cpp473
-rw-r--r--demo/d3d11/imguiGraphD3D11.h67
-rw-r--r--demo/d3d11/meshRender.cpp221
-rw-r--r--demo/d3d11/meshRender.h297
-rw-r--r--demo/d3d11/pointRender.cpp206
-rw-r--r--demo/d3d11/pointRender.h88
-rw-r--r--demo/d3d11/renderTarget.cpp146
-rw-r--r--demo/d3d11/renderTarget.h51
-rw-r--r--demo/d3d11/shaders/blurDepthPS.hlsl91
-rw-r--r--demo/d3d11/shaders/blurDepthPS.hlsl.h664
-rw-r--r--demo/d3d11/shaders/compositePS.hlsl194
-rw-r--r--demo/d3d11/shaders/compositePS.hlsl.h1643
-rw-r--r--demo/d3d11/shaders/debugLinePS.hlsl10
-rw-r--r--demo/d3d11/shaders/debugLinePS.hlsl.h121
-rw-r--r--demo/d3d11/shaders/debugLineVS.hlsl26
-rw-r--r--demo/d3d11/shaders/debugLineVS.hlsl.h213
-rw-r--r--demo/d3d11/shaders/diffuseGS.hlsl176
-rw-r--r--demo/d3d11/shaders/diffuseGS.hlsl.h973
-rw-r--r--demo/d3d11/shaders/diffusePS.hlsl37
-rw-r--r--demo/d3d11/shaders/diffusePS.hlsl.h216
-rw-r--r--demo/d3d11/shaders/diffuseVS.hlsl26
-rw-r--r--demo/d3d11/shaders/diffuseVS.hlsl.h425
-rw-r--r--demo/d3d11/shaders/ellipsoidDepthGS.hlsl127
-rw-r--r--demo/d3d11/shaders/ellipsoidDepthGS.hlsl.h414
-rw-r--r--demo/d3d11/shaders/ellipsoidDepthPS.hlsl108
-rw-r--r--demo/d3d11/shaders/ellipsoidDepthPS.hlsl.h662
-rw-r--r--demo/d3d11/shaders/ellipsoidDepthVS.hlsl195
-rw-r--r--demo/d3d11/shaders/ellipsoidDepthVS.hlsl.h940
-rw-r--r--demo/d3d11/shaders/imguiPS.hlsl22
-rw-r--r--demo/d3d11/shaders/imguiPS.hlsl.h197
-rw-r--r--demo/d3d11/shaders/imguiVS.hlsl31
-rw-r--r--demo/d3d11/shaders/imguiVS.hlsl.h248
-rw-r--r--demo/d3d11/shaders/meshPS.hlsl130
-rw-r--r--demo/d3d11/shaders/meshPS.hlsl.h1553
-rw-r--r--demo/d3d11/shaders/meshShadowPS.hlsl11
-rw-r--r--demo/d3d11/shaders/meshShadowPS.hlsl.h156
-rw-r--r--demo/d3d11/shaders/meshVS.hlsl91
-rw-r--r--demo/d3d11/shaders/meshVS.hlsl.h635
-rw-r--r--demo/d3d11/shaders/passThroughVS.hlsl26
-rw-r--r--demo/d3d11/shaders/passThroughVS.hlsl.h145
-rw-r--r--demo/d3d11/shaders/pointGS.hlsl84
-rw-r--r--demo/d3d11/shaders/pointGS.hlsl.h740
-rw-r--r--demo/d3d11/shaders/pointPS.hlsl103
-rw-r--r--demo/d3d11/shaders/pointPS.hlsl.h947
-rw-r--r--demo/d3d11/shaders/pointVS.hlsl26
-rw-r--r--demo/d3d11/shaders/pointVS.hlsl.h374
-rw-r--r--demo/d3d11/shaders/shaderCommon.h237
-rw-r--r--demo/d3d11/shadersD3D11.cpp1041
-rw-r--r--demo/d3d11/shadowMap.cpp162
-rw-r--r--demo/d3d11/shadowMap.h51
59 files changed, 18244 insertions, 0 deletions
diff --git a/demo/d3d11/appD3D11Ctx.cpp b/demo/d3d11/appD3D11Ctx.cpp
new file mode 100644
index 0000000..85129e5
--- /dev/null
+++ b/demo/d3d11/appD3D11Ctx.cpp
@@ -0,0 +1,761 @@
+/*
+ * 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.
+ */
+
+//direct3d headers
+#include <d3d11.h>
+#include <dxgi.h>
+
+// include the Direct3D Library file
+#pragma comment (lib, "d3d11.lib")
+#pragma comment (lib, "DXGI.lib")
+
+#include "appD3D11Ctx.h"
+
+#include <stdio.h>
+#include <math.h>
+
+#include <SDL.h>
+#include <SDL_video.h>
+#include <SDL_syswm.h>
+
+AppGraphProfiler* appGraphCreateProfiler(AppGraphCtx* ctx);
+void appGraphProfilerFrameBegin(AppGraphProfiler* profiler);
+void appGraphProfilerFrameEnd(AppGraphProfiler* profiler);
+void appGraphProfilerEnable(AppGraphProfiler* profiler, bool enabled);
+void appGraphProfilerBegin(AppGraphProfiler* profiler, const char* label);
+void appGraphProfilerEnd(AppGraphProfiler* profiler, const char* label);
+bool appGraphProfilerGet(AppGraphProfiler* profiler, const char** plabel, float* cpuTime, float* gpuTime, int index);
+void appGraphReleaseProfiler(AppGraphProfiler* profiler);
+
+AppGraphCtx::AppGraphCtx()
+{
+ m_profiler = appGraphCreateProfiler(this);
+ memset(&m_viewport, 0, sizeof(m_viewport));
+}
+
+AppGraphCtx::~AppGraphCtx()
+{
+ AppGraphCtxReleaseRenderTarget(this);
+
+ COMRelease(m_swapChain);
+ COMRelease(m_backBuffer);
+ COMRelease(m_rtv);
+ COMRelease(m_depthStencil);
+ COMRelease(m_dsv);
+ COMRelease(m_depthSRV);
+ COMRelease(m_depthState);
+ COMRelease(m_blendState);
+ COMRelease(m_resolvedTarget);
+ COMRelease(m_resolvedTargetSRV);
+ COMRelease(m_deviceContext);
+ COMRelease(m_device);
+
+ appGraphReleaseProfiler(m_profiler);
+ m_profiler = nullptr;
+}
+
+AppGraphCtx* AppGraphCtxCreate(int deviceID)
+{
+ AppGraphCtx* context = new AppGraphCtx;
+
+ HRESULT hr = S_OK;
+
+ // enumerate devices
+ IDXGIFactory1* pFactory = NULL;
+ CreateDXGIFactory1(IID_PPV_ARGS(&pFactory));
+ IDXGIAdapter1* pAdapterTemp = NULL;
+ IDXGIAdapter1* pAdapter = NULL;
+ DXGI_ADAPTER_DESC1 adapterDesc;
+ int adapterIdx = 0;
+ while (S_OK == pFactory->EnumAdapters1(adapterIdx, &pAdapterTemp))
+ {
+ pAdapterTemp->GetDesc1(&adapterDesc);
+
+ context->m_dedicatedVideoMemory = (size_t)adapterDesc.DedicatedVideoMemory;
+
+ if (deviceID == adapterIdx)
+ {
+ pAdapter = pAdapterTemp;
+ break;
+ }
+ else
+ {
+ pAdapterTemp->Release();
+ }
+ adapterIdx++;
+ }
+
+ D3D_DRIVER_TYPE driverTypes[] =
+ {
+ D3D_DRIVER_TYPE_UNKNOWN,
+ D3D_DRIVER_TYPE_HARDWARE,
+ D3D_DRIVER_TYPE_WARP,
+ D3D_DRIVER_TYPE_REFERENCE,
+ };
+ UINT numDriverTypes = 4;
+
+ D3D_FEATURE_LEVEL featureLevels[] =
+ {
+ D3D_FEATURE_LEVEL_11_1,
+ D3D_FEATURE_LEVEL_11_0,
+ D3D_FEATURE_LEVEL_10_1,
+ D3D_FEATURE_LEVEL_10_0,
+ };
+ UINT numFeatureLevels = 4;
+
+ UINT createDeviceFlags = 0;
+#ifdef _DEBUG
+ createDeviceFlags |= D3D11_CREATE_DEVICE_DEBUG;
+#endif
+
+ for (UINT driverTypeIndex = 0; driverTypeIndex < numDriverTypes; driverTypeIndex++)
+ {
+ D3D_FEATURE_LEVEL featureLevel;
+ D3D_DRIVER_TYPE driverType = driverTypes[driverTypeIndex];
+ hr = D3D11CreateDevice(pAdapter, driverType, nullptr, createDeviceFlags, featureLevels, numFeatureLevels,
+ D3D11_SDK_VERSION, &context->m_device, &featureLevel, &context->m_deviceContext);
+ if (SUCCEEDED(hr))
+ {
+ break;
+ }
+ }
+ if (FAILED(hr))
+ {
+ delete context;
+ return nullptr;
+ }
+
+ // cleanup adapter and factory
+ COMRelease(pAdapter);
+ COMRelease(pFactory);
+
+ // create depth state
+ D3D11_DEPTH_STENCIL_DESC depthStateDesc = {};
+ depthStateDesc.DepthEnable = TRUE;
+ depthStateDesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL;
+ depthStateDesc.DepthFunc = D3D11_COMPARISON_LESS_EQUAL;
+
+ if (hr = context->m_device->CreateDepthStencilState(&depthStateDesc, &context->m_depthState))
+ {
+ delete context;
+ return nullptr;
+ }
+
+ // create blend state
+ D3D11_BLEND_DESC blendStateDesc = {};
+ blendStateDesc.RenderTarget[0].BlendEnable = TRUE;
+ blendStateDesc.RenderTarget[0].SrcBlend = D3D11_BLEND_SRC_ALPHA;
+ blendStateDesc.RenderTarget[0].DestBlend = D3D11_BLEND_INV_SRC_ALPHA;
+ blendStateDesc.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD;
+ blendStateDesc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ONE;
+ blendStateDesc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_ZERO;
+ blendStateDesc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD;
+ blendStateDesc.RenderTarget[0].RenderTargetWriteMask = 0x0f;
+
+ if (hr = context->m_device->CreateBlendState(&blendStateDesc, &context->m_blendState))
+ {
+ delete context;
+ return nullptr;
+ }
+
+ return context;
+}
+
+void AppGraphCtxInitRenderTarget(AppGraphCtx* context, SDL_Window* window, bool fullscreen, int samples)
+{
+ // TODO: fix iflip fullscreen support
+ fullscreen = false;
+
+ HWND hWnd = nullptr;
+ // get Windows handle to this SDL window
+ SDL_SysWMinfo winInfo;
+ SDL_VERSION(&winInfo.version);
+ if (SDL_GetWindowWMInfo(window, &winInfo))
+ {
+ if (winInfo.subsystem == SDL_SYSWM_WINDOWS)
+ {
+ hWnd = winInfo.info.win.window;
+ }
+ }
+ context->m_hWnd = hWnd;
+ context->m_fullscreen = fullscreen;
+
+ HRESULT hr = S_OK;
+
+ RECT rc;
+ GetClientRect(context->m_hWnd, &rc);
+ UINT width = rc.right - rc.left;
+ UINT height = rc.bottom - rc.top;
+
+ context->m_winW = width;
+ context->m_winH = height;
+
+ // enumerate devices
+ IDXGIFactory1* pFactory = NULL;
+ CreateDXGIFactory1(IID_PPV_ARGS(&pFactory));
+
+ // create the swap chain
+ for (int i = 0; i < 2; i++)
+ {
+ DXGI_SWAP_CHAIN_DESC desc;
+ ZeroMemory(&desc, sizeof(desc));
+ desc.BufferCount = 1;
+ desc.BufferDesc.Width = context->m_winW;
+ desc.BufferDesc.Height = context->m_winH;
+ desc.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
+ desc.BufferDesc.RefreshRate.Numerator = 0;
+ desc.BufferDesc.RefreshRate.Denominator = 0;
+ desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
+ desc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD; // DXGI_SWAP_EFFECT_FLIP_DISCARD;
+ desc.OutputWindow = context->m_hWnd;
+ desc.SampleDesc.Count = samples;
+ desc.SampleDesc.Quality = 0;
+ desc.Windowed = TRUE; // m_fullscreen ? FALSE : TRUE;
+ desc.Flags = 0u;
+
+ if (hr = pFactory->CreateSwapChain(context->m_device, &desc, (IDXGISwapChain**)&context->m_swapChain))
+ {
+ COMRelease(context->m_swapChain);
+ context->m_fullscreen = false;
+ continue;
+ }
+
+ if (!context->m_fullscreen)
+ {
+
+ }
+ else
+ {
+ hr = context->m_swapChain->SetFullscreenState(true, nullptr);
+ if (hr != S_OK)
+ {
+ COMRelease(context->m_swapChain);
+ context->m_fullscreen = false;
+ continue;
+ }
+ DXGI_SWAP_CHAIN_DESC desc = {};
+ context->m_swapChain->GetDesc(&desc);
+ context->m_swapChain->ResizeBuffers(1, context->m_winW, context->m_winH, desc.BufferDesc.Format, desc.Flags);
+ }
+ break;
+ }
+
+ // configure scissor and viewport
+ {
+ context->m_viewport.Width = float(context->m_winW);
+ context->m_viewport.Height = float(context->m_winH);
+ context->m_viewport.MaxDepth = 1.f;
+ }
+
+ COMRelease(pFactory);
+
+ // Create a render target view
+ context->m_backBuffer = NULL;
+ hr = context->m_swapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), (LPVOID*)&context->m_backBuffer);
+ if (FAILED(hr))
+ {
+ return;
+ }
+
+ hr = context->m_device->CreateRenderTargetView(context->m_backBuffer, NULL, &context->m_rtv);
+ if (FAILED(hr))
+ {
+ return;
+ }
+
+ context->m_deviceContext->OMSetRenderTargets(1, &context->m_rtv, NULL);
+
+ // viewport
+ context->m_deviceContext->RSSetViewports(1, &context->m_viewport);
+
+ {
+ D3D11_TEXTURE2D_DESC texDesc = {};
+ texDesc.Width = width;
+ texDesc.Height = height;
+ texDesc.MipLevels = 1;
+ texDesc.ArraySize = 1;
+ texDesc.Format = DXGI_FORMAT_R32_TYPELESS; // DXGI_FORMAT_R24G8_TYPELESS
+ texDesc.SampleDesc.Count = samples;
+ texDesc.SampleDesc.Quality = 0u;
+ texDesc.Usage = D3D11_USAGE_DEFAULT;
+ texDesc.BindFlags = D3D11_BIND_DEPTH_STENCIL | D3D11_BIND_SHADER_RESOURCE;
+ texDesc.CPUAccessFlags = 0;
+ texDesc.MiscFlags = 0;
+
+ if (hr = context->m_device->CreateTexture2D(&texDesc, nullptr, &context->m_depthStencil))
+ {
+ return;
+ }
+
+ D3D11_DEPTH_STENCIL_VIEW_DESC viewDesc = {};
+ viewDesc.Format = DXGI_FORMAT_D32_FLOAT;
+ viewDesc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2DMS;
+ viewDesc.Flags = 0u;
+ viewDesc.Texture2D.MipSlice = 0;
+
+ if (hr = context->m_device->CreateDepthStencilView(context->m_depthStencil, &viewDesc, &context->m_dsv))
+ {
+ return;
+ }
+
+ D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc = {};
+ srvDesc.Format = DXGI_FORMAT_R32_FLOAT;
+ srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2DMS;
+ srvDesc.Texture2D.MipLevels = 1;
+ srvDesc.Texture2D.MostDetailedMip = 0;
+
+ if (hr = context->m_device->CreateShaderResourceView(context->m_depthStencil, &srvDesc, &context->m_depthSRV))
+ {
+ return;
+ }
+ }
+
+ // resolved texture target (for refraction / scene sampling)
+ {
+ D3D11_TEXTURE2D_DESC texDesc = {};
+ texDesc.Width = width;
+ texDesc.Height = height;
+ texDesc.MipLevels = 1;
+ texDesc.ArraySize = 1;
+ texDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
+ texDesc.SampleDesc.Count = 1;
+ texDesc.SampleDesc.Quality = 0u;
+ texDesc.Usage = D3D11_USAGE_DEFAULT;
+ texDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
+ texDesc.CPUAccessFlags = 0;
+ texDesc.MiscFlags = 0;
+
+ if (hr = context->m_device->CreateTexture2D(&texDesc, nullptr, &context->m_resolvedTarget))
+ {
+ return;
+ }
+
+ D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc = {};
+ srvDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
+ srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
+ srvDesc.Texture2D.MipLevels = 1;
+ srvDesc.Texture2D.MostDetailedMip = 0;
+
+ if (hr = context->m_device->CreateShaderResourceView(context->m_resolvedTarget, &srvDesc, &context->m_resolvedTargetSRV))
+ {
+ return;
+ }
+ }
+}
+
+void AppGraphCtxReleaseRenderTarget(AppGraphCtx* context)
+{
+ if (context->m_swapChain == nullptr)
+ {
+ return;
+ }
+
+ BOOL bFullscreen = FALSE;
+ context->m_swapChain->GetFullscreenState(&bFullscreen, nullptr);
+ if (bFullscreen == TRUE) context->m_swapChain->SetFullscreenState(FALSE, nullptr);
+
+ COMRelease(context->m_swapChain);
+ COMRelease(context->m_backBuffer);
+ COMRelease(context->m_rtv);
+ COMRelease(context->m_depthStencil);
+ COMRelease(context->m_dsv);
+ COMRelease(context->m_depthSRV);
+ COMRelease(context->m_resolvedTarget);
+ COMRelease(context->m_resolvedTargetSRV);
+}
+
+void AppGraphCtxRelease(AppGraphCtx* context)
+{
+ if (context == nullptr) return;
+
+ delete context;
+}
+
+void AppGraphCtxResolveFrame(AppGraphCtx* context)
+{
+ context->m_deviceContext->ResolveSubresource(context->m_resolvedTarget, 0, context->m_backBuffer, 0, DXGI_FORMAT_R8G8B8A8_UNORM);
+}
+
+void AppGraphCtxFrameStart(AppGraphCtx* context, float clearColor[4])
+{
+ appGraphProfilerFrameBegin(context->m_profiler);
+
+ context->m_deviceContext->RSSetViewports(1, &context->m_viewport);
+ context->m_deviceContext->RSSetScissorRects(0, nullptr);
+
+ context->m_deviceContext->OMSetRenderTargets(1, &context->m_rtv, context->m_dsv);
+
+ context->m_deviceContext->ClearRenderTargetView(context->m_rtv, clearColor);
+ context->m_deviceContext->ClearDepthStencilView(context->m_dsv, D3D11_CLEAR_DEPTH, 1.f, 0u);
+
+ context->m_deviceContext->OMSetDepthStencilState(context->m_depthState, 0u);
+}
+
+void AppGraphCtxFramePresent(AppGraphCtx* context, bool fullsync)
+{
+ context->m_swapChain->Present(fullsync, 0);
+
+ appGraphProfilerFrameEnd(context->m_profiler);
+}
+
+void AppGraphCtxProfileEnable(AppGraphCtx* context, bool enabled)
+{
+ appGraphProfilerEnable(context->m_profiler, enabled);
+}
+
+void AppGraphCtxProfileBegin(AppGraphCtx* context, const char* label)
+{
+ appGraphProfilerBegin(context->m_profiler, label);
+}
+
+void AppGraphCtxProfileEnd(AppGraphCtx* context, const char* label)
+{
+ appGraphProfilerEnd(context->m_profiler, label);
+}
+
+bool AppGraphCtxProfileGet(AppGraphCtx* context, const char** plabel, float* cpuTime, float* gpuTime, int index)
+{
+ return appGraphProfilerGet(context->m_profiler, plabel, cpuTime, gpuTime, index);
+}
+
+// ******************************* Profiler *********************************
+
+namespace
+{
+ struct TimerCPU
+ {
+ LARGE_INTEGER oldCount;
+ LARGE_INTEGER count;
+ LARGE_INTEGER freq;
+ TimerCPU()
+ {
+ QueryPerformanceCounter(&count);
+ QueryPerformanceFrequency(&freq);
+ oldCount = count;
+ }
+ double getDeltaTime()
+ {
+ QueryPerformanceCounter(&count);
+ double dt = double(count.QuadPart - oldCount.QuadPart) / double(freq.QuadPart);
+ oldCount = count;
+ return dt;
+ }
+ };
+
+ struct TimerGPU
+ {
+ ID3D11Query* m_begin = nullptr;
+ ID3D11Query* m_end = nullptr;
+
+ TimerGPU() {}
+ ~TimerGPU()
+ {
+ COMRelease(m_begin);
+ COMRelease(m_end);
+ }
+ };
+
+ struct Timer
+ {
+ TimerCPU m_cpu;
+ TimerGPU m_gpu;
+
+ const char* m_label = nullptr;
+ float m_cpuTime = 0.f;
+ float m_gpuTime = 0.f;
+
+ Timer() {}
+ ~Timer() {}
+ };
+
+ struct TimerValue
+ {
+ const char* m_label = nullptr;
+ float m_cpuTime = 0.f;
+ float m_gpuTime = 0.f;
+
+ struct Stat
+ {
+ float m_time = 0.f;
+ float m_maxTime = 0.f;
+ float m_maxTimeAge = 0.f;
+
+ float m_smoothTime = 0.f;
+ float m_smoothTimeSum = 0.f;
+ float m_smoothTimeCount = 0.f;
+
+ Stat() {}
+ void push(float time)
+ {
+ m_time = time;
+
+ if (m_time > m_maxTime)
+ {
+ m_maxTime = m_time;
+ m_maxTimeAge = 0.f;
+ }
+
+ if (fabsf(m_time - m_maxTime) < 0.25f * m_maxTime)
+ {
+ m_smoothTimeSum += m_time;
+ m_smoothTimeCount += 1.f;
+ m_smoothTimeSum *= 0.98f;
+ m_smoothTimeCount *= 0.98f;
+ m_smoothTime = m_smoothTimeSum / m_smoothTimeCount;
+ }
+ }
+
+ float pull(float frameTime)
+ {
+ m_maxTimeAge += frameTime;
+
+ if (m_maxTimeAge > 1.f)
+ {
+ m_maxTimeAge = 0.f;
+ m_maxTime = m_time;
+ m_smoothTimeSum = 0.f;
+ m_smoothTimeCount = 0.f;
+ }
+ return m_smoothTime;
+ }
+ };
+
+ Stat m_cpu;
+ Stat m_gpu;
+
+ void push(float cpuTime, float gpuTime)
+ {
+ m_cpu.push(cpuTime);
+ m_gpu.push(gpuTime);
+ }
+
+ void pull(float frameTime)
+ {
+ m_cpuTime = m_cpu.pull(frameTime);
+ m_gpuTime = m_gpu.pull(frameTime);
+ }
+ };
+}
+
+struct AppGraphProfiler
+{
+ AppGraphCtx* m_context;
+
+ int m_state = 0;
+ bool m_enabled = false;
+
+ TimerCPU m_frameTimer;
+ float m_frameTime = 0.f;
+
+ ID3D11Query* m_disjoint = nullptr;
+
+ static const int m_timersCap = 64;
+ Timer m_timers[m_timersCap];
+ int m_timersSize = 0;
+
+ TimerValue m_timerValues[m_timersCap];
+ int m_timerValuesSize = 0;
+
+ AppGraphProfiler(AppGraphCtx* context);
+ ~AppGraphProfiler();
+};
+
+AppGraphProfiler::AppGraphProfiler(AppGraphCtx* context) : m_context(context)
+{
+}
+
+AppGraphProfiler::~AppGraphProfiler()
+{
+ COMRelease(m_disjoint);
+}
+
+AppGraphProfiler* appGraphCreateProfiler(AppGraphCtx* ctx)
+{
+ return new AppGraphProfiler(ctx);
+}
+
+void appGraphReleaseProfiler(AppGraphProfiler* profiler)
+{
+ delete profiler;
+}
+
+void appGraphProfilerFrameBegin(AppGraphProfiler* p)
+{
+ p->m_frameTime = (float)p->m_frameTimer.getDeltaTime();
+
+ if (p->m_state == 0 && p->m_enabled)
+ {
+ auto device = p->m_context->m_device;
+ auto deviceContext = p->m_context->m_deviceContext;
+
+ if (p->m_disjoint == nullptr)
+ {
+ D3D11_QUERY_DESC queryDesc;
+ queryDesc.Query = D3D11_QUERY_TIMESTAMP_DISJOINT;
+ queryDesc.MiscFlags = 0u;
+ device->CreateQuery(&queryDesc, &p->m_disjoint);
+ }
+
+ deviceContext->Begin(p->m_disjoint);
+
+ p->m_timersSize = 0;
+
+ p->m_state = 1;
+ }
+}
+
+void appGraphProfilerFrameEnd(AppGraphProfiler* p)
+{
+ if (p->m_state == 1)
+ {
+ auto deviceContext = p->m_context->m_deviceContext;
+
+ deviceContext->End(p->m_disjoint);
+
+ p->m_state = 2;
+ }
+}
+
+void appGraphProfilerEnable(AppGraphProfiler* p, bool enabled)
+{
+ p->m_enabled = enabled;
+}
+
+void appGraphProfilerBegin(AppGraphProfiler* p, const char* label)
+{
+ if (p->m_state == 1 && p->m_timersSize < p->m_timersCap)
+ {
+ auto& timer = p->m_timers[p->m_timersSize++];
+ timer.m_label = label;
+ timer.m_cpu.getDeltaTime();
+
+ auto device = p->m_context->m_device;
+ auto deviceContext = p->m_context->m_deviceContext;
+
+ if (timer.m_gpu.m_begin == nullptr)
+ {
+ D3D11_QUERY_DESC queryDesc;
+ queryDesc.MiscFlags = 0u;
+ queryDesc.Query = D3D11_QUERY_TIMESTAMP;
+ device->CreateQuery(&queryDesc, &timer.m_gpu.m_begin);
+ device->CreateQuery(&queryDesc, &timer.m_gpu.m_end);
+ }
+
+ deviceContext->End(timer.m_gpu.m_begin);
+ }
+}
+
+void appGraphProfilerEnd(AppGraphProfiler* p, const char* label)
+{
+ if (p->m_state == 1)
+ {
+ Timer* timer = nullptr;
+ for (int i = 0; i < p->m_timersSize; i++)
+ {
+ if (strcmp(p->m_timers[i].m_label, label) == 0)
+ {
+ timer = &p->m_timers[i];
+ break;
+ }
+ }
+ if (timer)
+ {
+ auto deviceContext = p->m_context->m_deviceContext;
+
+ deviceContext->End(timer->m_gpu.m_end);
+
+ timer->m_cpuTime = (float)timer->m_cpu.getDeltaTime();
+ }
+ }
+}
+
+bool appGraphProfilerFlush(AppGraphProfiler* p)
+{
+ if (p->m_state == 2)
+ {
+ auto deviceContext = p->m_context->m_deviceContext;
+
+ // check disjoint for completion
+ if (deviceContext->GetData(p->m_disjoint, nullptr, 0u, 0u) != S_OK)
+ {
+ return false;
+ }
+
+ D3D11_QUERY_DATA_TIMESTAMP_DISJOINT tsDisjoint;
+ deviceContext->GetData(p->m_disjoint, &tsDisjoint, sizeof(tsDisjoint), 0u);
+ if (tsDisjoint.Disjoint)
+ {
+ return false;
+ }
+
+ for (int i = 0; i < p->m_timersSize; i++)
+ {
+ Timer& timer = p->m_timers[i];
+
+ UINT64 tsBegin, tsEnd;
+ if (deviceContext->GetData(timer.m_gpu.m_begin, &tsBegin, sizeof(UINT64), 0) != S_OK)
+ {
+ return false;
+ }
+ if (deviceContext->GetData(timer.m_gpu.m_end, &tsEnd, sizeof(UINT64), 0) != S_OK)
+ {
+ return false;
+ }
+
+ timer.m_gpuTime = float(tsEnd - tsBegin) / float(tsDisjoint.Frequency);
+
+ // update TimerValue
+ int j = 0;
+ for (; j < p->m_timerValuesSize; j++)
+ {
+ TimerValue& value = p->m_timerValues[j];
+ if (strcmp(value.m_label, timer.m_label) == 0)
+ {
+ value.push(timer.m_cpuTime, timer.m_gpuTime);
+ break;
+ }
+ }
+ if (j >= p->m_timerValuesSize && p->m_timerValuesSize < p->m_timersCap)
+ {
+ TimerValue& value = p->m_timerValues[p->m_timerValuesSize++];
+ value.m_label = timer.m_label;
+ value.push(timer.m_cpuTime, timer.m_gpuTime);
+ }
+ }
+
+ p->m_state = 0;
+ }
+ return false;
+}
+
+bool appGraphProfilerGet(AppGraphProfiler* p, const char** plabel, float* cpuTime, float* gpuTime, int index)
+{
+ appGraphProfilerFlush(p);
+ {
+ if (index < p->m_timerValuesSize)
+ {
+ TimerValue& timer = p->m_timerValues[index];
+
+ timer.pull(p->m_frameTime);
+
+ if (plabel) *plabel = timer.m_label;
+ if (cpuTime) *cpuTime = timer.m_cpuTime;
+ if (gpuTime) *gpuTime = timer.m_gpuTime;
+
+ return true;
+ }
+ }
+ return false;
+}
+
+size_t AppGraphCtxDedicatedVideoMemory(AppGraphCtx* context)
+{
+ return context->m_dedicatedVideoMemory;
+}
diff --git a/demo/d3d11/appD3D11Ctx.h b/demo/d3d11/appD3D11Ctx.h
new file mode 100644
index 0000000..071952e
--- /dev/null
+++ b/demo/d3d11/appD3D11Ctx.h
@@ -0,0 +1,93 @@
+/*
+ * 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
+
+#include <windows.h>
+#include <d3d11.h>
+
+
+template <class T>
+void inline COMRelease(T& t)
+{
+ if (t) t->Release();
+ t = nullptr;
+}
+
+template <class T>
+void inline COMRelease(T& t, UINT arraySize)
+{
+ for (UINT i = 0; i < arraySize; i++)
+ {
+ if (t[i]) t[i]->Release();
+ t[i] = nullptr;
+ }
+}
+
+
+
+struct SDL_Window;
+struct AppGraphProfiler;
+
+struct AppGraphCtx
+{
+ HWND m_hWnd = nullptr;
+
+ int m_winW = 0;
+ int m_winH = 0;
+ bool m_fullscreen = false;
+
+ size_t m_dedicatedVideoMemory = 0u;
+
+ // D3D11 objects
+ D3D11_VIEWPORT m_viewport;
+ ID3D11Device* m_device = nullptr;
+ ID3D11DeviceContext* m_deviceContext = nullptr;
+ IDXGISwapChain* m_swapChain = nullptr;
+ ID3D11Texture2D* m_backBuffer = nullptr;
+ ID3D11RenderTargetView* m_rtv = nullptr;
+ ID3D11Texture2D* m_depthStencil = nullptr;
+ ID3D11DepthStencilView* m_dsv = nullptr;
+ ID3D11ShaderResourceView* m_depthSRV = nullptr;
+ ID3D11DepthStencilState* m_depthState = nullptr;
+ ID3D11BlendState* m_blendState = nullptr;
+
+ ID3D11Texture2D* m_resolvedTarget = nullptr;
+ ID3D11ShaderResourceView* m_resolvedTargetSRV = nullptr;
+
+ AppGraphProfiler* m_profiler = nullptr;
+
+ AppGraphCtx();
+ ~AppGraphCtx();
+};
+
+AppGraphCtx* AppGraphCtxCreate(int deviceID);
+
+void AppGraphCtxInitRenderTarget(AppGraphCtx* context, SDL_Window* window, bool fullscreen, int);
+
+void AppGraphCtxReleaseRenderTarget(AppGraphCtx* context);
+
+void AppGraphCtxRelease(AppGraphCtx* context);
+
+void AppGraphCtxFrameStart(AppGraphCtx* context, float clearColor[4]);
+
+void AppGraphCtxFramePresent(AppGraphCtx* context, bool fullsync);
+
+void AppGraphCtxResolveFrame(AppGraphCtx* context);
+
+void AppGraphCtxProfileEnable(AppGraphCtx* context, bool enabled);
+
+void AppGraphCtxProfileBegin(AppGraphCtx* context, const char* label);
+
+void AppGraphCtxProfileEnd(AppGraphCtx* context, const char* label);
+
+bool AppGraphCtxProfileGet(AppGraphCtx* context, const char** plabel, float* cpuTime, float* gpuTime, int index);
+
+size_t AppGraphCtxDedicatedVideoMemory(AppGraphCtx* context); \ No newline at end of file
diff --git a/demo/d3d11/debugLineRender.h b/demo/d3d11/debugLineRender.h
new file mode 100644
index 0000000..6132935
--- /dev/null
+++ b/demo/d3d11/debugLineRender.h
@@ -0,0 +1,199 @@
+#pragma once
+
+
+#include "shaders/debugLineVS.hlsl.h"
+#include "shaders/debugLinePS.hlsl.h"
+
+
+struct DebugVertex
+{
+ Vec3 position;
+ Vec4 color;
+};
+
+struct DebugLineRender
+{
+
+ void Init(ID3D11Device* d, ID3D11DeviceContext* c)
+ {
+ device = d;
+ context = c;
+
+ // create the rasterizer state
+ {
+ D3D11_RASTERIZER_DESC desc = {};
+ desc.FillMode = D3D11_FILL_SOLID;
+ desc.CullMode = D3D11_CULL_BACK;
+ desc.FrontCounterClockwise = TRUE; // This is non-default
+ desc.DepthBias = 0;
+ desc.DepthBiasClamp = 0.f;
+ desc.SlopeScaledDepthBias = 0.f;
+ desc.DepthClipEnable = TRUE;
+ desc.ScissorEnable = FALSE; // This is non-default
+ desc.MultisampleEnable = TRUE;
+ desc.AntialiasedLineEnable = FALSE;
+
+ device->CreateRasterizerState(&desc, &rasterizerState);
+ }
+
+ {
+ D3D11_DEPTH_STENCIL_DESC depthStateDesc = {};
+ depthStateDesc.DepthEnable = FALSE; // disable depth test
+ depthStateDesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL;
+ depthStateDesc.DepthFunc = D3D11_COMPARISON_LESS_EQUAL;
+
+ device->CreateDepthStencilState(&depthStateDesc, &depthStencilState);
+ }
+
+ // create the input layout
+ {
+ D3D11_INPUT_ELEMENT_DESC inputElementDescs[] =
+ {
+ { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ { "COLOR", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ };
+
+ device->CreateInputLayout(inputElementDescs, 2, g_debugLineVS, sizeof(g_debugLineVS), &inputLayout);
+ }
+
+ // create the blend state
+ {
+ D3D11_BLEND_DESC blendDesc = {};
+
+ blendDesc.AlphaToCoverageEnable = false;
+ blendDesc.IndependentBlendEnable = false;
+ blendDesc.RenderTarget[0].BlendEnable = false;
+ blendDesc.RenderTarget[0].SrcBlend = D3D11_BLEND_SRC_ALPHA;
+ blendDesc.RenderTarget[0].DestBlend = D3D11_BLEND_INV_SRC_ALPHA;
+ blendDesc.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD;
+ blendDesc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_SRC_ALPHA;
+ blendDesc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_INV_SRC_ALPHA;
+ blendDesc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD;
+ blendDesc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;
+
+ device->CreateBlendState(&blendDesc, &blendState);
+ }
+
+ // create the shaders
+ device->CreateVertexShader(g_debugLineVS, sizeof(g_debugLineVS), nullptr, &vertexShader);
+ device->CreatePixelShader(g_debugLinePS, sizeof(g_debugLinePS), nullptr, &pixelShader);
+
+ // create a constant buffer
+ {
+ D3D11_BUFFER_DESC bufDesc;
+ bufDesc.ByteWidth = sizeof(Matrix44);
+ bufDesc.Usage = D3D11_USAGE_DYNAMIC;
+ bufDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
+ bufDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
+ bufDesc.MiscFlags = 0;
+
+ device->CreateBuffer(&bufDesc, NULL, &constantBuffer);
+ }
+ }
+
+ void Destroy()
+ {
+ COMRelease(depthStencilState);
+ COMRelease(rasterizerState);
+ COMRelease(inputLayout);
+ COMRelease(blendState);
+ COMRelease(vertexShader);
+ COMRelease(pixelShader);
+ COMRelease(constantBuffer);
+ COMRelease(vertexBuffer);
+ }
+
+ void AddLine(const Vec3& p, const Vec3& q, const Vec4& color)
+ {
+ DebugVertex v = { p, color };
+ DebugVertex w = { q, color };
+
+ queued.push_back(v);
+ queued.push_back(w);
+ }
+
+ void FlushLines(const Matrix44& viewProj)
+ {
+ if (queued.empty())
+ return;
+
+ // recreate vertex buffer if not big enough for queued lines
+ if (vertexBufferSize < int(queued.size()))
+ {
+ if (vertexBuffer)
+ vertexBuffer->Release();
+
+ D3D11_BUFFER_DESC bufferDesc;
+ bufferDesc.Usage = D3D11_USAGE_DYNAMIC;
+ bufferDesc.ByteWidth = UINT(sizeof(DebugVertex)*queued.size());
+ bufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
+ bufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
+ bufferDesc.MiscFlags = 0;
+
+ device->CreateBuffer(&bufferDesc, 0, &vertexBuffer);
+
+ vertexBufferSize = int(queued.size());
+ }
+
+ // update vertex buffer
+ D3D11_MAPPED_SUBRESOURCE res;
+ context->Map(vertexBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &res);
+ memcpy(res.pData, &queued[0], sizeof(DebugVertex)*queued.size());
+ context->Unmap(vertexBuffer, 0);
+
+ // update constant buffer
+ {
+ D3D11_MAPPED_SUBRESOURCE mappedResource = {};
+ if (S_OK == context->Map(constantBuffer, 0u, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource))
+ {
+ memcpy(mappedResource.pData, &viewProj, sizeof(viewProj));
+
+ context->Unmap(constantBuffer, 0u);
+ }
+ }
+
+ // configure for line renderering
+ context->VSSetShader(vertexShader, nullptr, 0u);
+ context->GSSetShader(nullptr, nullptr, 0u);
+ context->PSSetShader(pixelShader, nullptr, 0u);
+
+ context->IASetInputLayout(inputLayout);
+ context->OMSetBlendState(blendState, nullptr, 0xFFFFFFFF);
+
+ context->VSSetConstantBuffers(0, 1, &constantBuffer);
+
+ context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_LINELIST);
+
+ context->RSSetState(rasterizerState);
+
+ UINT vertexStride = sizeof(DebugVertex);
+ UINT offset = 0u;
+ context->IASetVertexBuffers(0, 1, &vertexBuffer, &vertexStride, &offset);
+
+
+ // kick
+ context->Draw(UINT(queued.size()), 0);
+
+ // empty queue
+ queued.resize(0);
+
+ }
+
+
+ std::vector<DebugVertex> queued;
+
+ ID3D11Buffer* vertexBuffer = nullptr;
+ int vertexBufferSize = 0;
+
+ ID3D11DepthStencilState* depthStencilState = nullptr;
+ ID3D11RasterizerState* rasterizerState = nullptr;
+ ID3D11InputLayout* inputLayout = nullptr;
+ ID3D11BlendState* blendState = nullptr;
+ ID3D11VertexShader* vertexShader = nullptr;
+ ID3D11PixelShader* pixelShader = nullptr;
+ ID3D11Buffer* constantBuffer = nullptr;
+
+ ID3D11Device* device = nullptr;
+ ID3D11DeviceContext* context = nullptr;
+
+}; \ No newline at end of file
diff --git a/demo/d3d11/diffuseRender.cpp b/demo/d3d11/diffuseRender.cpp
new file mode 100644
index 0000000..60ced59
--- /dev/null
+++ b/demo/d3d11/diffuseRender.cpp
@@ -0,0 +1,217 @@
+/*
+ * 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.
+ */
+
+//direct3d headers
+
+#define NOMINMAX
+
+#include <d3d11.h>
+
+// include the Direct3D Library file
+#pragma comment (lib, "d3d11.lib")
+
+#include <math.h>
+
+#include "appD3D11Ctx.h"
+
+#include "diffuseRender.h"
+
+#include "shaders/diffuseVS.hlsl.h"
+#include "shaders/diffuseGS.hlsl.h"
+#include "shaders/diffusePS.hlsl.h"
+
+#define EXCLUDE_SHADER_STRUCTS 1
+#include "shaders/shaderCommon.h"
+
+
+void DiffuseRenderer::Init(ID3D11Device* device, ID3D11DeviceContext* context)
+{
+ m_device = device;
+ m_deviceContext = context;
+
+ // create the input layout
+ {
+ D3D11_INPUT_ELEMENT_DESC inputElementDescs[] =
+ {
+ { "POSITION", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ { "VELOCITY", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 1, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ };
+
+ m_device->CreateInputLayout(inputElementDescs, 2, g_diffuseVS, sizeof(g_diffuseVS), &m_inputLayout);
+ }
+
+ // create the shaders
+ m_device->CreateVertexShader(g_diffuseVS, sizeof(g_diffuseVS), nullptr, &m_diffuseVS);
+ m_device->CreateGeometryShader(g_diffuseGS, sizeof(g_diffuseGS), nullptr, &m_diffuseGS);
+ m_device->CreatePixelShader(g_diffusePS, sizeof(g_diffusePS), nullptr, &m_diffusePS);
+
+ {
+ D3D11_BLEND_DESC blendDesc = {};
+ blendDesc.AlphaToCoverageEnable = false;
+ blendDesc.IndependentBlendEnable = false;
+ blendDesc.RenderTarget[0].BlendEnable = true;
+ blendDesc.RenderTarget[0].SrcBlend = D3D11_BLEND_ONE;
+ blendDesc.RenderTarget[0].DestBlend = D3D11_BLEND_INV_SRC_ALPHA;
+ blendDesc.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD;
+ blendDesc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ONE;
+ blendDesc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_INV_SRC_ALPHA;
+ blendDesc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD;
+ blendDesc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;
+
+ m_device->CreateBlendState(&blendDesc, &m_blendState);
+ }
+
+ {
+ D3D11_DEPTH_STENCIL_DESC depthStateDesc = {};
+ depthStateDesc.DepthEnable = TRUE;
+ depthStateDesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ZERO;
+ depthStateDesc.DepthFunc = D3D11_COMPARISON_LESS_EQUAL;
+
+ device->CreateDepthStencilState(&depthStateDesc, &m_depthStencilState);
+ }
+
+ // create a constant buffer
+ {
+ D3D11_BUFFER_DESC bufDesc;
+ bufDesc.ByteWidth = sizeof(DiffuseShaderConst); // 64 * sizeof(float);
+ bufDesc.Usage = D3D11_USAGE_DYNAMIC;
+ bufDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
+ bufDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
+ bufDesc.MiscFlags = 0;
+
+ m_device->CreateBuffer(&bufDesc, nullptr, &m_constantBuffer);
+ }
+
+ // create the rastersizer state
+ {
+ D3D11_RASTERIZER_DESC desc = {};
+ desc.FillMode = D3D11_FILL_SOLID;
+ desc.CullMode = D3D11_CULL_NONE;
+ desc.FrontCounterClockwise = TRUE; // This is non-default
+ desc.DepthBias = 0;
+ desc.DepthBiasClamp = 0.f;
+ desc.SlopeScaledDepthBias = 0.f;
+ desc.DepthClipEnable = TRUE;
+ desc.ScissorEnable = FALSE;
+ desc.MultisampleEnable = FALSE;
+ desc.AntialiasedLineEnable = FALSE;
+
+ m_device->CreateRasterizerState(&desc, &m_rasterizerState);
+ }
+}
+
+void DiffuseRenderer::Destroy()
+{
+ COMRelease(m_inputLayout);
+ COMRelease(m_diffuseVS);
+ COMRelease(m_diffuseGS);
+ COMRelease(m_diffusePS);
+ COMRelease(m_constantBuffer);
+ COMRelease(m_rasterizerState);
+ COMRelease(m_blendState);
+ COMRelease(m_depthStencilState);
+}
+
+
+
+void DiffuseRenderer::Draw(const DiffuseDrawParams* params, ID3D11Buffer* positions, ID3D11Buffer* velocities, ID3D11Buffer* indices, int numParticles)
+{
+ using namespace DirectX;
+
+ ID3D11DeviceContext* deviceContext = m_deviceContext;
+
+ // update constant buffer
+ {
+ D3D11_MAPPED_SUBRESOURCE mappedResource = { 0 };
+ if (S_OK == deviceContext->Map(m_constantBuffer, 0u, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource))
+ {
+ DiffuseShaderConst cParams;
+
+ cParams.modelViewProjection = (float4x4&)(XMMatrixMultiply(XMMatrixMultiply(params->model, params->view), params->projection));
+ cParams.modelView = (float4x4&)XMMatrixMultiply(params->model, params->view);
+ cParams.projection = (float4x4&)params->projection;
+
+ cParams.motionBlurScale = params->motionScale;
+ cParams.diffuseRadius = params->diffuseRadius;
+ cParams.diffuseScale = params->diffuseScale;
+ cParams.spotMin = params->spotMin;
+ cParams.spotMax = params->spotMax;
+
+ cParams.lightTransform = (float4x4&)params->lightTransform;
+ cParams.lightPos = params->lightPos;
+ cParams.lightDir = params->lightDir;
+ cParams.color = params->color;
+
+
+ memcpy(cParams.shadowTaps, params->shadowTaps, sizeof(cParams.shadowTaps));
+
+ memcpy(mappedResource.pData, &cParams, sizeof(DiffuseShaderConst));
+
+ deviceContext->Unmap(m_constantBuffer, 0u);
+ }
+ }
+
+ deviceContext->VSSetShader(m_diffuseVS, nullptr, 0u);
+ deviceContext->GSSetShader(m_diffuseGS, nullptr, 0u);
+ deviceContext->PSSetShader(m_diffusePS, nullptr, 0u);
+
+ if (params->shadowMap)
+ {
+ ShadowMap* shadowMap = (ShadowMap*)params->shadowMap;
+
+ ID3D11ShaderResourceView* ppSRV[1] = { shadowMap->m_depthSrv.Get() };
+ deviceContext->PSSetShaderResources(0, 1, ppSRV);
+ ID3D11SamplerState* ppSS[1] = { shadowMap->m_linearSampler.Get() };
+ deviceContext->PSSetSamplers(0, 1, ppSS);
+ }
+
+ deviceContext->IASetInputLayout(m_inputLayout);
+ deviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_POINTLIST);
+
+ deviceContext->VSSetConstantBuffers(0, 1, &m_constantBuffer);
+ deviceContext->GSSetConstantBuffers(0, 1, &m_constantBuffer);
+ deviceContext->PSSetConstantBuffers(0, 1, &m_constantBuffer);
+
+ ID3D11Buffer* vertexBuffers[2] =
+ {
+ positions,
+ velocities
+ };
+
+ unsigned int vertexBufferStrides[2] =
+ {
+ sizeof(float4),
+ sizeof(float4),
+ };
+
+ unsigned int vertexBufferOffsets[2] = { 0 };
+
+ deviceContext->IASetVertexBuffers(0, 2, vertexBuffers, vertexBufferStrides, vertexBufferOffsets);
+ deviceContext->IASetIndexBuffer(indices, DXGI_FORMAT_R32_UINT, 0u);
+
+ deviceContext->OMSetBlendState(m_blendState, nullptr, 0xFFFFFFFF);
+ deviceContext->OMSetDepthStencilState(m_depthStencilState, 0u);
+
+ float depthSign = DirectX::XMVectorGetW(params->projection.r[2]);
+ if (depthSign < 0.f)
+ {
+ deviceContext->RSSetState(m_rasterizerState);
+ }
+
+ deviceContext->DrawIndexed(numParticles, 0, 0);
+
+ if (depthSign < 0.f)
+ {
+ deviceContext->RSSetState(nullptr);
+ }
+
+ deviceContext->OMSetDepthStencilState(nullptr, 0u);
+ deviceContext->OMSetBlendState(nullptr, nullptr, 0xFFFFFFFF);
+}
diff --git a/demo/d3d11/diffuseRender.h b/demo/d3d11/diffuseRender.h
new file mode 100644
index 0000000..69517b2
--- /dev/null
+++ b/demo/d3d11/diffuseRender.h
@@ -0,0 +1,69 @@
+/*
+ * 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
+
+#include <DirectXMath.h>
+
+#include "shadowMap.h"
+
+
+typedef DirectX::XMFLOAT3 float3;
+typedef DirectX::XMFLOAT4 float4;
+typedef DirectX::XMFLOAT4X4 float4x4;
+
+struct DiffuseDrawParams
+{
+ 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];
+ ShadowMap* shadowMap;
+
+ int mode;
+};
+
+
+struct DiffuseRenderer
+{
+ ID3D11Device* m_device = nullptr;
+ ID3D11DeviceContext* m_deviceContext = nullptr;
+
+ ID3D11InputLayout* m_inputLayout = nullptr;
+
+ ID3D11VertexShader* m_diffuseVS = nullptr;
+ ID3D11GeometryShader* m_diffuseGS = nullptr;
+ ID3D11PixelShader* m_diffusePS = nullptr;
+
+ ID3D11Buffer* m_constantBuffer = nullptr;
+ ID3D11RasterizerState* m_rasterizerState = nullptr;
+
+ ID3D11BlendState* m_blendState = nullptr;
+ ID3D11DepthStencilState* m_depthStencilState = nullptr;
+
+ void Init(ID3D11Device* device, ID3D11DeviceContext* deviceContext);
+ void Destroy();
+
+
+ void Draw(const DiffuseDrawParams* params, ID3D11Buffer* positions, ID3D11Buffer* velocities, ID3D11Buffer* indices, int numParticles);
+};
diff --git a/demo/d3d11/fluidRender.cpp b/demo/d3d11/fluidRender.cpp
new file mode 100644
index 0000000..f9dd767
--- /dev/null
+++ b/demo/d3d11/fluidRender.cpp
@@ -0,0 +1,458 @@
+/*
+ * 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.
+ */
+
+//direct3d headers
+
+#define NOMINMAX
+
+#include <d3d11.h>
+
+// include the Direct3D Library file
+#pragma comment (lib, "d3d11.lib")
+
+#include <math.h>
+
+#include "appD3D11Ctx.h"
+
+#include "fluidRender.h"
+
+#include "shaders/ellipsoidDepthVS.hlsl.h"
+#include "shaders/ellipsoidDepthGS.hlsl.h"
+#include "shaders/ellipsoidDepthPS.hlsl.h"
+#include "shaders/passThroughVS.hlsl.h"
+#include "shaders/blurDepthPS.hlsl.h"
+#include "shaders/compositePS.hlsl.h"
+
+#define EXCLUDE_SHADER_STRUCTS 1
+#include "shaders/shaderCommon.h"
+
+#include "renderTarget.h"
+#include "shadowMap.h"
+
+#include "shaders.h"
+
+typedef DirectX::XMFLOAT2 float2;
+
+using namespace DirectX;
+
+
+struct PassthroughVertex
+{
+ float x, y;
+ float u, v;
+};
+
+void FluidRenderer::Init(ID3D11Device* device, ID3D11DeviceContext* context, int width, int height)
+{
+ mSceneWidth = width;
+ mSceneHeight = height;
+
+ mDepthTex.Init(device, width, height);
+ mDepthSmoothTex.Init(device, width, height, false);
+
+ m_device = device;
+ m_deviceContext = context;
+
+ // create the input layout
+ {
+ D3D11_INPUT_ELEMENT_DESC inputElementDescs[] =
+ {
+ { "POSITION", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ { "U", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 1, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ { "V", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 2, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ { "W", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 3, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ };
+
+ m_device->CreateInputLayout(inputElementDescs, 4, g_ellipsoidDepthVS, sizeof(g_ellipsoidDepthVS), &m_ellipsoidDepthLayout);
+ }
+
+ // create the shaders
+ m_device->CreateVertexShader(g_ellipsoidDepthVS, sizeof(g_ellipsoidDepthVS), nullptr, &m_ellipsoidDepthVS);
+ m_device->CreateGeometryShader(g_ellipsoidDepthGS, sizeof(g_ellipsoidDepthGS), nullptr, &m_ellipsoidDepthGS);
+ m_device->CreatePixelShader(g_ellipsoidDepthPS, sizeof(g_ellipsoidDepthPS), nullptr, &m_ellipsoidDepthPS);
+
+ // create the input layout
+ {
+ D3D11_INPUT_ELEMENT_DESC inputElementDescs[] =
+ {
+ { "POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ };
+
+ m_device->CreateInputLayout(inputElementDescs, 2, g_passThroughVS, sizeof(g_passThroughVS), &m_passThroughLayout);
+ }
+
+ // pass through shader
+ m_device->CreateVertexShader(g_passThroughVS, sizeof(g_passThroughVS), nullptr, &m_passThroughVS);
+
+ // full screen pixel shaders
+ m_device->CreatePixelShader(g_blurDepthPS, sizeof(g_blurDepthPS), nullptr, &m_blurDepthPS);
+ m_device->CreatePixelShader(g_compositePS, sizeof(g_compositePS), nullptr, &m_compositePS);
+
+ // create a constant buffer
+ {
+ D3D11_BUFFER_DESC bufDesc;
+ bufDesc.ByteWidth = sizeof(FluidShaderConst); // 64 * sizeof(float);
+ bufDesc.Usage = D3D11_USAGE_DYNAMIC;
+ bufDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
+ bufDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
+ bufDesc.MiscFlags = 0;
+
+ m_device->CreateBuffer(&bufDesc, nullptr, &m_constantBuffer);
+ }
+
+ // create the rastersizer state
+ for (int i = 0; i < NUM_FLUID_RENDER_MODES; i++)
+ {
+ for (int j = 0; j < NUM_FLUID_CULL_MODES; j++)
+
+ {
+ D3D11_RASTERIZER_DESC desc = {};
+ desc.FillMode = (D3D11_FILL_MODE)(D3D11_FILL_WIREFRAME + i);
+ desc.CullMode = (D3D11_CULL_MODE)(D3D11_CULL_NONE + j);
+ desc.FrontCounterClockwise = TRUE; // This is non-default
+ desc.DepthBias = 0;
+ desc.DepthBiasClamp = 0.f;
+ desc.SlopeScaledDepthBias = 0.f;
+ desc.DepthClipEnable = TRUE;
+ desc.ScissorEnable = FALSE;
+ desc.MultisampleEnable = FALSE;
+ desc.AntialiasedLineEnable = FALSE;
+
+ m_device->CreateRasterizerState(&desc, &m_rasterizerStateRH[i][j]);
+ }
+ }
+
+ CreateScreenQuad();
+}
+
+void FluidRenderer::Destroy()
+{
+ COMRelease(m_ellipsoidDepthLayout);
+ COMRelease(m_ellipsoidDepthVS);
+ COMRelease(m_ellipsoidDepthGS);
+ COMRelease(m_ellipsoidDepthPS);
+
+ COMRelease(m_passThroughLayout);
+ COMRelease(m_passThroughVS);
+
+ COMRelease(m_blurDepthPS);
+ COMRelease(m_compositePS);
+
+ COMRelease(m_constantBuffer);
+
+ for (int i = 0; i < NUM_FLUID_RENDER_MODES; i++)
+ for (int j = 0; j < NUM_FLUID_CULL_MODES; j++)
+ COMRelease(m_rasterizerStateRH[i][j]);
+
+ COMRelease(m_quadVertexBuffer);
+ COMRelease(m_quadIndexBuffer);
+}
+
+void FluidRenderer::CreateScreenQuad()
+{
+ // create an index buffer
+ {
+ D3D11_BUFFER_DESC bufDesc;
+ bufDesc.ByteWidth = 4*sizeof(UINT);
+ bufDesc.Usage = D3D11_USAGE_IMMUTABLE;
+ bufDesc.BindFlags = D3D11_BIND_INDEX_BUFFER;
+ bufDesc.CPUAccessFlags = DXGI_CPU_ACCESS_NONE;
+ bufDesc.MiscFlags = 0;
+
+ unsigned int quad_indices[4] = { 0, 1, 3, 2 };
+
+ D3D11_SUBRESOURCE_DATA data = { 0 };
+ data.pSysMem = quad_indices;
+
+ m_device->CreateBuffer(&bufDesc, &data, &m_quadIndexBuffer);
+ }
+
+ // create a vertex buffer
+ {
+
+ D3D11_BUFFER_DESC bufDesc;
+ bufDesc.ByteWidth = 4*sizeof(PassthroughVertex);
+ bufDesc.Usage = D3D11_USAGE_IMMUTABLE;
+ bufDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
+ bufDesc.CPUAccessFlags = DXGI_CPU_ACCESS_NONE;
+ bufDesc.MiscFlags = 0;
+
+ D3D11_SUBRESOURCE_DATA data = { 0 };
+
+
+ float4 vertices[4] =
+ {
+ float4(-1.0f, -1.0f, 0.0f, 0.0f),
+ float4(1.0f, -1.0f, 1.0f, 0.0f),
+ float4(1.0f, 1.0f, 1.0f, 1.0f),
+ float4(-1.0f, 1.0f, 0.0f, 1.0f),
+ };
+
+ data.pSysMem = vertices;
+
+ m_device->CreateBuffer(&bufDesc, &data, &m_quadVertexBuffer);
+ }
+}
+
+void FluidRenderer::DrawEllipsoids(const FluidDrawParams* params, const FluidRenderBuffers* buffers)
+{
+ ID3D11DeviceContext* deviceContext = m_deviceContext;
+
+ // update constant buffer
+ {
+
+ D3D11_BUFFER_DESC desc;
+ m_constantBuffer->GetDesc(&desc);
+
+ D3D11_MAPPED_SUBRESOURCE mappedResource = {};
+ if (S_OK == deviceContext->Map(m_constantBuffer, 0u, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource))
+ {
+ FluidShaderConst cParams;
+
+ cParams.modelviewprojection = (float4x4&)(XMMatrixMultiply(XMMatrixMultiply(params->model, params->view), params->projection));
+ cParams.projection = (float4x4&)params->projection;
+ cParams.modelview_inverse = (float4x4&)XMMatrixInverse(nullptr, XMMatrixMultiply(params->model, params->view));
+ cParams.projection_inverse = (float4x4&)XMMatrixInverse(nullptr, params->projection);
+
+ //cParams.invTexScale = invTexScale;
+ //cParams.invProjection = invProjection;
+ cParams.invViewport = params->invViewport;
+
+
+ cParams.blurRadiusWorld = params->blurRadiusWorld;
+ cParams.blurScale = params->blurScale;
+ cParams.blurFalloff = params->blurFalloff;
+ cParams.debug = params->debug;
+
+ memcpy(mappedResource.pData, &cParams, sizeof(FluidShaderConst));
+
+ deviceContext->Unmap(m_constantBuffer, 0u);
+ }
+ }
+
+ deviceContext->VSSetShader(m_ellipsoidDepthVS, nullptr, 0u);
+ deviceContext->GSSetShader(m_ellipsoidDepthGS, nullptr, 0u);
+ deviceContext->PSSetShader(m_ellipsoidDepthPS, nullptr, 0u);
+
+ deviceContext->IASetInputLayout(m_ellipsoidDepthLayout);
+ deviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_POINTLIST);
+
+ deviceContext->VSSetConstantBuffers(0, 1, &m_constantBuffer);
+ deviceContext->GSSetConstantBuffers(0, 1, &m_constantBuffer);
+ deviceContext->PSSetConstantBuffers(0, 1, &m_constantBuffer);
+
+ ID3D11Buffer* vertexBuffers[4] =
+ {
+ buffers->mPositionVBO,
+ buffers->mAnisotropyVBO[0],
+ buffers->mAnisotropyVBO[1],
+ buffers->mAnisotropyVBO[2]
+ };
+
+ unsigned int vertexBufferStrides[4] =
+ {
+ sizeof(float4),
+ sizeof(float4),
+ sizeof(float4),
+ sizeof(float4)
+ };
+
+ unsigned int vertexBufferOffsets[4] = { 0 };
+
+ deviceContext->IASetVertexBuffers(0, 4, vertexBuffers, vertexBufferStrides, vertexBufferOffsets);
+ deviceContext->IASetIndexBuffer(buffers->mIndices, DXGI_FORMAT_R32_UINT, 0u);
+
+ float depthSign = DirectX::XMVectorGetW(params->projection.r[2]);
+ if (depthSign < 0.f)
+ {
+ deviceContext->RSSetState(m_rasterizerStateRH[params->renderMode][params->cullMode]);
+ }
+
+ deviceContext->DrawIndexed(params->n, params->offset, 0);
+
+ if (depthSign < 0.f)
+ {
+ deviceContext->RSSetState(nullptr);
+ }
+}
+
+void FluidRenderer::DrawBlurDepth(const FluidDrawParams* params)
+{
+ ID3D11DeviceContext* deviceContext = m_deviceContext;
+
+ // update constant buffer
+ {
+ D3D11_MAPPED_SUBRESOURCE mappedResource = {};
+ if (S_OK == deviceContext->Map(m_constantBuffer, 0u, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource))
+ {
+ FluidShaderConst cParams;
+
+ cParams.modelviewprojection = (float4x4&)(XMMatrixMultiply(XMMatrixMultiply(params->model, params->view), params->projection));
+ cParams.projection = (float4x4&)params->projection;
+ cParams.modelview_inverse = (float4x4&)XMMatrixInverse(nullptr, XMMatrixMultiply(params->model, params->view));
+ cParams.projection_inverse = (float4x4&)XMMatrixInverse(nullptr, params->projection);
+
+ //cParams.invTexScale = params->invTexScale;
+ //cParams.invViewport = params->invViewport;
+ //cParams.invProjection = params->invProjection;
+
+ cParams.blurRadiusWorld = params->blurRadiusWorld;
+ cParams.blurScale = params->blurScale;
+ cParams.blurFalloff = params->blurFalloff;
+ cParams.debug = params->debug;
+
+ memcpy(mappedResource.pData, &cParams, sizeof(FluidShaderConst));
+
+ deviceContext->Unmap(m_constantBuffer, 0u);
+ }
+ }
+
+ deviceContext->VSSetShader(m_passThroughVS, nullptr, 0u);
+ deviceContext->GSSetShader(nullptr, nullptr, 0u);
+ deviceContext->PSSetShader(m_blurDepthPS, nullptr, 0u);
+
+ ID3D11ShaderResourceView* ppSRV[1] = { mDepthTex.m_backSrv.Get() };
+ deviceContext->PSSetShaderResources(0, 1, ppSRV);
+
+ deviceContext->IASetInputLayout(m_passThroughLayout);
+ deviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
+
+ deviceContext->VSSetConstantBuffers(0, 1, &m_constantBuffer);
+ deviceContext->PSSetConstantBuffers(0, 1, &m_constantBuffer);
+
+ UINT vertexStride = sizeof(PassthroughVertex);
+ UINT offset = 0u;
+ deviceContext->IASetVertexBuffers(0, 1, &m_quadVertexBuffer, &vertexStride, &offset);
+ deviceContext->IASetIndexBuffer(m_quadIndexBuffer, DXGI_FORMAT_R32_UINT, 0u);
+
+ float depthSign = DirectX::XMVectorGetW(params->projection.r[2]);
+ if (depthSign < 0.f)
+ {
+ deviceContext->RSSetState(m_rasterizerStateRH[params->renderMode][params->cullMode]);
+ }
+
+ deviceContext->DrawIndexed((UINT)4, 0, 0);
+
+ if (depthSign < 0.f)
+ {
+ deviceContext->RSSetState(nullptr);
+ }
+}
+
+void FluidRenderer::DrawComposite(const FluidDrawParams* params, ID3D11ShaderResourceView* sceneMap)
+{
+ ID3D11DeviceContext* deviceContext = m_deviceContext;
+
+ // update constant buffer
+ {
+ D3D11_MAPPED_SUBRESOURCE mappedResource = {};
+ if (S_OK == deviceContext->Map(m_constantBuffer, 0u, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource))
+ {
+ FluidShaderConst cParams;
+
+ cParams.modelviewprojection = (float4x4&)(XMMatrixMultiply(XMMatrixMultiply(params->model, params->view), params->projection));
+ cParams.modelview = (float4x4&)XMMatrixMultiply(params->model, params->view);
+ cParams.projection = (float4x4&)params->projection;
+ cParams.modelview_inverse = (float4x4&)XMMatrixInverse(nullptr, XMMatrixMultiply(params->model, params->view));
+ cParams.projection_inverse = (float4x4&)XMMatrixInverse(nullptr, params->projection);
+
+ cParams.lightTransform = (float4x4&)params->lightTransform;
+
+ cParams.invTexScale = params->invTexScale;
+
+ //cParams.invViewport = params->invViewport;
+ //cParams.invProjection = params->invProjection;
+
+ cParams.blurRadiusWorld = params->blurRadiusWorld;
+ cParams.blurScale = params->blurScale;
+ cParams.blurFalloff = params->blurFalloff;
+ cParams.debug = params->debug;
+
+ cParams.clipPosToEye = params->clipPosToEye;
+ cParams.color = params->color;
+ cParams.ior = params->ior;
+ cParams.spotMin = params->spotMin;
+ cParams.spotMax = params->spotMax;
+
+ cParams.lightPos = params->lightPos;
+ cParams.lightDir = params->lightDir;
+
+ memcpy(mappedResource.pData, &cParams, sizeof(FluidShaderConst));
+
+ deviceContext->Unmap(m_constantBuffer, 0u);
+
+ 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(cParams.shadowTaps, taps, sizeof(taps));
+ }
+ }
+
+ deviceContext->VSSetShader(m_passThroughVS, nullptr, 0u);
+ deviceContext->GSSetShader(nullptr, nullptr, 0u);
+ deviceContext->PSSetShader(m_compositePS, nullptr, 0u);
+
+
+ RenderTarget* depthMap = &mDepthSmoothTex;
+ ShadowMap* shadowMap = (ShadowMap*)params->shadowMap;
+
+ ID3D11ShaderResourceView* ppSRV[3] =
+ {
+ depthMap->m_backSrv.Get(),
+ sceneMap,
+ shadowMap->m_depthSrv.Get()
+
+ };
+ deviceContext->PSSetShaderResources(0, 3, ppSRV);
+
+ ID3D11SamplerState* ppSS[2] =
+ {
+ depthMap->m_linearSampler.Get() ,
+ shadowMap->m_linearSampler.Get()
+ };
+ deviceContext->PSSetSamplers(0, 2, ppSS);
+
+
+ deviceContext->IASetInputLayout(m_passThroughLayout);
+ deviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
+
+ deviceContext->VSSetConstantBuffers(0, 1, &m_constantBuffer);
+ deviceContext->PSSetConstantBuffers(0, 1, &m_constantBuffer);
+
+ UINT vertexStride = sizeof(PassthroughVertex);
+ UINT offset = 0u;
+ deviceContext->IASetVertexBuffers(0, 1, &m_quadVertexBuffer, &vertexStride, &offset);
+ deviceContext->IASetIndexBuffer(m_quadIndexBuffer, DXGI_FORMAT_R32_UINT, 0u);
+
+ float depthSign = DirectX::XMVectorGetW(params->projection.r[2]);
+ if (depthSign < 0.f)
+ {
+ deviceContext->RSSetState(m_rasterizerStateRH[params->renderMode][params->cullMode]);
+ }
+
+ deviceContext->DrawIndexed((UINT)4, 0, 0);
+
+ if (depthSign < 0.f)
+ {
+ deviceContext->RSSetState(nullptr);
+ }
+
+ // reset srvs
+ ID3D11ShaderResourceView* zero[3] = { NULL, NULL, NULL };
+ deviceContext->PSSetShaderResources(0, 3, zero);
+}
+
diff --git a/demo/d3d11/fluidRender.h b/demo/d3d11/fluidRender.h
new file mode 100644
index 0000000..43fee4b
--- /dev/null
+++ b/demo/d3d11/fluidRender.h
@@ -0,0 +1,126 @@
+/*
+ * 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
+
+#include <DirectXMath.h>
+
+#include <d3d11.h>
+
+#include "renderTarget.h"
+#include "shadowMap.h"
+
+struct FluidRenderBuffers;
+
+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
+};
+
+typedef DirectX::XMFLOAT3 float3;
+typedef DirectX::XMFLOAT4 float4;
+typedef DirectX::XMFLOAT4X4 float4x4;
+
+struct FluidDrawParams
+{
+ 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;
+
+ ShadowMap* shadowMap;
+};
+
+
+struct FluidRenderer
+{
+ ID3D11Device* m_device = nullptr;
+ ID3D11DeviceContext* m_deviceContext = nullptr;
+
+ ID3D11InputLayout* m_ellipsoidDepthLayout = nullptr;
+ ID3D11VertexShader* m_ellipsoidDepthVS = nullptr;
+ ID3D11GeometryShader* m_ellipsoidDepthGS = nullptr;
+ ID3D11PixelShader* m_ellipsoidDepthPS = nullptr;
+
+ ID3D11InputLayout* m_passThroughLayout = nullptr;
+ ID3D11VertexShader* m_passThroughVS = nullptr;
+
+ ID3D11PixelShader* m_blurDepthPS = nullptr;
+ ID3D11PixelShader* m_compositePS = nullptr;
+
+ ID3D11Buffer* m_constantBuffer = nullptr;
+ ID3D11RasterizerState* m_rasterizerStateRH[NUM_FLUID_RENDER_MODES][NUM_FLUID_CULL_MODES];
+
+ ID3D11Buffer* m_quadVertexBuffer;
+ ID3D11Buffer* m_quadIndexBuffer;
+
+ RenderTarget mDepthTex;
+ RenderTarget mDepthSmoothTex;
+ RenderTarget mThicknessTex;
+
+ int mSceneWidth;
+ int mSceneHeight;
+
+ void Init(ID3D11Device* device, ID3D11DeviceContext* context, int width, int height);
+ void Destroy();
+
+ void DrawEllipsoids(const FluidDrawParams* params, const FluidRenderBuffers* buffers);
+ void DrawBlurDepth(const FluidDrawParams* params);
+ void DrawComposite(const FluidDrawParams* params, ID3D11ShaderResourceView* sceneMap);
+
+ void CreateScreenQuad();
+};
+
+
diff --git a/demo/d3d11/imguiGraph.cpp b/demo/d3d11/imguiGraph.cpp
new file mode 100644
index 0000000..011e71b
--- /dev/null
+++ b/demo/d3d11/imguiGraph.cpp
@@ -0,0 +1,472 @@
+/*
+ * 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.
+ */
+
+#define _USE_MATH_DEFINES
+#include <math.h>
+#include "imgui.h"
+
+#include <stdio.h>
+#include <stdint.h>
+
+#include "imguiGraph.h"
+#include "imguiGraphD3D11.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, 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;
+ }
+
+ stbtt_BakeFontBitmap(ttfBuffer, 0, 15.0f, 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/d3d11/imguiGraph.h b/demo/d3d11/imguiGraph.h
new file mode 100644
index 0000000..e6e5eb4
--- /dev/null
+++ b/demo/d3d11/imguiGraph.h
@@ -0,0 +1,29 @@
+/*
+ * 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
+
+#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, const ImguiGraphDesc* desc);
+
+void imguiGraphUpdate(const ImguiGraphDesc* desc);
+
+void imguiGraphDestroy();
+
+void imguiGraphDraw(); \ No newline at end of file
diff --git a/demo/d3d11/imguiGraphD3D11.cpp b/demo/d3d11/imguiGraphD3D11.cpp
new file mode 100644
index 0000000..89c8c91
--- /dev/null
+++ b/demo/d3d11/imguiGraphD3D11.cpp
@@ -0,0 +1,473 @@
+/*
+ * 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 "imguiGraphD3D11.h"
+
+//direct3d headers
+#include <d3d11.h>
+
+#include "shaders/imguiVS.hlsl.h"
+#include "shaders/imguiPS.hlsl.h"
+
+namespace
+{
+ template <class T>
+ void inline COMRelease(T& t)
+ {
+ if (t) t->Release();
+ t = nullptr;
+ }
+}
+
+namespace
+{
+ ID3D11Device* m_device = nullptr;
+ ID3D11DeviceContext* m_deviceContext = nullptr;
+ int m_winW = 0;
+ int m_winH = 0;
+
+ uint32_t m_maxVertices = 0;
+
+ struct Vertex
+ {
+ float x, y;
+ float u, v;
+ uint8_t rgba[4];
+ };
+
+ ID3D11RasterizerState* m_rasterizerState = nullptr;
+ ID3D11SamplerState* m_samplerState = nullptr;
+ ID3D11InputLayout* m_inputLayout = nullptr;
+ ID3D11BlendState* m_blendState = nullptr;
+ ID3D11VertexShader* m_imguiVS = nullptr;
+ ID3D11PixelShader* m_imguiPS = nullptr;
+ ID3D11Buffer* m_constantBuffer = nullptr;
+ ID3D11Buffer* m_vertexBuffer = nullptr;
+ Vertex* m_vertexBufferData = nullptr;
+
+ struct Scissor
+ {
+ int beginIdx;
+ int stopIdx;
+ int x;
+ int y;
+ int width;
+ int height;
+ };
+ Scissor m_stateScissor = {};
+
+ ID3D11Texture2D* m_texture = nullptr;
+ ID3D11ShaderResourceView* m_textureSRV = nullptr;
+
+ Vertex m_stateVert;
+ uint32_t m_stateVertIdx = 0u;
+
+ struct Params
+ {
+ float projection[16];
+
+ float padding[64 - 16];
+ };
+}
+
+void imguiGraphContextDestroy()
+{
+ COMRelease(m_rasterizerState);
+ COMRelease(m_samplerState);
+ COMRelease(m_inputLayout);
+ COMRelease(m_blendState);
+ COMRelease(m_imguiVS);
+ COMRelease(m_imguiPS);
+ COMRelease(m_constantBuffer);
+ COMRelease(m_vertexBuffer);
+}
+
+void imguiGraphContextInit(const ImguiGraphDesc* desc)
+{
+ m_device = desc->device;
+ m_deviceContext = desc->deviceContext;
+ m_winW = desc->winW;
+ m_winH = desc->winH;
+
+ m_maxVertices = desc->maxVertices;
+
+ // create the rastersizer state
+ {
+ D3D11_RASTERIZER_DESC desc = {};
+ desc.FillMode = D3D11_FILL_SOLID;
+ desc.CullMode = D3D11_CULL_BACK;
+ desc.FrontCounterClockwise = TRUE; // This is non-default
+ desc.DepthBias = 0;
+ desc.DepthBiasClamp = 0.f;
+ desc.SlopeScaledDepthBias = 0.f;
+ desc.DepthClipEnable = TRUE;
+ desc.ScissorEnable = TRUE; // This is non-default
+ desc.MultisampleEnable = FALSE;
+ desc.AntialiasedLineEnable = FALSE;
+
+ m_device->CreateRasterizerState(&desc, &m_rasterizerState);
+ }
+
+ // create the sampler state
+ {
+ D3D11_SAMPLER_DESC sampler = {};
+ sampler.Filter = D3D11_FILTER_MIN_MAG_LINEAR_MIP_POINT;
+ sampler.AddressU = D3D11_TEXTURE_ADDRESS_BORDER;
+ sampler.AddressV = D3D11_TEXTURE_ADDRESS_BORDER;
+ sampler.AddressW = D3D11_TEXTURE_ADDRESS_BORDER;
+ sampler.MipLODBias = 0;
+ sampler.MaxAnisotropy = 0;
+ sampler.ComparisonFunc = D3D11_COMPARISON_NEVER;
+ //sampler.BorderColor = D3D11_BORDER_COLOR_TRANSPARENT_BLACK;
+ sampler.MinLOD = 0.f;
+ sampler.MaxLOD = D3D11_FLOAT32_MAX;
+
+ m_device->CreateSamplerState(&sampler, &m_samplerState);
+ }
+
+ // create the input layout
+ {
+ D3D11_INPUT_ELEMENT_DESC inputElementDescs[] =
+ {
+ { "POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ { "COLOR", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ };
+
+ m_device->CreateInputLayout(inputElementDescs, 3, g_imguiVS, sizeof(g_imguiVS), &m_inputLayout);
+ }
+
+ // create the blend state
+ {
+ D3D11_BLEND_DESC blendDesc = {};
+ blendDesc.AlphaToCoverageEnable = false;
+ blendDesc.IndependentBlendEnable = false;
+ blendDesc.RenderTarget[0].BlendEnable = true;
+ blendDesc.RenderTarget[0].SrcBlend = D3D11_BLEND_SRC_ALPHA;
+ blendDesc.RenderTarget[0].DestBlend = D3D11_BLEND_INV_SRC_ALPHA;
+ blendDesc.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD;
+ blendDesc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_SRC_ALPHA;
+ blendDesc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_INV_SRC_ALPHA;
+ blendDesc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD;
+ blendDesc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;
+
+ m_device->CreateBlendState(&blendDesc, &m_blendState);
+ }
+
+ // create the shaders
+ m_device->CreateVertexShader(g_imguiVS, sizeof(g_imguiVS), nullptr, &m_imguiVS);
+ m_device->CreatePixelShader(g_imguiPS, sizeof(g_imguiPS), nullptr, &m_imguiPS);
+
+ // create a constant buffer
+ {
+ Params params = {
+ 1.f, 0.f, 0.f, 0.f,
+ 0.f, 1.f, 0.f, 0.f,
+ 0.f, 0.f, 1.f, 0.f,
+ 0.f, 0.f, 0.f, 1.f
+ };
+
+ D3D11_BUFFER_DESC bufDesc;
+ bufDesc.ByteWidth = sizeof(params);
+ bufDesc.Usage = D3D11_USAGE_DYNAMIC;
+ bufDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
+ bufDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
+ bufDesc.MiscFlags = 0;
+
+ D3D11_SUBRESOURCE_DATA data = {};
+ data.pSysMem = &params;
+
+ m_device->CreateBuffer(&bufDesc, &data, &m_constantBuffer);
+ }
+
+ // create a vertex buffer
+ {
+ UINT bufferSize = (UINT)(m_maxVertices) * sizeof(Vertex);
+
+ D3D11_BUFFER_DESC bufDesc;
+ bufDesc.ByteWidth = bufferSize;
+ bufDesc.Usage = D3D11_USAGE_DYNAMIC;
+ bufDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
+ bufDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
+ bufDesc.MiscFlags = 0;
+
+ m_device->CreateBuffer(&bufDesc, nullptr, &m_vertexBuffer);
+ }
+}
+
+void imguiGraphContextUpdate(const ImguiGraphDesc* desc)
+{
+ m_device = desc->device;
+ m_deviceContext = desc->deviceContext;
+ m_winW = desc->winW;
+ m_winH = desc->winH;
+}
+
+void imguiGraphRecordBegin()
+{
+ Params params = {
+ 2.f / float(m_winW), 0.f, 0.f, -1.f,
+ 0.f, 2.f / float(m_winH), 0.f, -1.f,
+ 0.f, 0.f, 1.f, 0.f,
+ 0.f, 0.f, 0.f, 1.f
+ };
+
+ ID3D11DeviceContext* context = m_deviceContext;
+
+ // update constant buffer
+ {
+ D3D11_MAPPED_SUBRESOURCE mappedResource = {};
+ if (S_OK == context->Map(m_constantBuffer, 0u, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource))
+ {
+ memcpy(mappedResource.pData, &params, sizeof(Params));
+
+ context->Unmap(m_constantBuffer, 0u);
+ }
+ }
+
+ // clear state
+ m_stateVert = Vertex{ 0.f, 0.f, -1.f, -1.f, 0,0,0,0 };
+ m_stateVertIdx = 0u;
+
+ m_stateScissor = Scissor { 0, 0, 0, 0, m_winW, m_winH };
+
+ // configure for triangle renderering
+ context->VSSetShader(m_imguiVS, nullptr, 0u);
+ context->GSSetShader(nullptr, nullptr, 0u);
+ context->PSSetShader(m_imguiPS, nullptr, 0u);
+
+ context->IASetInputLayout(m_inputLayout);
+ context->OMSetBlendState(m_blendState, nullptr, 0xFFFFFFFF);
+ context->PSSetSamplers(0, 1, &m_samplerState);
+
+ context->VSSetConstantBuffers(0, 1, &m_constantBuffer);
+
+ context->PSSetShaderResources(0, 1, &m_textureSRV);
+
+ context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
+
+ context->RSSetState(m_rasterizerState);
+
+ // trigger allocation of new vertex buffer as needed
+ {
+ D3D11_MAPPED_SUBRESOURCE mappedResource = {};
+ if (S_OK == context->Map(m_vertexBuffer, 0u, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource))
+ {
+ context->Unmap(m_vertexBuffer, 0u);
+ }
+ }
+
+ UINT vertexStride = sizeof(Vertex);
+ UINT offset = 0u;
+ context->IASetVertexBuffers(0, 1, &m_vertexBuffer, &vertexStride, &offset);
+
+ // map allocated vertex buffer
+ {
+ D3D11_MAPPED_SUBRESOURCE mappedResource = {};
+ if (S_OK == context->Map(m_vertexBuffer, 0u, D3D11_MAP_WRITE_NO_OVERWRITE, 0, &mappedResource))
+ {
+ m_vertexBufferData = (Vertex*)mappedResource.pData;
+ }
+ else
+ {
+ m_vertexBufferData = nullptr;
+ }
+ }
+}
+
+static void imguiGraphFlush()
+{
+ ID3D11DeviceContext* context = m_deviceContext;
+
+ // unmap vertex buffer
+ context->Unmap(m_vertexBuffer, 0u);
+
+ Scissor& p = m_stateScissor;
+ if (p.beginIdx < p.stopIdx)
+ {
+ int winH = m_winH;
+ D3D11_RECT rect;
+ rect.left = p.x;
+ rect.right = p.x + p.width;
+ rect.top = (winH) - (p.y + p.height);
+ rect.bottom = (winH) - (p.y);
+ context->RSSetScissorRects(1, &rect);
+
+ UINT vertexCount = (p.stopIdx - p.beginIdx);
+ UINT startIndex = p.beginIdx;
+ context->DrawInstanced(vertexCount, 1, startIndex, 0);
+ }
+
+ // map allocated vertex buffer
+ {
+ D3D11_MAPPED_SUBRESOURCE mappedResource = {};
+ if (S_OK == context->Map(m_vertexBuffer, 0u, D3D11_MAP_WRITE_NO_OVERWRITE, 0, &mappedResource))
+ {
+ m_vertexBufferData = (Vertex*)mappedResource.pData;
+ }
+ else
+ {
+ m_vertexBufferData = nullptr;
+ }
+ }
+}
+
+void imguiGraphRecordEnd()
+{
+ ID3D11DeviceContext* context = m_deviceContext;
+
+ context->OMSetBlendState(nullptr,nullptr,0xFFFFFFFF);
+
+ // unmap vertex buffer
+ context->Unmap(m_vertexBuffer, 0u);
+
+ // restore scissor
+ Scissor& p = m_stateScissor;
+ int winH = m_winH;
+ D3D11_RECT rect;
+ rect.left = p.x;
+ rect.right = p.x + p.width;
+ rect.top = (winH) - (p.y + p.height);
+ rect.bottom = (winH) - (p.y);
+ context->RSSetScissorRects(1, &rect);
+
+ context->RSSetState(nullptr);
+}
+
+void imguiGraphEnableScissor(int x, int y, int width, int height)
+{
+ // mark end of last region
+ m_stateScissor.stopIdx = m_stateVertIdx;
+
+ imguiGraphFlush();
+
+ m_stateScissor.beginIdx = m_stateVertIdx;
+ m_stateScissor.stopIdx = m_stateVertIdx;
+ m_stateScissor.x = x;
+ m_stateScissor.y = y;
+ m_stateScissor.width = width;
+ m_stateScissor.height = height;
+}
+
+void imguiGraphDisableScissor()
+{
+ if (m_stateVertIdx == 0) return;
+
+ // mark end of last region
+ m_stateScissor.stopIdx = m_stateVertIdx;
+
+ imguiGraphFlush();
+
+ m_stateScissor.beginIdx = m_stateVertIdx;
+ m_stateScissor.stopIdx = m_stateVertIdx;
+ m_stateScissor.x = 0;
+ m_stateScissor.y = 0;
+ m_stateScissor.width = m_winW;
+ m_stateScissor.height = m_winH;
+}
+
+void imguiGraphVertex2f(float x, float y)
+{
+ float v[2] = { x,y };
+ imguiGraphVertex2fv(v);
+}
+
+void imguiGraphVertex2fv(const float* v)
+{
+ // update state
+ m_stateVert.x = v[0];
+ m_stateVert.y = v[1];
+
+ Vertex* vdata = m_vertexBufferData;
+
+ // push vertex
+ if ((m_stateVertIdx) < m_maxVertices)
+ {
+ vdata[m_stateVertIdx++] = m_stateVert;
+ }
+}
+
+void imguiGraphTexCoord2f(float u, float v)
+{
+ m_stateVert.u = u;
+ m_stateVert.v = v;
+}
+
+void imguiGraphColor4ub(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha)
+{
+ m_stateVert.rgba[0] = red;
+ m_stateVert.rgba[1] = green;
+ m_stateVert.rgba[2] = blue;
+ m_stateVert.rgba[3] = alpha;
+}
+
+void imguiGraphColor4ubv(const uint8_t* v)
+{
+ m_stateVert.rgba[0] = v[0];
+ m_stateVert.rgba[1] = v[1];
+ m_stateVert.rgba[2] = v[2];
+ m_stateVert.rgba[3] = v[3];
+}
+
+void imguiGraphFontTextureEnable()
+{
+
+}
+
+void imguiGraphFontTextureDisable()
+{
+ m_stateVert.u = -1.f;
+ m_stateVert.v = -1.f;
+}
+
+void imguiGraphFontTextureInit(unsigned char* data)
+{
+ ID3D11DeviceContext* context = m_deviceContext;
+
+ // create texture
+ {
+ UINT width = 512;
+ UINT height = 512;
+
+ D3D11_TEXTURE2D_DESC texDesc = {};
+ texDesc.Width = width;
+ texDesc.Height = height;
+ texDesc.MipLevels = 1;
+ texDesc.ArraySize = 1;
+ texDesc.Format = DXGI_FORMAT_R8_UNORM;
+ texDesc.SampleDesc.Count = 1;
+ texDesc.SampleDesc.Quality = 0u;
+ texDesc.Usage = D3D11_USAGE_IMMUTABLE;
+ texDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
+ texDesc.CPUAccessFlags = 0;
+ texDesc.MiscFlags = 0;
+
+ D3D11_SUBRESOURCE_DATA initData = {};
+ initData.pSysMem = data;
+ initData.SysMemPitch = width;
+
+ if (m_device->CreateTexture2D(&texDesc, &initData, &m_texture))
+ {
+ return;
+ }
+
+ if (m_device->CreateShaderResourceView(m_texture, nullptr, &m_textureSRV))
+ {
+ return;
+ }
+ }
+
+}
+
+void imguiGraphFontTextureRelease()
+{
+ COMRelease(m_texture);
+ COMRelease(m_textureSRV);
+} \ No newline at end of file
diff --git a/demo/d3d11/imguiGraphD3D11.h b/demo/d3d11/imguiGraphD3D11.h
new file mode 100644
index 0000000..be9c88b
--- /dev/null
+++ b/demo/d3d11/imguiGraphD3D11.h
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ */
+
+#ifndef IMGUI_GRAPH_D3D11_H
+#define IMGUI_GRAPH_D3D11_H
+
+#include <stdint.h>
+
+#include "imguiGraph.h"
+
+struct ID3D11Device;
+struct ID3D11DeviceContext;
+
+struct ImguiGraphDesc
+{
+ ID3D11Device* device = nullptr;
+ ID3D11DeviceContext* deviceContext = nullptr;
+ int winW;
+ int winH;
+
+ uint32_t maxVertices = 64 * 4096u;
+
+ ImguiGraphDesc() {}
+};
+
+// Below are the functions that must be implemented per graphics API
+
+void imguiGraphContextInit(const ImguiGraphDesc* desc);
+
+void imguiGraphContextUpdate(const ImguiGraphDesc* desc);
+
+void imguiGraphContextDestroy();
+
+void imguiGraphRecordBegin();
+
+void imguiGraphRecordEnd();
+
+void imguiGraphVertex2f(float x, float y);
+
+void imguiGraphVertex2fv(const float* v);
+
+void imguiGraphTexCoord2f(float u, float v);
+
+void imguiGraphColor4ub(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha);
+
+void imguiGraphColor4ubv(const uint8_t* v);
+
+void imguiGraphFontTextureEnable();
+
+void imguiGraphFontTextureDisable();
+
+void imguiGraphEnableScissor(int x, int y, int width, int height);
+
+void imguiGraphDisableScissor();
+
+void imguiGraphFontTextureInit(unsigned char* data);
+
+void imguiGraphFontTextureRelease();
+
+#endif \ No newline at end of file
diff --git a/demo/d3d11/meshRender.cpp b/demo/d3d11/meshRender.cpp
new file mode 100644
index 0000000..b07397b
--- /dev/null
+++ b/demo/d3d11/meshRender.cpp
@@ -0,0 +1,221 @@
+/*
+ * 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.
+ */
+
+//direct3d headers
+
+#define NOMINMAX
+
+#include <d3d11.h>
+
+// include the Direct3D Library file
+#pragma comment (lib, "d3d11.lib")
+
+#include <math.h>
+
+#include "meshRender.h"
+#include "appD3d11Ctx.h"
+
+
+#include "shaders/meshVS.hlsl.h"
+#include "shaders/meshPS.hlsl.h"
+#include "shaders/meshShadowPS.hlsl.h"
+
+#define EXCLUDE_SHADER_STRUCTS 1
+#include "shaders/shaderCommon.h"
+
+#include "shadowMap.h"
+
+
+void MeshRenderer::Init(ID3D11Device* device, ID3D11DeviceContext* context)
+{
+ for (int i = 0; i < NUM_MESH_RENDER_MODES; i++)
+ for (int j = 0; j < NUM_MESH_CULL_MODES; j++)
+ m_rasterizerStateRH[i][j] = nullptr;
+
+ m_device = device;
+ m_deviceContext = context;
+
+ // create the input layout
+ {
+ D3D11_INPUT_ELEMENT_DESC inputElementDescs[] =
+ {
+ { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ { "NORMAL", 0, DXGI_FORMAT_R32G32B32_FLOAT, 1, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 2, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ { "COLOR", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 3, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ };
+
+ m_device->CreateInputLayout(inputElementDescs, 4, g_meshVS, sizeof(g_meshVS), &m_inputLayout);
+ }
+
+ // create the shaders
+ m_device->CreateVertexShader(g_meshVS, sizeof(g_meshVS), nullptr, &m_meshVS);
+ m_device->CreatePixelShader(g_meshPS, sizeof(g_meshPS), nullptr, &m_meshPS);
+ m_device->CreatePixelShader(g_meshPS_Shadow, sizeof(g_meshPS_Shadow), nullptr, &m_meshPS_Shadow);
+
+ // create a constant buffer
+ {
+ D3D11_BUFFER_DESC bufDesc;
+ bufDesc.ByteWidth = sizeof(MeshShaderConst);
+ bufDesc.Usage = D3D11_USAGE_DYNAMIC;
+ bufDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
+ bufDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
+ bufDesc.MiscFlags = 0;
+
+ m_device->CreateBuffer(&bufDesc, nullptr, &m_constantBuffer);
+ }
+
+ // create the rastersizer state
+ for (int i = 0; i < NUM_MESH_RENDER_MODES; i++)
+ {
+ for (int j = 0; j < NUM_MESH_CULL_MODES; j++)
+
+ {
+ D3D11_RASTERIZER_DESC desc = {};
+ desc.FillMode = (D3D11_FILL_MODE)(D3D11_FILL_WIREFRAME + i);
+ desc.CullMode = (D3D11_CULL_MODE)(D3D11_CULL_NONE + j);
+ desc.FrontCounterClockwise = TRUE; // This is non-default
+ desc.DepthBias = 0;
+ desc.DepthBiasClamp = 0.f;
+ desc.SlopeScaledDepthBias = 0.f;
+ desc.DepthClipEnable = TRUE;
+ desc.ScissorEnable = FALSE;
+ desc.MultisampleEnable = FALSE;
+ desc.AntialiasedLineEnable = FALSE;
+
+ m_device->CreateRasterizerState(&desc, &m_rasterizerStateRH[i][j]);
+ }
+ }
+
+}
+
+void MeshRenderer::Destroy()
+{
+ COMRelease(m_inputLayout);
+ COMRelease(m_meshVS);
+ COMRelease(m_meshPS);
+ COMRelease(m_meshPS_Shadow);
+ COMRelease(m_constantBuffer);
+
+ for (int i = 0; i < NUM_MESH_RENDER_MODES; i++)
+ for (int j = 0; j < NUM_MESH_CULL_MODES; j++)
+ COMRelease(m_rasterizerStateRH[i][j]);
+}
+
+
+void MeshRenderer::Draw(const GpuMesh* mesh, const MeshDrawParams* params)
+{
+ using namespace DirectX;
+
+ // update constant buffer
+ {
+ D3D11_MAPPED_SUBRESOURCE mappedResource = {};
+ if (S_OK == m_deviceContext->Map(m_constantBuffer, 0u, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource))
+ {
+ MeshShaderConst cParams;
+
+ cParams.modelviewprojection = (float4x4&)(XMMatrixMultiply(XMMatrixMultiply(params->model, params->view), params->projection));
+
+ cParams.modelview = (float4x4&)XMMatrixMultiply(params->model, params->view);
+
+ cParams.objectTransform = (float4x4&)params->objectTransform;
+ cParams.lightTransform = (float4x4&)params->lightTransform;
+
+ cParams.clipPlane = params->clipPlane;
+ cParams.fogColor = params->fogColor;
+ cParams.color = params->color;
+ cParams.secondaryColor = params->secondaryColor;
+
+ cParams.lightPos = params->lightPos;
+ cParams.lightDir = params->lightDir;
+
+ cParams.bias = params->bias;
+ cParams.expand = params->expand;
+ cParams.spotMin = params->spotMin;
+ cParams.spotMax = params->spotMax;
+
+ cParams.grid = params->grid;
+ cParams.tex = params->tex;
+ cParams.colorArray = params->colorArray;
+
+ memcpy(cParams.shadowTaps, params->shadowTaps, sizeof(cParams.shadowTaps));
+
+ memcpy(mappedResource.pData, &cParams, sizeof(MeshShaderConst));
+
+ m_deviceContext->Unmap(m_constantBuffer, 0u);
+ }
+ }
+
+ m_deviceContext->VSSetShader(m_meshVS, nullptr, 0u);
+ m_deviceContext->GSSetShader(nullptr, nullptr, 0u);
+
+ switch (params->renderStage)
+ {
+ case MESH_DRAW_SHADOW:
+ {
+ m_deviceContext->PSSetShader(m_meshPS_Shadow, nullptr, 0u);
+ break;
+ }
+ case MESH_DRAW_LIGHT:
+ {
+ m_deviceContext->PSSetShader(m_meshPS, nullptr, 0u);
+
+ ShadowMap* shadowMap = (ShadowMap*)params->shadowMap;
+ ID3D11ShaderResourceView* ppSRV[1] = { shadowMap->m_depthSrv.Get() };
+ m_deviceContext->PSSetShaderResources(0, 1, ppSRV);
+ ID3D11SamplerState* ppSS[1] = { shadowMap->m_linearSampler.Get() };
+ m_deviceContext->PSSetSamplers(0, 1, ppSS);
+ break;
+ }
+ default:
+ assert(false);
+ break;
+ }
+
+ m_deviceContext->IASetInputLayout(m_inputLayout);
+ m_deviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
+
+ m_deviceContext->VSSetConstantBuffers(0, 1, &m_constantBuffer);
+ m_deviceContext->PSSetConstantBuffers(0, 1, &m_constantBuffer);
+
+ ID3D11Buffer* vertexBuffers[4] =
+ {
+ mesh->positionBuffer,
+ mesh->normalBuffer,
+ mesh->texcoordBuffer,
+ mesh->colorBuffer,
+ };
+
+ unsigned int vertexBufferStrides[4] =
+ {
+ sizeof(Vec3),
+ sizeof(Vec3),
+ sizeof(Vec2),
+ sizeof(Vec4)
+ };
+
+ unsigned int vertexBufferOffsets[4] = { 0, 0, 0, 0 };
+
+ m_deviceContext->IASetVertexBuffers(0, 4, vertexBuffers, vertexBufferStrides, vertexBufferOffsets);
+ m_deviceContext->IASetIndexBuffer(mesh->indexBuffer, DXGI_FORMAT_R32_UINT, 0u);
+
+ float depthSign = DirectX::XMVectorGetW(params->projection.r[2]);
+ if (depthSign < 0.f)
+ {
+ m_deviceContext->RSSetState(m_rasterizerStateRH[params->renderMode][params->cullMode]);
+ }
+
+ m_deviceContext->DrawIndexed((UINT)mesh->mNumFaces*3, 0, 0);
+
+ if (depthSign < 0.f)
+ {
+ m_deviceContext->RSSetState(nullptr);
+ }
+}
diff --git a/demo/d3d11/meshRender.h b/demo/d3d11/meshRender.h
new file mode 100644
index 0000000..01ad181
--- /dev/null
+++ b/demo/d3d11/meshRender.h
@@ -0,0 +1,297 @@
+
+/*
+ * 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
+
+#include <DirectXMath.h>
+
+#include "appD3D11Ctx.h"
+
+#include "core/maths.h"
+
+struct ShadowMap;
+
+struct GpuMesh
+{
+ ID3D11Buffer* positionBuffer;
+ ID3D11Buffer* normalBuffer;
+ ID3D11Buffer* texcoordBuffer;
+ ID3D11Buffer* colorBuffer;
+
+ ID3D11Buffer* indexBuffer;
+
+ GpuMesh(ID3D11Device* device, ID3D11DeviceContext* deviceContext)
+ : positionBuffer(NULL)
+ , normalBuffer(NULL)
+ , texcoordBuffer(NULL)
+ , colorBuffer(NULL)
+ , indexBuffer(NULL)
+ , mDevice(device)
+ , mDeviceContext(deviceContext)
+ , mNumFaces(0)
+ , mNumVertices(0)
+ {}
+
+ ~GpuMesh()
+ {
+ Release();
+ }
+
+ void Release()
+ {
+ COMRelease(positionBuffer);
+ COMRelease(normalBuffer);
+ COMRelease(texcoordBuffer);
+ COMRelease(colorBuffer);
+ COMRelease(indexBuffer);
+ }
+
+ void Resize(int numVertices, int numFaces)
+ {
+ Release();
+
+ {
+ // vertex buffers
+ D3D11_BUFFER_DESC bufDesc;
+ bufDesc.ByteWidth = sizeof(Vec3)*numVertices;
+ bufDesc.Usage = D3D11_USAGE_DYNAMIC;
+ bufDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
+ bufDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
+ bufDesc.MiscFlags = 0;
+
+ mDevice->CreateBuffer(&bufDesc, NULL, &positionBuffer);
+ mDevice->CreateBuffer(&bufDesc, NULL, &normalBuffer);
+
+ bufDesc.ByteWidth = sizeof(Vec2)*numVertices;
+ mDevice->CreateBuffer(&bufDesc, NULL, &texcoordBuffer);
+
+ bufDesc.ByteWidth = sizeof(Vec4)*numVertices;
+ mDevice->CreateBuffer(&bufDesc, NULL, &colorBuffer);
+ }
+
+ {
+ // index buffer
+ D3D11_BUFFER_DESC bufDesc;
+ bufDesc.ByteWidth = sizeof(int)*numFaces*3;
+ bufDesc.Usage = D3D11_USAGE_DYNAMIC;
+ bufDesc.BindFlags = D3D11_BIND_INDEX_BUFFER;
+ bufDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
+ bufDesc.MiscFlags = 0;
+
+ mDevice->CreateBuffer(&bufDesc, NULL, &indexBuffer);
+ }
+
+ mMaxVertices = numVertices;
+ mMaxFaces = numFaces;
+ }
+
+ void UpdateData(const Vec3* positions, const Vec3* normals, const Vec2* texcoords, const Vec4* colors, const int* indices, int numVertices, int numFaces)
+ {
+ if (numVertices > mMaxVertices || numFaces > mMaxFaces)
+ {
+ Resize(numVertices, numFaces);
+ }
+
+ D3D11_MAPPED_SUBRESOURCE res;
+
+ // vertices
+ if (positions)
+ {
+ mDeviceContext->Map(positionBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &res);
+ memcpy(res.pData, positions, sizeof(Vec3)*numVertices);
+ mDeviceContext->Unmap(positionBuffer, 0);
+ }
+
+ if (normals)
+ {
+ mDeviceContext->Map(normalBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &res);
+ memcpy(res.pData, normals, sizeof(Vec3)*numVertices);
+ mDeviceContext->Unmap(normalBuffer, 0);
+ }
+
+ if (texcoords)
+ {
+ mDeviceContext->Map(texcoordBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &res);
+ memcpy(res.pData, texcoords, sizeof(Vec2)*numVertices);
+ mDeviceContext->Unmap(texcoordBuffer, 0);
+ }
+
+ if (colors)
+ {
+ mDeviceContext->Map(colorBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &res);
+ memcpy(res.pData, colors, sizeof(Vec4)*numVertices);
+ mDeviceContext->Unmap(colorBuffer, 0);
+ }
+
+ // indices
+ if (indices)
+ {
+ mDeviceContext->Map(indexBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &res);
+ memcpy(res.pData, indices, sizeof(int)*numFaces*3);
+ mDeviceContext->Unmap(indexBuffer, 0);
+ }
+
+ mNumVertices = numVertices;
+ mNumFaces = numFaces;
+ }
+
+ // duplicate method to handle conversion from vec4 to vec3 positions / normals
+ void UpdateData(const Vec4* positions, const Vec4* normals, const Vec2* texcoords, const Vec4* colors, const int* indices, int numVertices, int numFaces)
+ {
+ if (numVertices > mMaxVertices || numFaces > mMaxFaces)
+ {
+ Resize(numVertices, numFaces);
+ }
+
+ D3D11_MAPPED_SUBRESOURCE res;
+
+ // vertices
+ if (positions)
+ {
+ mDeviceContext->Map(positionBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &res);
+ for (int i=0; i < numVertices; ++i)
+ ((Vec3*)res.pData)[i] = Vec3(positions[i]);
+ mDeviceContext->Unmap(positionBuffer, 0);
+ }
+
+ if (normals)
+ {
+ mDeviceContext->Map(normalBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &res);
+ for (int i=0; i < numVertices; ++i)
+ ((Vec3*)res.pData)[i] = Vec3(normals[i]);
+ mDeviceContext->Unmap(normalBuffer, 0);
+ }
+
+ if (texcoords)
+ {
+ mDeviceContext->Map(texcoordBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &res);
+ memcpy(res.pData, texcoords, sizeof(Vec2)*numVertices);
+ mDeviceContext->Unmap(texcoordBuffer, 0);
+ }
+
+ if (colors)
+ {
+ mDeviceContext->Map(colorBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &res);
+ memcpy(res.pData, colors, sizeof(Vec4)*numVertices);
+ mDeviceContext->Unmap(colorBuffer, 0);
+ }
+
+ // indices
+ if (indices)
+ {
+ mDeviceContext->Map(indexBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &res);
+ memcpy(res.pData, indices, sizeof(int)*numFaces*3);
+ mDeviceContext->Unmap(indexBuffer, 0);
+ }
+
+ mNumVertices = numVertices;
+ mNumFaces = numFaces;
+ }
+
+ int mNumVertices = 0;
+ int mNumFaces = 0;
+
+ int mMaxVertices = 0;
+ int mMaxFaces = 0;
+
+ ID3D11Device* mDevice;
+ ID3D11DeviceContext* mDeviceContext;
+};
+
+
+
+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
+};
+
+typedef DirectX::XMFLOAT3 float3;
+typedef DirectX::XMFLOAT4 float4;
+typedef DirectX::XMFLOAT4X4 float4x4;
+
+struct MeshDrawParams
+{
+ 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];
+ ShadowMap* shadowMap;
+};
+
+struct MeshRenderer
+{
+ ID3D11Device* m_device = nullptr;
+ ID3D11DeviceContext* m_deviceContext = nullptr;
+
+ ID3D11InputLayout* m_inputLayout = nullptr;
+ ID3D11VertexShader* m_meshVS = nullptr;
+ ID3D11PixelShader* m_meshPS = nullptr;
+ ID3D11PixelShader* m_meshPS_Shadow = nullptr;
+ ID3D11Buffer* m_constantBuffer = nullptr;
+ ID3D11RasterizerState* m_rasterizerStateRH[NUM_MESH_RENDER_MODES][NUM_MESH_CULL_MODES];
+
+ ~MeshRenderer()
+ {
+ Destroy();
+ }
+
+ void Init(ID3D11Device* device, ID3D11DeviceContext* context);
+ void Destroy();
+
+ void Draw(const GpuMesh* mesh, const MeshDrawParams* params);
+
+};
+
+
+
diff --git a/demo/d3d11/pointRender.cpp b/demo/d3d11/pointRender.cpp
new file mode 100644
index 0000000..1d3a8b0
--- /dev/null
+++ b/demo/d3d11/pointRender.cpp
@@ -0,0 +1,206 @@
+/*
+ * 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.
+ */
+
+//direct3d headers
+
+#define NOMINMAX
+
+#include <d3d11.h>
+
+// include the Direct3D Library file
+#pragma comment (lib, "d3d11.lib")
+
+#include <math.h>
+
+#include "appD3D11Ctx.h"
+
+#include "pointRender.h"
+
+#include "shaders/pointVS.hlsl.h"
+#include "shaders/pointGS.hlsl.h"
+#include "shaders/pointPS.hlsl.h"
+
+#define EXCLUDE_SHADER_STRUCTS 1
+#include "shaders/shaderCommon.h"
+
+
+void PointRenderer::Init(ID3D11Device* device, ID3D11DeviceContext* context)
+{
+ m_device = device;
+ m_deviceContext = context;
+
+ // create the input layout
+ {
+ D3D11_INPUT_ELEMENT_DESC inputElementDescs[] =
+ {
+ { "POSITION", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ { "DENSITY", 0, DXGI_FORMAT_R32_FLOAT, 1, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ { "PHASE", 0, DXGI_FORMAT_R32_SINT, 2, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ };
+
+ m_device->CreateInputLayout(inputElementDescs, 3, g_pointVS, sizeof(g_pointVS), &m_inputLayout);
+ }
+
+ // create the shaders
+ m_device->CreateVertexShader(g_pointVS, sizeof(g_pointVS), nullptr, &m_pointVS);
+ m_device->CreateGeometryShader(g_pointGS, sizeof(g_pointGS), nullptr, &m_pointGS);
+ m_device->CreatePixelShader(g_pointPS, sizeof(g_pointPS), nullptr, &m_pointPS);
+
+ // create a constant buffer
+ {
+ D3D11_BUFFER_DESC bufDesc;
+ bufDesc.ByteWidth = sizeof(PointShaderConst); // 64 * sizeof(float);
+ bufDesc.Usage = D3D11_USAGE_DYNAMIC;
+ bufDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
+ bufDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
+ bufDesc.MiscFlags = 0;
+
+ m_device->CreateBuffer(&bufDesc, nullptr, &m_constantBuffer);
+ }
+
+ // create the rastersizer state
+ for (int i = 0; i < NUM_POINT_RENDER_MODES; i++)
+ {
+ for (int j = 0; j < NUM_POINT_CULL_MODES; j++)
+
+ {
+ D3D11_RASTERIZER_DESC desc = {};
+ desc.FillMode = (D3D11_FILL_MODE)(D3D11_FILL_WIREFRAME + i);
+ desc.CullMode = (D3D11_CULL_MODE)(D3D11_CULL_NONE + j);
+ desc.FrontCounterClockwise = TRUE; // This is non-default
+ desc.DepthBias = 0;
+ desc.DepthBiasClamp = 0.f;
+ desc.SlopeScaledDepthBias = 0.f;
+ desc.DepthClipEnable = TRUE;
+ desc.ScissorEnable = FALSE;
+ desc.MultisampleEnable = FALSE;
+ desc.AntialiasedLineEnable = FALSE;
+
+ m_device->CreateRasterizerState(&desc, &m_rasterizerStateRH[i][j]);
+ }
+ }
+}
+
+void PointRenderer::Destroy()
+{
+ COMRelease(m_inputLayout);
+ COMRelease(m_pointVS);
+ COMRelease(m_pointGS);
+ COMRelease(m_pointPS);
+ COMRelease(m_constantBuffer);
+
+ for (int i = 0; i < NUM_POINT_RENDER_MODES; i++)
+ for (int j = 0; j < NUM_POINT_CULL_MODES; j++)
+ COMRelease(m_rasterizerStateRH[i][j]);
+}
+
+
+
+void PointRenderer::Draw(const PointDrawParams* params, ID3D11Buffer* positions, ID3D11Buffer* colors, ID3D11Buffer* indices, int numParticles, int offset)
+{
+ using namespace DirectX;
+
+ ID3D11DeviceContext* deviceContext = m_deviceContext;
+
+ // update constant buffer
+ {
+ D3D11_MAPPED_SUBRESOURCE mappedResource = {};
+ if (S_OK == deviceContext->Map(m_constantBuffer, 0u, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource))
+ {
+ PointShaderConst cParams;
+
+ cParams.modelview = (float4x4&)XMMatrixMultiply(params->model, params->view);
+ cParams.projection = (float4x4&)params->projection;
+
+ cParams.pointRadius = params->pointRadius;
+ cParams.pointScale = params->pointScale;
+ cParams.spotMin = params->spotMin;
+ cParams.spotMax = params->spotMax;
+
+ cParams.lightTransform = (float4x4&)params->lightTransform;
+ cParams.lightPos = params->lightPos;
+ cParams.lightDir = params->lightDir;
+
+ for (int i = 0; i < 8; i++)
+ cParams.colors[i] = params->colors[i];
+
+ memcpy(cParams.shadowTaps, params->shadowTaps, sizeof(cParams.shadowTaps));
+
+ cParams.mode = params->mode;
+
+ memcpy(mappedResource.pData, &cParams, sizeof(PointShaderConst));
+
+ deviceContext->Unmap(m_constantBuffer, 0u);
+ }
+ }
+
+ deviceContext->VSSetShader(m_pointVS, nullptr, 0u);
+ deviceContext->GSSetShader(m_pointGS, nullptr, 0u);
+ deviceContext->PSSetShader(m_pointPS, nullptr, 0u);
+
+ if (params->shadowMap)
+ {
+ ShadowMap* shadowMap = (ShadowMap*)params->shadowMap;
+ if (params->renderStage == POINT_DRAW_SHADOW)
+ {
+ ID3D11ShaderResourceView* ppSRV[1] = { nullptr };
+ deviceContext->PSSetShaderResources(0, 1, ppSRV);
+ ID3D11SamplerState* ppSS[1] = { shadowMap->m_linearSampler.Get() };
+ deviceContext->PSSetSamplers(0, 1, ppSS);
+ }
+ else
+ {
+ ID3D11ShaderResourceView* ppSRV[1] = { shadowMap->m_depthSrv.Get() };
+ deviceContext->PSSetShaderResources(0, 1, ppSRV);
+ ID3D11SamplerState* ppSS[1] = { shadowMap->m_linearSampler.Get() };
+ deviceContext->PSSetSamplers(0, 1, ppSS);
+ }
+ }
+
+ deviceContext->IASetInputLayout(m_inputLayout);
+ deviceContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_POINTLIST);
+
+ deviceContext->VSSetConstantBuffers(0, 1, &m_constantBuffer);
+ deviceContext->GSSetConstantBuffers(0, 1, &m_constantBuffer);
+ deviceContext->PSSetConstantBuffers(0, 1, &m_constantBuffer);
+
+ ID3D11Buffer* vertexBuffers[3] =
+ {
+ positions,
+ colors, // will be interpreted as density
+ colors, // will be interpreted as phase
+ };
+
+ unsigned int vertexBufferStrides[3] =
+ {
+ sizeof(float4),
+ sizeof(float),
+ sizeof(int)
+ };
+
+ unsigned int vertexBufferOffsets[3] = { 0 };
+
+ deviceContext->IASetVertexBuffers(0, 3, vertexBuffers, vertexBufferStrides, vertexBufferOffsets);
+ deviceContext->IASetIndexBuffer(indices, DXGI_FORMAT_R32_UINT, 0u);
+
+
+ float depthSign = DirectX::XMVectorGetW(params->projection.r[2]);
+ if (depthSign < 0.f)
+ {
+ deviceContext->RSSetState(m_rasterizerStateRH[params->renderMode][params->cullMode]);
+ }
+
+ deviceContext->DrawIndexed(numParticles, offset, 0);
+
+ if (depthSign < 0.f)
+ {
+ deviceContext->RSSetState(nullptr);
+ }
+}
diff --git a/demo/d3d11/pointRender.h b/demo/d3d11/pointRender.h
new file mode 100644
index 0000000..9631287
--- /dev/null
+++ b/demo/d3d11/pointRender.h
@@ -0,0 +1,88 @@
+/*
+ * 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
+
+#include <DirectXMath.h>
+
+#include "shadowMap.h"
+
+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
+};
+
+typedef DirectX::XMFLOAT3 float3;
+typedef DirectX::XMFLOAT4 float4;
+typedef DirectX::XMFLOAT4X4 float4x4;
+
+struct PointDrawParams
+{
+ 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];
+ ShadowMap* shadowMap;
+
+ int mode;
+};
+
+
+struct PointRenderer
+{
+ ID3D11Device* m_device = nullptr;
+ ID3D11DeviceContext* m_deviceContext = nullptr;
+
+ ID3D11InputLayout* m_inputLayout = nullptr;
+ ID3D11VertexShader* m_pointVS = nullptr;
+ ID3D11GeometryShader* m_pointGS = nullptr;
+ ID3D11PixelShader* m_pointPS = nullptr;
+ ID3D11Buffer* m_constantBuffer = nullptr;
+ ID3D11RasterizerState* m_rasterizerStateRH[NUM_POINT_RENDER_MODES][NUM_POINT_CULL_MODES];
+
+ void Init(ID3D11Device* device, ID3D11DeviceContext* deviceContext);
+ void Destroy();
+
+ void Draw(const PointDrawParams* params, ID3D11Buffer* positions, ID3D11Buffer* colors, ID3D11Buffer* indices, int numParticles, int offset);
+};
diff --git a/demo/d3d11/renderTarget.cpp b/demo/d3d11/renderTarget.cpp
new file mode 100644
index 0000000..da71e4f
--- /dev/null
+++ b/demo/d3d11/renderTarget.cpp
@@ -0,0 +1,146 @@
+/*
+ * 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 "renderTarget.h"
+
+RenderTarget::RenderTarget()
+{
+}
+
+static D3D11_TEXTURE2D_DESC _getTextureDesc(DXGI_FORMAT format, UINT width, UINT height,
+ UINT bindFlags, UINT sampleCount = 1, D3D11_USAGE usage = D3D11_USAGE_DEFAULT, UINT cpuAccessFlags = 0,
+ UINT miscFlags = 0, UINT arraySize = 1, UINT mipLevels = 1)
+{
+ D3D11_TEXTURE2D_DESC desc;
+ desc.Format = format;
+ desc.Width = width;
+ desc.Height = height;
+
+ desc.ArraySize = arraySize;
+ desc.MiscFlags = miscFlags;
+ desc.MipLevels = mipLevels;
+
+ desc.SampleDesc.Count = sampleCount;
+ desc.SampleDesc.Quality = 0;
+ desc.BindFlags = bindFlags;
+ desc.Usage = usage;
+ desc.CPUAccessFlags = cpuAccessFlags;
+ return desc;
+}
+
+static D3D11_DEPTH_STENCIL_VIEW_DESC _getDsvDesc(DXGI_FORMAT format, D3D11_DSV_DIMENSION viewDimension, UINT flags = 0, UINT mipSlice = 0)
+{
+ D3D11_DEPTH_STENCIL_VIEW_DESC desc;
+ desc.Format = format;
+ desc.ViewDimension = viewDimension;
+ desc.Flags = flags;
+ desc.Texture2D.MipSlice = mipSlice;
+ return desc;
+}
+
+static D3D11_SHADER_RESOURCE_VIEW_DESC _getSrvDesc(DXGI_FORMAT format)
+{
+ D3D11_SHADER_RESOURCE_VIEW_DESC desc;
+ desc.Format = format;
+ desc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
+ desc.Texture2D.MostDetailedMip = 0;
+ desc.Texture2D.MipLevels = -1;
+
+ return desc;
+}
+
+HRESULT RenderTarget::Init(ID3D11Device* device, int width, int height, bool depthTest)
+{
+ // set viewport
+ {
+ m_viewport.Width = float(width);
+ m_viewport.Height = float(height);
+ m_viewport.MinDepth = 0;
+ m_viewport.MaxDepth = 1;
+ m_viewport.TopLeftX = 0;
+ m_viewport.TopLeftY = 0;
+ }
+
+ // create shadow render target
+ {
+ D3D11_TEXTURE2D_DESC texDesc = _getTextureDesc(DXGI_FORMAT_R32_FLOAT, UINT(width), UINT(height),
+ D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE);
+
+ NV_RETURN_ON_FAIL(device->CreateTexture2D(&texDesc, NV_NULL, m_backTexture.ReleaseAndGetAddressOf()));
+ NV_RETURN_ON_FAIL(device->CreateShaderResourceView(m_backTexture.Get(), NV_NULL, m_backSrv.ReleaseAndGetAddressOf()));
+ NV_RETURN_ON_FAIL(device->CreateRenderTargetView(m_backTexture.Get(), NV_NULL, m_backRtv.ReleaseAndGetAddressOf()));
+ }
+
+ // create shadow depth stencil
+ {
+ D3D11_TEXTURE2D_DESC texDesc = _getTextureDesc(DXGI_FORMAT_R32_TYPELESS, UINT(width), UINT(height),
+ D3D11_BIND_DEPTH_STENCIL | D3D11_BIND_SHADER_RESOURCE);
+ NV_RETURN_ON_FAIL(device->CreateTexture2D(&texDesc, NV_NULL, m_depthTexture.ReleaseAndGetAddressOf()));
+
+ D3D11_DEPTH_STENCIL_VIEW_DESC dsvDesc = _getDsvDesc(DXGI_FORMAT_D32_FLOAT, D3D11_DSV_DIMENSION_TEXTURE2D);
+ NV_RETURN_ON_FAIL(device->CreateDepthStencilView(m_depthTexture.Get(), &dsvDesc, m_depthDsv.ReleaseAndGetAddressOf()));
+
+ D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc = _getSrvDesc(DXGI_FORMAT_R32_FLOAT);
+ NV_RETURN_ON_FAIL(device->CreateShaderResourceView(m_depthTexture.Get(), &srvDesc, m_depthSrv.ReleaseAndGetAddressOf()));
+ }
+
+ {
+ D3D11_SAMPLER_DESC samplerDesc =
+ {
+ D3D11_FILTER_MIN_MAG_MIP_LINEAR,
+ D3D11_TEXTURE_ADDRESS_CLAMP,
+ D3D11_TEXTURE_ADDRESS_CLAMP,
+ D3D11_TEXTURE_ADDRESS_CLAMP,
+ 0.0, 0, D3D11_COMPARISON_NEVER,
+ 0.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, D3D11_FLOAT32_MAX,
+ };
+ NV_RETURN_ON_FAIL(device->CreateSamplerState(&samplerDesc, m_linearSampler.ReleaseAndGetAddressOf()));
+ }
+ {
+ D3D11_SAMPLER_DESC samplerDesc =
+ {
+ D3D11_FILTER_MIN_MAG_MIP_POINT,
+ D3D11_TEXTURE_ADDRESS_CLAMP,
+ D3D11_TEXTURE_ADDRESS_CLAMP,
+ D3D11_TEXTURE_ADDRESS_CLAMP,
+ 0.0, 0, D3D11_COMPARISON_NEVER,
+ 0.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, D3D11_FLOAT32_MAX,
+ };
+ NV_RETURN_ON_FAIL(device->CreateSamplerState(&samplerDesc, m_pointSampler.ReleaseAndGetAddressOf()));
+ }
+
+ {
+ D3D11_DEPTH_STENCIL_DESC depthStateDesc = {};
+ depthStateDesc.DepthEnable = depthTest;
+ depthStateDesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL;
+ depthStateDesc.DepthFunc = D3D11_COMPARISON_LESS_EQUAL;
+
+ NV_RETURN_ON_FAIL(device->CreateDepthStencilState(&depthStateDesc, m_depthStencilState.ReleaseAndGetAddressOf()));
+ }
+
+ return S_OK;
+}
+
+void RenderTarget::BindAndClear(ID3D11DeviceContext* context)
+{
+ ID3D11RenderTargetView* ppRtv[1] = { m_backRtv.Get() };
+ context->OMSetRenderTargets(1, ppRtv, m_depthDsv.Get());
+ context->OMSetDepthStencilState(m_depthStencilState.Get(), 0u);
+
+ context->RSSetViewports(1, &m_viewport);
+
+ float clearDepth = 0.0f;
+ float clearColor[4] = { clearDepth, clearDepth, clearDepth, clearDepth };
+
+ context->ClearRenderTargetView(m_backRtv.Get(), clearColor);
+ context->ClearDepthStencilView(m_depthDsv.Get(), D3D11_CLEAR_DEPTH, 1.0, 0);
+}
diff --git a/demo/d3d11/renderTarget.h b/demo/d3d11/renderTarget.h
new file mode 100644
index 0000000..ae5ff40
--- /dev/null
+++ b/demo/d3d11/renderTarget.h
@@ -0,0 +1,51 @@
+/*
+ * 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
+
+#include <d3d11.h>
+#include <DirectXMath.h>
+#include <wrl.h>
+
+using namespace DirectX;
+using namespace Microsoft::WRL;
+
+#define NV_NULL nullptr
+#define NV_RETURN_ON_FAIL(x) { HRESULT _res = (x); if (FAILED(_res)) { return _res; } }
+
+struct RenderTarget
+{
+public:
+
+ RenderTarget();
+
+ HRESULT Init(ID3D11Device* device, int width, int height, bool depthTest = true);
+
+ void BindAndClear(ID3D11DeviceContext* context);
+
+ XMMATRIX m_lightView;
+ XMMATRIX m_lightProjection;
+ XMMATRIX m_lightWorldToTex;
+
+ ComPtr<ID3D11Texture2D> m_backTexture;
+ ComPtr<ID3D11RenderTargetView> m_backRtv;
+ ComPtr<ID3D11ShaderResourceView> m_backSrv;
+
+ ComPtr<ID3D11Texture2D> m_depthTexture;
+ ComPtr<ID3D11DepthStencilView> m_depthDsv;
+ ComPtr<ID3D11ShaderResourceView> m_depthSrv;
+
+ ComPtr<ID3D11SamplerState> m_linearSampler;
+ ComPtr<ID3D11SamplerState> m_pointSampler;
+
+ ComPtr<ID3D11DepthStencilState> m_depthStencilState;
+
+ D3D11_VIEWPORT m_viewport;
+};
diff --git a/demo/d3d11/shaders/blurDepthPS.hlsl b/demo/d3d11/shaders/blurDepthPS.hlsl
new file mode 100644
index 0000000..a2eee0a
--- /dev/null
+++ b/demo/d3d11/shaders/blurDepthPS.hlsl
@@ -0,0 +1,91 @@
+#include "shaderCommon.h"
+
+cbuffer constBuf : register(b0)
+{
+ FluidShaderConst gParams;
+};
+
+Texture2D<float> depthTex : register(t0);
+
+float sqr(float x) { return x*x; }
+
+float4 blurDepthPS(PassthroughVertexOut input) : SV_TARGET
+{
+ float4 gl_FragColor = float4(0.0, 0.0, 0.0, 0.0);
+ float4 gl_FragCoord = input.position;
+
+ // debug: return the center depth sample
+ //float d = depthTex.Load(int3(gl_FragCoord.xy, 0)).x;
+ //return d;
+
+ 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(gl_FragCoord.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)
+ {
+ gl_FragColor.x = 0.0;
+ return gl_FragColor;
+ }
+ */
+
+ 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 = texture2DRect(depthTex, gl_FragCoord.xy + offset).x;
+ float sample = depthTex.Load(int3(gl_FragCoord.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);
+ gl_FragColor.x = lerp(depth, sum, blend);
+
+ return gl_FragColor;
+}
diff --git a/demo/d3d11/shaders/blurDepthPS.hlsl.h b/demo/d3d11/shaders/blurDepthPS.hlsl.h
new file mode 100644
index 0000000..ff191f8
--- /dev/null
+++ b/demo/d3d11/shaders/blurDepthPS.hlsl.h
@@ -0,0 +1,664 @@
+#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 modelview_inverse; // Offset: 192
+// float4x4 projection_inverse; // 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 xyzw 0 TARGET float xyzw
+//
+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.xyzw
+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
+mov o0.yzw, l(0,0,0,0)
+ret
+// Approximately 60 instruction slots used
+#endif
+
+const BYTE g_blurDepthPS[] =
+{
+ 68, 88, 66, 67, 244, 233,
+ 190, 43, 161, 207, 241, 98,
+ 173, 248, 128, 15, 40, 190,
+ 66, 70, 1, 0, 0, 0,
+ 76, 12, 0, 0, 5, 0,
+ 0, 0, 52, 0, 0, 0,
+ 156, 4, 0, 0, 244, 4,
+ 0, 0, 40, 5, 0, 0,
+ 176, 11, 0, 0, 82, 68,
+ 69, 70, 96, 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,
+ 44, 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, 8, 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, 118, 105,
+ 101, 119, 112, 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, 118,
+ 105, 101, 119, 0, 112, 114,
+ 111, 106, 101, 99, 116, 105,
+ 111, 110, 0, 109, 111, 100,
+ 101, 108, 118, 105, 101, 119,
+ 95, 105, 110, 118, 101, 114,
+ 115, 101, 0, 112, 114, 111,
+ 106, 101, 99, 116, 105, 111,
+ 110, 95, 105, 110, 118, 101,
+ 114, 115, 101, 0, 105, 110,
+ 118, 84, 101, 120, 83, 99,
+ 97, 108, 101, 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, 114, 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,
+ 172, 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,
+ 222, 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,
+ 52, 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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 143, 2, 0, 0, 124, 1,
+ 0, 0, 224, 1, 0, 0,
+ 156, 2, 0, 0, 228, 1,
+ 0, 0, 240, 1, 0, 0,
+ 164, 2, 0, 0, 228, 1,
+ 0, 0, 244, 1, 0, 0,
+ 172, 2, 0, 0, 228, 1,
+ 0, 0, 248, 1, 0, 0,
+ 176, 2, 0, 0, 228, 1,
+ 0, 0, 252, 1, 0, 0,
+ 182, 2, 0, 0, 196, 2,
+ 0, 0, 0, 2, 0, 0,
+ 5, 0, 0, 0, 1, 0,
+ 176, 0, 0, 0, 24, 0,
+ 232, 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, 15, 0, 0, 0,
+ 83, 86, 95, 84, 65, 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0, 0, 0, 0,
+ 0, 0, 0, 0, 9, 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/d3d11/shaders/compositePS.hlsl b/demo/d3d11/shaders/compositePS.hlsl
new file mode 100644
index 0000000..b082aa6
--- /dev/null
+++ b/demo/d3d11/shaders/compositePS.hlsl
@@ -0,0 +1,194 @@
+#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.SampleCmpLevelZero(shadowSampler, uvw.xy + shadowTaps * radius, uvw.z);
+
+ //s += shadow2D(shadowTex, vec3(uvw.xy + shadowTaps[i] * radius, uvw.z)).r;
+ }
+
+ 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 gl_FragDepth : SV_DEPTH
+) : SV_TARGET
+{
+
+ float4 gl_FragColor;
+
+ const float4x4 gl_ProjectionMatrix = gParams.projection;
+ const float4x4 gl_ModelViewMatrix = gParams.modelview;
+ const float4x4 gl_ModelViewMatrixInverse = gParams.modelview_inverse;
+
+ 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[0].x, 1.0f-input.texCoord[0].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(gl_ModelViewMatrixInverse, float4(eyePos, 1.0));
+
+ float attenuation;
+ float shadow = shadowSample(worldPos.xyz, attenuation);
+
+ float3 l = mul(gl_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(gl_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);
+
+ gl_FragColor.xyz = diffuse + (lerp(refract, reflect, fresnel) + specular)*color.w;
+ gl_FragColor.w = 1.0;
+
+ // visualize normals
+ //gl_FragColor = float4(n*0.5 + 0.5, 1.0);
+ //gl_FragColor.xyz = float3(fresnel, fresnel, fresnel);
+ //gl_FragColor.xyz = n;
+
+ // write valid z
+ float4 clipPos = mul(gl_ProjectionMatrix, float4(0.0, 0.0, eyeZ, 1.0));
+ clipPos.z /= clipPos.w;
+ gl_FragDepth = clipPos.z;
+
+ return gl_FragColor;
+
+}
diff --git a/demo/d3d11/shaders/compositePS.hlsl.h b/demo/d3d11/shaders/compositePS.hlsl.h
new file mode 100644
index 0000000..77d3814
--- /dev/null
+++ b/demo/d3d11/shaders/compositePS.hlsl.h
@@ -0,0 +1,1643 @@
+#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 modelview_inverse; // Offset: 192
+// float4x4 projection_inverse; // 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
+if_z r0.z
+ lt r0.z, r5.y, l(0.000000)
+ lt r0.w, l(1.000000), r5.y
+ or r0.z, r0.w, r0.z
+ if_z r0.z
+ add r0.z, -cb0[32].y, l(1.000000)
+ mul r6.x, cb0[32].x, l(0.002000)
+ mul r6.y, r0.z, l(0.002000)
+ add r5.w, -r5.y, l(1.000000)
+ add r0.zw, r5.xxxw, r6.xxxy
+ sample_c_lz_indexable(texture2d)(float,float,float,float) r0.z, r0.zwzz, t2.xxxx, s1, r5.z
+ add r0.w, -cb0[33].y, l(1.000000)
+ mul r6.x, cb0[33].x, l(0.002000)
+ mul r6.y, r0.w, l(0.002000)
+ add r4.xz, r5.xxwx, r6.xxyx
+ sample_c_lz_indexable(texture2d)(float,float,float,float) r0.w, r4.xzxx, t2.xxxx, s1, r5.z
+ add r0.z, r0.w, r0.z
+ add r0.w, -cb0[34].y, l(1.000000)
+ mul r6.x, cb0[34].x, l(0.002000)
+ mul r6.y, r0.w, l(0.002000)
+ add r4.xz, r5.xxwx, r6.xxyx
+ sample_c_lz_indexable(texture2d)(float,float,float,float) r0.w, r4.xzxx, t2.xxxx, s1, r5.z
+ add r0.z, r0.w, r0.z
+ add r0.w, -cb0[35].y, l(1.000000)
+ mul r6.x, cb0[35].x, l(0.002000)
+ mul r6.y, r0.w, l(0.002000)
+ add r4.xz, r5.xxwx, r6.xxyx
+ sample_c_lz_indexable(texture2d)(float,float,float,float) r0.w, r4.xzxx, t2.xxxx, s1, r5.z
+ add r0.z, r0.w, r0.z
+ add r0.w, -cb0[36].y, l(1.000000)
+ mul r6.x, cb0[36].x, l(0.002000)
+ mul r6.y, r0.w, l(0.002000)
+ add r4.xz, r5.xxwx, r6.xxyx
+ sample_c_lz_indexable(texture2d)(float,float,float,float) r0.w, r4.xzxx, t2.xxxx, s1, r5.z
+ add r0.z, r0.w, r0.z
+ add r0.w, -cb0[37].y, l(1.000000)
+ mul r6.x, cb0[37].x, l(0.002000)
+ mul r6.y, r0.w, l(0.002000)
+ add r4.xz, r5.xxwx, r6.xxyx
+ sample_c_lz_indexable(texture2d)(float,float,float,float) r0.w, r4.xzxx, t2.xxxx, s1, r5.z
+ add r0.z, r0.w, r0.z
+ add r0.w, -cb0[38].y, l(1.000000)
+ mul r6.x, cb0[38].x, l(0.002000)
+ mul r6.y, r0.w, l(0.002000)
+ add r4.xz, r5.xxwx, r6.xxyx
+ sample_c_lz_indexable(texture2d)(float,float,float,float) r0.w, r4.xzxx, t2.xxxx, s1, r5.z
+ add r0.z, r0.w, r0.z
+ add r0.w, -cb0[39].y, l(1.000000)
+ mul r6.x, cb0[39].x, l(0.002000)
+ mul r6.y, r0.w, l(0.002000)
+ add r4.xz, r5.xxwx, r6.xxyx
+ sample_c_lz_indexable(texture2d)(float,float,float,float) r0.w, r4.xzxx, t2.xxxx, s1, r5.z
+ add r0.z, r0.w, 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 r2.xyz, -r4.xyzx, r6.xyzx, r3.xyzx
+mad r2.xyz, r0.wwww, r2.xyzx, r7.xyzx
+mad r1.xyw, r1.xxxx, l(1.200000, 1.200000, 0.000000, 1.200000), r2.xyxz
+mul r1.xyw, r1.xyxw, cb0[29].wwww
+mad o0.xyz, r0.xyzx, r6.wwww, r1.xywx
+mad r0.xy, cb0[10].zwzz, r1.zzzz, cb0[11].zwzz
+div oDepth, r0.x, r0.y
+mov o0.w, l(1.000000)
+ret
+// Approximately 192 instruction slots used
+#endif
+
+const BYTE g_compositePS[] =
+{
+ 68, 88, 66, 67, 223, 79,
+ 142, 103, 26, 30, 227, 152,
+ 95, 75, 188, 26, 149, 14,
+ 233, 77, 1, 0, 0, 0,
+ 232, 31, 0, 0, 5, 0,
+ 0, 0, 52, 0, 0, 0,
+ 72, 5, 0, 0, 160, 5,
+ 0, 0, 244, 5, 0, 0,
+ 76, 31, 0, 0, 82, 68,
+ 69, 70, 12, 5, 0, 0,
+ 1, 0, 0, 0, 60, 1,
+ 0, 0, 6, 0, 0, 0,
+ 60, 0, 0, 0,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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, 180, 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, 118, 105, 101, 119,
+ 112, 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, 118, 105, 101,
+ 119, 0, 112, 114, 111, 106,
+ 101, 99, 116, 105, 111, 110,
+ 0, 109, 111, 100, 101, 108,
+ 118, 105, 101, 119, 95, 105,
+ 110, 118, 101, 114, 115, 101,
+ 0, 112, 114, 111, 106, 101,
+ 99, 116, 105, 111, 110, 95,
+ 105, 110, 118, 101, 114, 115,
+ 101, 0, 105, 110, 118, 84,
+ 101, 120, 83, 99, 97, 108,
+ 101, 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, 30, 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, 88, 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, 138, 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, 224, 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,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0, 0,
+ 252, 1, 0, 0, 98, 3,
+ 0, 0, 112, 3, 0, 0,
+ 0, 2, 0, 0, 5, 0,
+ 0, 0, 1, 0, 176, 0,
+ 0, 0, 24, 0, 148, 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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 0, 0, 0, 0, 0,
+ 26, 0, 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, 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/d3d11/shaders/debugLinePS.hlsl b/demo/d3d11/shaders/debugLinePS.hlsl
new file mode 100644
index 0000000..d01847b
--- /dev/null
+++ b/demo/d3d11/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/d3d11/shaders/debugLinePS.hlsl.h b/demo/d3d11/shaders/debugLinePS.hlsl.h
new file mode 100644
index 0000000..6243104
--- /dev/null
+++ b/demo/d3d11/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,
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, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 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/d3d11/shaders/debugLineVS.hlsl b/demo/d3d11/shaders/debugLineVS.hlsl
new file mode 100644
index 0000000..1033b35
--- /dev/null
+++ b/demo/d3d11/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/d3d11/shaders/debugLineVS.hlsl.h b/demo/d3d11/shaders/debugLineVS.hlsl.h
new file mode 100644
index 0000000..cdf7e4b
--- /dev/null
+++ b/demo/d3d11/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,
+ 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,
+ 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/d3d11/shaders/diffuseGS.hlsl b/demo/d3d11/shaders/diffuseGS.hlsl
new file mode 100644
index 0000000..e7a92db
--- /dev/null
+++ b/demo/d3d11/shaders/diffuseGS.hlsl
@@ -0,0 +1,176 @@
+#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 = float4(0.0, 1.0, 0.0, 0.0);
+ output.clipPos = mul(gParams.projection, float4(p + u - l, 1.0));
+ triStream.Append(output);
+
+ output.uv = float4(0.0, 0.0, 0.0, 0.0);
+ output.clipPos = mul(gParams.projection, float4(p - u - l, 1.0));
+ triStream.Append(output);
+
+ output.uv = float4(1.0, 1.0, 0.0, 0.0);
+ output.clipPos = mul(gParams.projection, float4(p + u + l, 1.0));
+ triStream.Append(output);
+
+ output.uv = float4(1.0, 0.0, 0.0, 0.0);
+ output.clipPos = mul(gParams.projection, float4(p - u + l, 1.0));
+ triStream.Append(output);
+ }
+
+}
+
+#if 0
+
+
+const char *geometryDiffuseShader =
+"#version 120\n"
+"#extension GL_EXT_geometry_shader4 : enable\n"
+STRINGIFY(
+
+uniform float pointScale; // point size in world space
+uniform float motionBlurScale;
+uniform float diffusion;
+uniform vec3 lightDir;
+
+void main()
+{
+ vec4 ndcPos = gl_TexCoordIn[0][5];
+
+ // 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 velocityScale = 1.0;
+
+ vec3 v = gl_TexCoordIn[0][3].xyz*velocityScale;
+ vec3 p = gl_TexCoordIn[0][2].xyz;
+
+ // billboard in eye space
+ vec3 u = vec3(0.0, pointScale, 0.0);
+ vec3 l = vec3(pointScale, 0.0, 0.0);
+
+ // increase size based on life
+ float lifeFade = mix(1.0f+diffusion, 1.0, min(1.0, gl_TexCoordIn[0][1].w*0.25f));
+ u *= lifeFade;
+ l *= lifeFade;
+
+ //lifeFade = 1.0;
+
+ float fade = 1.0/(lifeFade*lifeFade);
+ float vlen = length(v)*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, vec3(0.0, 0.0, -1.0)))*pointScale;
+ }
+
+ {
+
+ gl_TexCoord[1] = gl_TexCoordIn[0][1]; // vertex world pos (life in w)
+ gl_TexCoord[2] = gl_TexCoordIn[0][2]; // vertex eye pos
+ gl_TexCoord[3] = gl_TexCoordIn[0][3]; // vertex velocity in view space
+ gl_TexCoord[3].w = fade;
+ gl_TexCoord[4] = gl_ModelViewMatrix*vec4(lightDir, 0.0);
+ gl_TexCoord[4].w = gl_TexCoordIn[0][3].w; // attenuation
+ gl_TexCoord[5].xyzw = gl_TexCoordIn[0][4].xyzw; // color
+
+ float zbias = 0.0f;//0.00125*2.0;
+
+ gl_TexCoord[0] = vec4(0.0, 1.0, 0.0, 0.0);
+ gl_Position = gl_ProjectionMatrix * vec4(p + u - l, 1.0);
+ gl_Position.z -= zbias;
+ EmitVertex();
+
+ gl_TexCoord[0] = vec4(0.0, 0.0, 0.0, 0.0);
+ gl_Position = gl_ProjectionMatrix * vec4(p - u - l, 1.0);
+ gl_Position.z -= zbias;
+ EmitVertex();
+
+ gl_TexCoord[0] = vec4(1.0, 1.0, 0.0, 0.0);
+ gl_Position = gl_ProjectionMatrix * vec4(p + u + l, 1.0);
+ gl_Position.z -= zbias;
+ EmitVertex();
+
+ gl_TexCoord[0] = vec4(1.0, 0.0, 0.0, 0.0);
+ gl_Position = gl_ProjectionMatrix * vec4(p - u + l, 1.0);
+ gl_Position.z -= zbias;
+ EmitVertex();
+ }
+}
+);
+
+
+#endif \ No newline at end of file
diff --git a/demo/d3d11/shaders/diffuseGS.hlsl.h b/demo/d3d11/shaders/diffuseGS.hlsl.h
new file mode 100644
index 0000000..1f71735
--- /dev/null
+++ b/demo/d3d11/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 xyzw 6 NONE float xyzw
+//
+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.xyzw
+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.x, cb0[31].z
+mov r1.yz, l(0,0,0,0)
+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.xyzw, 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.xyzw, 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.xyzw, 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.xyzw, l(1.000000,0,0,0)
+emit_stream m0
+ret
+// Approximately 108 instruction slots used
+#endif
+
+const BYTE g_diffuseGS[] =
+{
+ 68, 88, 66, 67, 206, 113,
+ 108, 237, 96, 228, 115, 111,
+ 205, 11, 177, 210, 155, 123,
+ 232, 125, 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,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/shaders/diffusePS.hlsl b/demo/d3d11/shaders/diffusePS.hlsl
new file mode 100644
index 0000000..c6e474e
--- /dev/null
+++ b/demo/d3d11/shaders/diffusePS.hlsl
@@ -0,0 +1,37 @@
+#include "shaderCommon.h"
+
+cbuffer constBuf : register(b0)
+{
+ DiffuseShaderConst gParams;
+};
+
+float sqr(float x) { return x * x; }
+
+
+float4 diffusePS(DiffuseGeometryOut input
+ //, out float gl_FragDepth : SV_DEPTH
+) : SV_TARGET
+{
+ //return float4(1.0f, 0.0f, 0.0f, 1.0f);
+
+ 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;
+ normal.xy = input.uv.xy*float2(2.0, 2.0) + float2(-1.0, -1.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/d3d11/shaders/diffusePS.hlsl.h b/demo/d3d11/shaders/diffusePS.hlsl.h
new file mode 100644
index 0000000..b77dc1c
--- /dev/null
+++ b/demo/d3d11/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 xyzw 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, 142, 84,
+ 94, 27, 80, 231, 240, 136,
+ 237, 253, 148, 77, 42, 64,
+ 90, 183, 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,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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/d3d11/shaders/diffuseVS.hlsl.h b/demo/d3d11/shaders/diffuseVS.hlsl.h
new file mode 100644
index 0000000..7db0a8c
--- /dev/null
+++ b/demo/d3d11/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,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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/d3d11/shaders/ellipsoidDepthGS.hlsl b/demo/d3d11/shaders/ellipsoidDepthGS.hlsl
new file mode 100644
index 0000000..8c892e4
--- /dev/null
+++ b/demo/d3d11/shaders/ellipsoidDepthGS.hlsl
@@ -0,0 +1,127 @@
+#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)
+{
+ float4 gl_Position;
+ float4 gl_TexCoord[6];
+
+ float4 gl_PositionIn[1];
+ float4 gl_TexCoordIn[1][6];
+
+ gl_PositionIn[0] = input[0].position;
+ {
+ [unroll]
+ for (int i = 0; i < 6; i++)
+ gl_TexCoordIn[0][i] = input[0].texCoord[i];
+ }
+
+ float3 pos = gl_PositionIn[0].xyz;
+ float4 bounds = gl_TexCoordIn[0][0];
+ float4 ndcPos = gl_TexCoordIn[0][5];
+
+ if (ndcPos.w < 0.0)
+ return;
+
+ // 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 xmin = bounds.x;
+ float xmax = bounds.y;
+ float ymin = bounds.z;
+ float ymax = bounds.w;
+
+
+ // inv quadric transform
+ gl_TexCoord[0] = gl_TexCoordIn[0][1];
+ gl_TexCoord[1] = gl_TexCoordIn[0][2];
+ gl_TexCoord[2] = gl_TexCoordIn[0][3];
+ gl_TexCoord[3] = gl_TexCoordIn[0][4];
+
+ FluidGeoOut output;
+
+ gl_Position = float4(xmin, ymax, 0.5, 1.0);
+ output.position = gl_Position;
+ output.texCoord[0] = gl_TexCoord[0];
+ output.texCoord[1] = gl_TexCoord[1];
+ output.texCoord[2] = gl_TexCoord[2];
+ output.texCoord[3] = gl_TexCoord[3];
+ triStream.Append(output);
+
+ gl_Position = float4(xmin, ymin, 0.5, 1.0);
+ output.position = gl_Position;
+ output.texCoord[0] = gl_TexCoord[0];
+ output.texCoord[1] = gl_TexCoord[1];
+ output.texCoord[2] = gl_TexCoord[2];
+ output.texCoord[3] = gl_TexCoord[3];
+ triStream.Append(output);
+
+ gl_Position = float4(xmax, ymax, 0.5, 1.0);
+ output.position = gl_Position;
+ output.texCoord[0] = gl_TexCoord[0];
+ output.texCoord[1] = gl_TexCoord[1];
+ output.texCoord[2] = gl_TexCoord[2];
+ output.texCoord[3] = gl_TexCoord[3];
+ triStream.Append(output);
+
+ gl_Position = float4(xmax, ymin, 0.5, 1.0);
+ output.position = gl_Position;
+ output.texCoord[0] = gl_TexCoord[0];
+ output.texCoord[1] = gl_TexCoord[1];
+ output.texCoord[2] = gl_TexCoord[2];
+ output.texCoord[3] = gl_TexCoord[3];
+ triStream.Append(output);
+
+ /*
+ void main()
+ {
+ vec3 pos = gl_PositionIn[0].xyz;
+ vec4 bounds = gl_TexCoordIn[0][0];
+ vec4 ndcPos = gl_TexCoordIn[0][5];
+
+ // 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 xmin = bounds.x;
+ float xmax = bounds.y;
+ float ymin = bounds.z;
+ float ymax = bounds.w;
+
+ // inv quadric transform
+ gl_TexCoord[0] = gl_TexCoordIn[0][1];
+ gl_TexCoord[1] = gl_TexCoordIn[0][2];
+ gl_TexCoord[2] = gl_TexCoordIn[0][3];
+ gl_TexCoord[3] = gl_TexCoordIn[0][4];
+
+ gl_Position = vec4(xmin, ymax, 0.0, 1.0);
+ EmitVertex();
+
+ gl_Position = vec4(xmin, ymin, 0.0, 1.0);
+ EmitVertex();
+
+ gl_Position = vec4(xmax, ymax, 0.0, 1.0);
+ EmitVertex();
+
+ gl_Position = vec4(xmax, ymin, 0.0, 1.0);
+ EmitVertex();
+ }
+ */
+}
diff --git a/demo/d3d11/shaders/ellipsoidDepthGS.hlsl.h b/demo/d3d11/shaders/ellipsoidDepthGS.hlsl.h
new file mode 100644
index 0000000..c82cc89
--- /dev/null
+++ b/demo/d3d11/shaders/ellipsoidDepthGS.hlsl.h
@@ -0,0 +1,414 @@
+#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 w
+//
+//
+// 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.x, v[0][6].w, l(0.000000)
+if_nz r0.x
+ ret
+endif
+lt r0.x, v[0][6].x, l(-1.000000)
+if_nz r0.x
+ ret
+endif
+lt r0.x, l(1.000000), v[0][6].x
+if_nz r0.x
+ ret
+endif
+lt r0.x, v[0][6].y, l(-1.000000)
+if_nz r0.x
+ ret
+endif
+lt r0.x, l(1.000000), v[0][6].y
+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 49 instruction slots used
+#endif
+
+const BYTE g_ellipsoidDepthGS[] =
+{
+ 68, 88, 66, 67, 121, 233,
+ 112, 246, 66, 190, 203, 227,
+ 242, 237, 242, 197, 75, 158,
+ 125, 123, 1, 0, 0, 0,
+ 72, 7, 0, 0, 5, 0,
+ 0, 0, 52, 0, 0, 0,
+ 172, 0, 0, 0, 120, 1,
+ 0, 0, 44, 2, 0, 0,
+ 172, 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,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Common.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; }
+
+
+float4 ellipsoidDepthPS(FluidGeoOut input
+ , out float gl_FragDepth : SV_DEPTH
+) : SV_TARGET
+{
+ const float4x4 gl_ProjectionMatrix = gParams.projection;
+ const float4x4 gl_ProjectionMatrixInverse = gParams.projection_inverse;
+ const float3 invViewport = gParams.invViewport;
+
+ float4 gl_FragColor;
+ float4 gl_FragCoord;
+ float4 gl_TexCoord[6];
+
+ gl_FragCoord = input.position;
+ [unroll]
+ for (int i = 0; i < 4; i++)
+ gl_TexCoord[i] = input.texCoord[i];
+
+ // transform from view space to parameter space
+ //column_major
+ float4x4 invQuadric;
+ invQuadric._m00_m10_m20_m30 = gl_TexCoord[0];
+ invQuadric._m01_m11_m21_m31 = gl_TexCoord[1];
+ invQuadric._m02_m12_m22_m32 = gl_TexCoord[2];
+ invQuadric._m03_m13_m23_m33 = gl_TexCoord[3];
+
+ //float4 ndcPos = float4(gl_FragCoord.xy * invViewport.xy * float2(2.0, 2.0) - float2(1.0, 1.0), -1.0, 1.0);
+ float4 ndcPos = float4(gl_FragCoord.x*invViewport.x*2.0f-1.0f, (1.0f-gl_FragCoord.y*invViewport.y)*2.0 - 1.0, 0.0f, 1.0);
+ float4 viewDir = mul(gl_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))
+ {
+ float3 eyePos = viewDir.xyz*minT;
+ float4 ndcPos = mul(gl_ProjectionMatrix, float4(eyePos, 1.0));
+ ndcPos.z /= ndcPos.w;
+
+ gl_FragColor = float4(eyePos.z, 1.0, 1.0, 1.0);
+ gl_FragDepth = ndcPos.z;
+
+ return gl_FragColor;
+ }
+
+ // kill pixels outside of ellipsoid
+ discard;
+
+
+ gl_FragColor = 0.0f;
+ gl_FragDepth = 1.0f;
+
+ return gl_FragColor;
+}
diff --git a/demo/d3d11/shaders/ellipsoidDepthPS.hlsl.h b/demo/d3d11/shaders/ellipsoidDepthPS.hlsl.h
new file mode 100644
index 0000000..d21d446
--- /dev/null
+++ b/demo/d3d11/shaders/ellipsoidDepthPS.hlsl.h
@@ -0,0 +1,662 @@
+#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 modelview_inverse; // Offset: 192
+// float4x4 projection_inverse; // 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 xyzw 0 TARGET float xyzw
+// 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.xyzw
+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
+if_nz r1.y
+ 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
+ mov o0.yzw, l(0,1.000000,1.000000,1.000000)
+ ret
+endif
+discard_nz l(-1)
+mov o0.xyzw, l(0,0,0,0)
+mov oDepth, l(1.000000)
+ret
+// Approximately 51 instruction slots used
+#endif
+
+const BYTE g_ellipsoidDepthPS[] =
+{
+ 68, 88, 66, 67, 67, 187,
+ 249, 247, 27, 80, 204, 105,
+ 148, 238, 87, 239, 162, 120,
+ 35, 255, 1, 0, 0, 0,
+ 76, 12, 0, 0, 5, 0,
+ 0, 0, 52, 0, 0, 0,
+ 116, 4, 0, 0, 20, 5,
+ 0, 0, 104, 5, 0, 0,
+ 176, 11, 0, 0, 82, 68,
+ 69, 70, 56, 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,
+ 4, 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,
+ 224, 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,
+ 118, 105, 101, 119, 112, 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, 118, 105, 101, 119, 0,
+ 112, 114, 111, 106, 101, 99,
+ 116, 105, 111, 110, 0, 109,
+ 111, 100, 101, 108, 118, 105,
+ 101, 119, 95, 105, 110, 118,
+ 101, 114, 115, 101, 0, 112,
+ 114, 111, 106, 101, 99, 116,
+ 105, 111, 110, 95, 105, 110,
+ 118, 101, 114, 115, 101, 0,
+ 105, 110, 118, 84, 101, 120,
+ 83, 99, 97, 108, 101, 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,
+ 74, 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, 132, 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, 182, 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, 12, 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, 74, 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, 43, 1, 0, 0,
+ 224, 0, 0, 0, 0, 1,
+ 0, 0, 62, 1, 0, 0,
+ 84, 1, 0, 0, 64, 1,
+ 0, 0, 120, 1, 0, 0,
+ 140, 1, 0, 0, 80, 1,
+ 0, 0, 176, 1, 0, 0,
+ 188, 1, 0, 0, 92, 1,
+ 0, 0, 224, 1, 0, 0,
+ 188, 1, 0, 0, 96, 1,
+ 0, 0, 240, 1, 0, 0,
+ 188, 1, 0, 0, 100, 1,
+ 0, 0, 250, 1, 0, 0,
+ 188, 1, 0, 0, 104, 1,
+ 0, 0, 6, 2, 0, 0,
+ 16, 2, 0, 0, 108, 1,
+ 0, 0, 52, 2, 0, 0,
+ 140, 1, 0, 0, 112, 1,
+ 0, 0, 61, 2, 0, 0,
+ 188, 1, 0, 0, 124, 1,
+ 0, 0, 67, 2, 0, 0,
+ 140, 1, 0, 0, 128, 1,
+ 0, 0, 76, 2, 0, 0,
+ 188, 1, 0, 0, 140, 1,
+ 0, 0, 82, 2, 0, 0,
+ 224, 0, 0, 0, 144, 1,
+ 0, 0, 97, 2, 0, 0,
+ 84, 1, 0, 0, 208, 1,
+ 0, 0, 103, 2, 0, 0,
+ 84, 1, 0, 0, 224, 1,
+ 0, 0, 116, 2, 0, 0,
+ 188, 1, 0, 0, 240, 1,
+ 0, 0, 124, 2, 0, 0,
+ 188, 1, 0, 0, 244, 1,
+ 0, 0, 132, 2, 0, 0,
+ 188, 1, 0, 0, 248, 1,
+ 0, 0, 136, 2, 0, 0,
+ 188, 1, 0, 0, 252, 1,
+ 0, 0, 142, 2, 0, 0,
+ 156, 2, 0, 0, 0, 2,
+ 0, 0, 5, 0, 0, 0,
+ 1, 0, 176, 0, 0, 0,
+ 24, 0, 192, 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, 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0, 4, 3, 1, 64,
+ 0, 0, 255, 255, 255, 255,
+ 54, 0, 0, 8, 242, 32,
+ 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, 54, 0, 0, 4,
+ 1, 192, 0, 0, 1, 64,
+ 0, 0, 0, 0, 128, 63,
+ 62, 0, 0, 1, 83, 84,
+ 65, 84, 148, 0, 0, 0,
+ 51, 0, 0, 0, 4, 0,
+ 0, 0, 0, 0, 0, 0,
+ 7, 0, 0, 0, 35, 0,
+ 0, 0, 0, 0, 0, 0,
+ 2, 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,
+ 0, 0, 0, 0, 0, 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, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 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/d3d11/shaders/ellipsoidDepthVS.hlsl b/demo/d3d11/shaders/ellipsoidDepthVS.hlsl
new file mode 100644
index 0000000..03ef001
--- /dev/null
+++ b/demo/d3d11/shaders/ellipsoidDepthVS.hlsl
@@ -0,0 +1,195 @@
+#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)
+{
+ float4 gl_Position;
+ float4 gl_TexCoord[6];
+
+ const float4 gl_Vertex = input.position;
+ const float4 q1 = input.q1;
+ const float4 q2 = input.q2;
+ const float4 q3 = input.q3;
+
+ const float4x4 gl_ModelViewProjectionMatrix = gParams.modelviewprojection;
+ const float4x4 gl_ModelViewMatrixInverse = gParams.modelview_inverse;
+
+ float3 worldPos = gl_Vertex.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 = /*transpose*/(mul(gl_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);
+
+ gl_Position = float4(worldPos.xyz, 1.0);
+ gl_TexCoord[0] = 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, gl_Position));
+
+ // transform a point from view space to parameter space
+ invq = mul(invq, gl_ModelViewMatrixInverse);
+
+ // pass down
+ gl_TexCoord[1] = invq._m00_m10_m20_m30;
+ gl_TexCoord[2] = invq._m01_m11_m21_m31;
+ gl_TexCoord[3] = invq._m02_m12_m22_m32;
+ gl_TexCoord[4] = invq._m03_m13_m23_m33;
+
+ // compute ndc pos for frustrum culling in GS
+ float4 ndcPos = mul(gl_ModelViewProjectionMatrix, float4(worldPos.xyz, 1.0));
+ gl_TexCoord[5].xyz = ndcPos.xyz / ndcPos.w;
+ gl_TexCoord[5].w = ndcPos.w;
+
+ FluidVertexOut output;
+ output.position = gl_Position;
+ [unroll]
+ for (int j = 0; j < 6; j++)
+ output.texCoord[j] = gl_TexCoord[j];
+
+ return output;
+
+ /*
+ // rotation matrix in xyz, scale in w
+ attribute vec4 q1;
+ attribute vec4 q2;
+ attribute vec4 q3;
+
+ void main()
+ {
+ vec3 worldPos = gl_Vertex.xyz;// - vec3(0.0, 0.1*0.25, 0.0); // hack move towards ground to account for anisotropy
+
+ // construct quadric matrix
+ mat4 q;
+ q[0] = vec4(q1.xyz*q1.w, 0.0);
+ q[1] = vec4(q2.xyz*q2.w, 0.0);
+ q[2] = vec4(q3.xyz*q3.w, 0.0);
+ q[3] = vec4(worldPos, 1.0);
+
+ // transforms a normal to parameter space (inverse transpose of (q*modelview)^-T)
+ mat4 invClip = transpose(gl_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);
+
+ gl_Position = vec4(worldPos.xyz, 1.0);
+ gl_TexCoord[0] = vec4(xmin, xmax, ymin, ymax);
+
+ // construct inverse quadric matrix (used for ray-casting in parameter space)
+ mat4 invq;
+ invq[0] = vec4(q1.xyz / q1.w, 0.0);
+ invq[1] = vec4(q2.xyz / q2.w, 0.0);
+ invq[2] = vec4(q3.xyz / q3.w, 0.0);
+ invq[3] = vec4(0.0, 0.0, 0.0, 1.0);
+
+ invq = transpose(invq);
+ invq[3] = -(invq*gl_Position);
+
+ // transform a point from view space to parameter space
+ invq = invq*gl_ModelViewMatrixInverse;
+
+ // pass down
+ gl_TexCoord[1] = invq[0];
+ gl_TexCoord[2] = invq[1];
+ gl_TexCoord[3] = invq[2];
+ gl_TexCoord[4] = invq[3];
+
+ // compute ndc pos for frustrum culling in GS
+ vec4 ndcPos = gl_ModelViewProjectionMatrix * vec4(worldPos.xyz, 1.0);
+ gl_TexCoord[5] = ndcPos / ndcPos.w;
+ }
+ */
+}
diff --git a/demo/d3d11/shaders/ellipsoidDepthVS.hlsl.h b/demo/d3d11/shaders/ellipsoidDepthVS.hlsl.h
new file mode 100644
index 0000000..d1dd741
--- /dev/null
+++ b/demo/d3d11/shaders/ellipsoidDepthVS.hlsl.h
@@ -0,0 +1,940 @@
+#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 modelview_inverse; // Offset: 192
+// float4x4 projection_inverse; // 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.xyz, r0.xyzx, r0.wwww
+mov o6.w, r0.w
+ret
+// Approximately 85 instruction slots used
+#endif
+
+const BYTE g_ellipsoidDepthVS[] =
+{
+ 68, 88, 66, 67, 1, 86,
+ 214, 204, 57, 184, 18, 6,
+ 20, 42, 129, 16, 226, 241,
+ 71, 198, 1, 0, 0, 0,
+ 208, 17, 0, 0, 5, 0,
+ 0, 0, 52, 0, 0, 0,
+ 116, 4, 0, 0, 24, 5,
+ 0, 0, 228, 5, 0, 0,
+ 52, 17, 0, 0, 82, 68,
+ 69, 70, 56, 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,
+ 4, 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,
+ 224, 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,
+ 118, 105, 101, 119, 112, 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, 118, 105, 101, 119, 0,
+ 112, 114, 111, 106, 101, 99,
+ 116, 105, 111, 110, 0, 109,
+ 111, 100, 101, 108, 118, 105,
+ 101, 119, 95, 105, 110, 118,
+ 101, 114, 115, 101, 0, 112,
+ 114, 111, 106, 101, 99, 116,
+ 105, 111, 110, 95, 105, 110,
+ 118, 101, 114, 115, 101, 0,
+ 105, 110, 118, 84, 101, 120,
+ 83, 99, 97, 108, 101, 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,
+ 74, 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, 132, 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, 182, 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, 12, 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, 74, 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, 43, 1, 0, 0,
+ 224, 0, 0, 0, 0, 1,
+ 0, 0, 62, 1, 0, 0,
+ 84, 1, 0, 0, 64, 1,
+ 0, 0, 120, 1, 0, 0,
+ 140, 1, 0, 0, 80, 1,
+ 0, 0, 176, 1, 0, 0,
+ 188, 1, 0, 0, 92, 1,
+ 0, 0, 224, 1, 0, 0,
+ 188, 1, 0, 0, 96, 1,
+ 0, 0, 240, 1, 0, 0,
+ 188, 1, 0, 0, 100, 1,
+ 0, 0, 250, 1, 0, 0,
+ 188, 1, 0, 0, 104, 1,
+ 0, 0, 6, 2, 0, 0,
+ 16, 2, 0, 0, 108, 1,
+ 0, 0, 52, 2, 0, 0,
+ 140, 1, 0, 0, 112, 1,
+ 0, 0, 61, 2, 0, 0,
+ 188, 1, 0, 0, 124, 1,
+ 0, 0, 67, 2, 0, 0,
+ 140, 1, 0, 0, 128, 1,
+ 0, 0, 76, 2, 0, 0,
+ 188, 1, 0, 0, 140, 1,
+ 0, 0, 82, 2, 0, 0,
+ 224, 0, 0, 0, 144, 1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 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 6, 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/d3d11/shaders/imguiPS.hlsl b/demo/d3d11/shaders/imguiPS.hlsl
new file mode 100644
index 0000000..f51a21b
--- /dev/null
+++ b/demo/d3d11/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/d3d11/shaders/imguiPS.hlsl.h b/demo/d3d11/shaders/imguiPS.hlsl.h
new file mode 100644
index 0000000..92aa84a
--- /dev/null
+++ b/demo/d3d11/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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 0, 0, 0, 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/d3d11/shaders/imguiVS.hlsl b/demo/d3d11/shaders/imguiVS.hlsl
new file mode 100644
index 0000000..6116ee1
--- /dev/null
+++ b/demo/d3d11/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/d3d11/shaders/imguiVS.hlsl.h b/demo/d3d11/shaders/imguiVS.hlsl.h
new file mode 100644
index 0000000..7249cec
--- /dev/null
+++ b/demo/d3d11/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,
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 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/d3d11/shaders/meshPS.hlsl b/demo/d3d11/shaders/meshPS.hlsl
new file mode 100644
index 0000000..db28d60
--- /dev/null
+++ b/demo/d3d11/shaders/meshPS.hlsl
@@ -0,0 +1,130 @@
+#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 gl_TexCoord[8])
+{
+ float3 pos = float3(gl_TexCoord[1].xyz / gl_TexCoord[1].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.SampleCmpLevelZero(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
+{
+ float4 gl_FragColor;
+ float4 gl_TexCoord[8];
+
+ [unroll]
+ for (int i = 0; i < 8; i++)
+ gl_TexCoord[i] = input.texCoord[i];
+
+ 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(gl_TexCoord), 0.5);
+
+ float3 lVec = normalize(gl_TexCoord[3].xyz - (lightPos));
+ float3 lPos = float3(gl_TexCoord[1].xyz / gl_TexCoord[1].w);
+ float attenuation = max(smoothstep(spotMax, spotMin, dot(lPos.xy, lPos.xy)), 0.05);
+
+ float3 n = gl_TexCoord[0].xyz;
+ float3 color = gl_TexCoord[4].xyz;
+
+ if (!isFrontFace)
+ {
+ color = gl_TexCoord[6].xyz;
+ n *= -1.0f;
+ }
+
+ if (grid && (n.y > 0.995))
+ {
+ color *= 1.0 - 0.25 * checker(float2(gl_TexCoord[3].x, gl_TexCoord[3].z));
+ }
+ else if (grid && abs(n.z) > 0.995)
+ {
+ color *= 1.0 - 0.25 * checker(float2(gl_TexCoord[3].y, gl_TexCoord[3].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(gl_TexCoord[7].z * fogColor.w));
+
+ //gl_FragColor = float4(pow(fog, float3(1.0 / 2.2)), 1.0);
+ const float tmp = 1.0 / 2.2;
+ gl_FragColor = float4(pow(abs(fog), float3(tmp, tmp, tmp)), 1.0);
+
+ return gl_FragColor;
+
+}
diff --git a/demo/d3d11/shaders/meshPS.hlsl.h b/demo/d3d11/shaders/meshPS.hlsl.h
new file mode 100644
index 0000000..9bbb118
--- /dev/null
+++ b/demo/d3d11/shaders/meshPS.hlsl.h
@@ -0,0 +1,1553 @@
+#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 _pad2; // 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 xyzw 1 NONE float xyz
+// TEXCOORD 1 xyzw 2 NONE float xyzw
+// TEXCOORD 2 xyzw 3 NONE float
+// TEXCOORD 3 xyzw 4 NONE float xyz
+// TEXCOORD 4 xyzw 5 NONE float xyz
+// TEXCOORD 5 xyzw 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
+if_z r0.z
+ lt r0.z, r1.y, l(0.000000)
+ lt r0.w, l(1.000000), r1.y
+ or r0.z, r0.w, r0.z
+ if_z r0.z
+ add r0.z, -cb0[20].y, l(1.000000)
+ mul r2.x, cb0[20].x, l(0.002000)
+ mul r2.y, r0.z, l(0.002000)
+ add r1.w, -r1.y, l(1.000000)
+ add r0.zw, r1.xxxw, r2.xxxy
+ sample_c_lz_indexable(texture2d)(float,float,float,float) r0.z, r0.zwzz, t0.xxxx, s0, r1.z
+ add r0.w, -cb0[21].y, l(1.000000)
+ mul r2.x, cb0[21].x, l(0.002000)
+ mul r2.y, r0.w, l(0.002000)
+ add r2.xy, r1.xwxx, r2.xyxx
+ sample_c_lz_indexable(texture2d)(float,float,float,float) r0.w, r2.xyxx, t0.xxxx, s0, r1.z
+ add r0.z, r0.w, r0.z
+ add r0.w, -cb0[22].y, l(1.000000)
+ mul r2.x, cb0[22].x, l(0.002000)
+ mul r2.y, r0.w, l(0.002000)
+ add r2.xy, r1.xwxx, r2.xyxx
+ sample_c_lz_indexable(texture2d)(float,float,float,float) r0.w, r2.xyxx, t0.xxxx, s0, r1.z
+ add r0.z, r0.w, r0.z
+ add r0.w, -cb0[23].y, l(1.000000)
+ mul r2.x, cb0[23].x, l(0.002000)
+ mul r2.y, r0.w, l(0.002000)
+ add r2.xy, r1.xwxx, r2.xyxx
+ sample_c_lz_indexable(texture2d)(float,float,float,float) r0.w, r2.xyxx, t0.xxxx, s0, r1.z
+ add r0.z, r0.w, r0.z
+ add r0.w, -cb0[24].y, l(1.000000)
+ mul r2.x, cb0[24].x, l(0.002000)
+ mul r2.y, r0.w, l(0.002000)
+ add r2.xy, r1.xwxx, r2.xyxx
+ sample_c_lz_indexable(texture2d)(float,float,float,float) r0.w, r2.xyxx, t0.xxxx, s0, r1.z
+ add r0.z, r0.w, r0.z
+ add r0.w, -cb0[25].y, l(1.000000)
+ mul r2.x, cb0[25].x, l(0.002000)
+ mul r2.y, r0.w, l(0.002000)
+ add r2.xy, r1.xwxx, r2.xyxx
+ sample_c_lz_indexable(texture2d)(float,float,float,float) r0.w, r2.xyxx, t0.xxxx, s0, r1.z
+ add r0.z, r0.w, r0.z
+ add r0.w, -cb0[26].y, l(1.000000)
+ mul r2.x, cb0[26].x, l(0.002000)
+ mul r2.y, r0.w, l(0.002000)
+ add r2.xy, r1.xwxx, r2.xyxx
+ sample_c_lz_indexable(texture2d)(float,float,float,float) r0.w, r2.xyxx, t0.xxxx, s0, r1.z
+ add r0.z, r0.w, r0.z
+ add r0.w, -cb0[27].y, l(1.000000)
+ mul r2.x, cb0[27].x, l(0.002000)
+ mul r2.y, r0.w, l(0.002000)
+ add r2.xy, r1.xwxx, r2.xyxx
+ sample_c_lz_indexable(texture2d)(float,float,float,float) r0.w, r2.xyxx, t0.xxxx, s0, r1.z
+ add r0.z, r0.w, r0.z
+ add r0.w, -cb0[28].y, l(1.000000)
+ mul r2.x, cb0[28].x, l(0.002000)
+ mul r2.y, r0.w, l(0.002000)
+ add r2.xy, r1.xwxx, r2.xyxx
+ sample_c_lz_indexable(texture2d)(float,float,float,float) r0.w, r2.xyxx, t0.xxxx, s0, r1.z
+ add r0.z, r0.w, r0.z
+ add r0.w, -cb0[29].y, l(1.000000)
+ mul r2.x, cb0[29].x, l(0.002000)
+ mul r2.y, r0.w, l(0.002000)
+ add r2.xy, r1.xwxx, r2.xyxx
+ sample_c_lz_indexable(texture2d)(float,float,float,float) r0.w, r2.xyxx, t0.xxxx, s0, r1.z
+ add r0.z, r0.w, r0.z
+ add r0.w, -cb0[30].y, l(1.000000)
+ mul r2.x, cb0[30].x, l(0.002000)
+ mul r2.y, r0.w, l(0.002000)
+ add r2.xy, r1.xwxx, r2.xyxx
+ sample_c_lz_indexable(texture2d)(float,float,float,float) r0.w, r2.xyxx, t0.xxxx, s0, r1.z
+ add r0.z, r0.w, r0.z
+ add r0.w, -cb0[31].y, l(1.000000)
+ mul r2.x, cb0[31].x, l(0.002000)
+ mul r2.y, r0.w, l(0.002000)
+ add r1.xy, r1.xwxx, r2.xyxx
+ sample_c_lz_indexable(texture2d)(float,float,float,float) r0.w, r1.xyxx, t0.xxxx, s0, r1.z
+ add r0.z, r0.w, 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, 162, 143,
+ 63, 83, 112, 221, 166, 253,
+ 12, 109, 97, 84, 15, 129,
+ 226, 222, 1, 0, 0, 0,
+ 8, 30, 0, 0, 5, 0,
+ 0, 0, 52, 0, 0, 0,
+ 116, 4, 0, 0, 152, 5,
+ 0, 0, 204, 5, 0, 0,
+ 108, 29, 0, 0, 82, 68,
+ 69, 70, 56, 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,
+ 4, 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, 224, 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, 118, 105, 101, 119, 112,
+ 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, 118, 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, 95,
+ 112, 97, 100, 50, 0, 171,
+ 171, 171, 28, 1, 0, 0,
+ 60, 1, 0, 0, 0, 0,
+ 0, 0, 96, 1, 0, 0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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/d3d11/shaders/meshShadowPS.hlsl b/demo/d3d11/shaders/meshShadowPS.hlsl
new file mode 100644
index 0000000..cb60c22
--- /dev/null
+++ b/demo/d3d11/shaders/meshShadowPS.hlsl
@@ -0,0 +1,11 @@
+#include "shaderCommon.h"
+
+cbuffer constBuf : register(b0)
+{
+ MeshShaderConst gParams;
+};
+
+float4 meshPS_Shadow(MeshVertexOut input) : SV_TARGET
+{
+ return float4(0.0, 0.0, 0.0, 1.0);
+}
diff --git a/demo/d3d11/shaders/meshShadowPS.hlsl.h b/demo/d3d11/shaders/meshShadowPS.hlsl.h
new file mode 100644
index 0000000..3794f61
--- /dev/null
+++ b/demo/d3d11/shaders/meshShadowPS.hlsl.h
@@ -0,0 +1,156 @@
+#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 xyzw 1 NONE float
+// TEXCOORD 1 xyzw 2 NONE float
+// TEXCOORD 2 xyzw 3 NONE float
+// TEXCOORD 3 xyzw 4 NONE float
+// TEXCOORD 4 xyzw 5 NONE float
+// TEXCOORD 5 xyzw 6 NONE float
+// TEXCOORD 6 xyzw 7 NONE float
+// TEXCOORD 7 xyzw 8 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_output o0.xyzw
+mov o0.xyzw, l(0,0,0,1.000000)
+ret
+// Approximately 2 instruction slots used
+#endif
+
+const BYTE g_meshPS_Shadow[] =
+{
+ 68, 88, 66, 67, 106, 78,
+ 82, 142, 162, 137, 138, 82,
+ 3, 68, 165, 116, 56, 116,
+ 165, 11, 1, 0, 0, 0,
+ 192, 2, 0, 0, 5, 0,
+ 0, 0, 52, 0, 0, 0,
+ 172, 0, 0, 0, 172, 1,
+ 0, 0, 224, 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, 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, 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, 101, 0, 0, 3,
+ 242, 32, 16, 0, 0, 0,
+ 0, 0, 54, 0, 0, 8,
+ 242, 32, 16, 0, 0, 0,
+ 0, 0, 2, 64, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 128, 63, 62, 0,
+ 0, 1, 83, 84, 65, 84,
+ 148, 0, 0, 0, 2, 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, 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/d3d11/shaders/meshVS.hlsl b/demo/d3d11/shaders/meshVS.hlsl
new file mode 100644
index 0000000..09f78ec
--- /dev/null
+++ b/demo/d3d11/shaders/meshVS.hlsl
@@ -0,0 +1,91 @@
+#include "shaderCommon.h"
+
+cbuffer constBuf : register(b0)
+{
+ MeshShaderConst gParams;
+};
+
+MeshVertexOut meshVS(MeshVertexIn input)
+{
+ float4 gl_Position;
+ float4 gl_TexCoord[8];
+
+ {
+ [unroll]
+ for (int i = 0; i < 8; i++)
+ gl_TexCoord[i] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+ }
+
+ const float4x4 gl_ModelViewProjectionMatrix = gParams.modelviewprojection;
+ const float4x4 gl_ModelViewMatrix = gParams.modelview;
+ const float4x4 objectTransform = gParams.objectTransform;
+ const float4x4 lightTransform = gParams.lightTransform;
+ const float3 lightDir = gParams.lightDir;
+ const float bias = gParams.bias;
+ const float4 clipPlane = gParams.clipPlane;
+ const float expand = gParams.expand;
+ const float4 gl_Color = gParams.color;
+ const float4 gl_SecondaryColor = gParams.secondaryColor;
+
+ const float3 gl_Vertex = input.position;
+ const float3 gl_Normal = input.normal;
+ const float2 gl_MultiTexCoord0 = input.texCoord;
+
+ float3 n = normalize(mul(objectTransform, float4(gl_Normal, 0.0)).xyz);
+ float3 p = mul(objectTransform, float4(gl_Vertex.xyz, 1.0)).xyz;
+
+ // calculate window-space point size
+ gl_Position = mul(gl_ModelViewProjectionMatrix, float4(p + expand * n, 1.0));
+
+ gl_TexCoord[0].xyz = n;
+ gl_TexCoord[1] = mul(lightTransform, float4(p + n * bias, 1.0));
+ gl_TexCoord[2] = mul(gl_ModelViewMatrix, float4(lightDir, 0.0));
+ gl_TexCoord[3].xyz = p;
+ if (gParams.colorArray)
+ gl_TexCoord[4] = input.color;
+ else
+ gl_TexCoord[4] = gl_Color;
+ gl_TexCoord[5].xy = gl_MultiTexCoord0;
+ gl_TexCoord[5].y = 1.0f - gl_TexCoord[5].y; // flip the y component of uv (glsl to hlsl conversion)
+ gl_TexCoord[6] = gl_SecondaryColor;
+ gl_TexCoord[7] = mul(gl_ModelViewMatrix, float4(gl_Vertex.xyz, 1.0));
+
+ MeshVertexOut output;
+ output.position = gl_Position;
+ {
+ [unroll]
+ for (int i = 0; i < 8; i++)
+ output.texCoord[i] = gl_TexCoord[i];
+ }
+
+ return output;
+
+ /*
+ uniform mat4 lightTransform;
+ uniform vec3 lightDir;
+ uniform float bias;
+ uniform vec4 clipPlane;
+ uniform float expand;
+
+ uniform mat4 objectTransform;
+
+ void main()
+ {
+ vec3 n = normalize((objectTransform*vec4(gl_Normal, 0.0)).xyz);
+ vec3 p = (objectTransform*vec4(gl_Vertex.xyz, 1.0)).xyz;
+
+ // calculate window-space point size
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(p + expand*n, 1.0);
+
+ gl_TexCoord[0].xyz = n;
+ gl_TexCoord[1] = lightTransform*vec4(p + n*bias, 1.0);
+ gl_TexCoord[2] = gl_ModelViewMatrix*vec4(lightDir, 0.0);
+ gl_TexCoord[3].xyz = p;
+ gl_TexCoord[4] = gl_Color;
+ gl_TexCoord[5] = gl_MultiTexCoord0;
+ gl_TexCoord[6] = gl_SecondaryColor;
+ gl_TexCoord[7] = gl_ModelViewMatrix*vec4(gl_Vertex.xyz, 1.0);
+
+ gl_ClipDistance[0] = dot(clipPlane, vec4(gl_Vertex.xyz, 1.0));
+ */
+}
diff --git a/demo/d3d11/shaders/meshVS.hlsl.h b/demo/d3d11/shaders/meshVS.hlsl.h
new file mode 100644
index 0000000..cc314af
--- /dev/null
+++ b/demo/d3d11/shaders/meshVS.hlsl.h
@@ -0,0 +1,635 @@
+#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 _pad2; // 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 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
+// 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.xyzw
+dcl_output o2.xyzw
+dcl_output o3.xyzw
+dcl_output o4.xyzw
+dcl_output o5.xyzw
+dcl_output o6.xyzw
+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
+mov o1.w, l(0)
+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.xyzw, cb0[5].xyzw, cb0[33].yyyy
+mad r0.xyzw, cb0[4].xyzw, cb0[33].xxxx, r0.xyzw
+mad o3.xyzw, cb0[6].xyzw, cb0[33].zzzz, r0.xyzw
+mov o4.w, l(0)
+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 o6.zw, l(0,0,0,0)
+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 36 instruction slots used
+#endif
+
+const BYTE g_meshVS[] =
+{
+ 68, 88, 66, 67, 128, 165,
+ 34, 49, 122, 47, 91, 168,
+ 78, 217, 246, 213, 221, 36,
+ 22, 221, 1, 0, 0, 0,
+ 204, 11, 0, 0, 5, 0,
+ 0, 0, 52, 0, 0, 0,
+ 24, 4, 0, 0, 168, 4,
+ 0, 0, 168, 5, 0, 0,
+ 48, 11, 0, 0, 82, 68,
+ 69, 70, 220, 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,
+ 168, 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,
+ 132, 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, 118,
+ 105, 101, 119, 112, 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, 118, 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, 95, 112, 97,
+ 100, 50, 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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 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 6, 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/d3d11/shaders/passThroughVS.hlsl b/demo/d3d11/shaders/passThroughVS.hlsl
new file mode 100644
index 0000000..9b16afa
--- /dev/null
+++ b/demo/d3d11/shaders/passThroughVS.hlsl
@@ -0,0 +1,26 @@
+#include "shaderCommon.h"
+
+cbuffer constBuf : register(b0)
+{
+ FluidShaderConst gParams;
+};
+
+PassthroughVertexOut passThroughVS(PassthroughVertexIn input)
+{
+ float4 gl_Vertex = float4(input.position, 0.0f, 1.0f);
+ float2 gl_MultiTexCoord0 = input.texCoord;
+
+ PassthroughVertexOut output;
+ output.position = gl_Vertex;
+ output.texCoord[0] = gl_MultiTexCoord0;
+
+ return output;
+
+ /*
+ void main()
+ {
+ gl_Position = vec4(gl_Vertex.xyz, 1.0);
+ gl_TexCoord[0] = gl_MultiTexCoord0;
+ }
+ */
+}
diff --git a/demo/d3d11/shaders/passThroughVS.hlsl.h b/demo/d3d11/shaders/passThroughVS.hlsl.h
new file mode 100644
index 0000000..4b1b2cf
--- /dev/null
+++ b/demo/d3d11/shaders/passThroughVS.hlsl.h
@@ -0,0 +1,145 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// POSITION 0 xy 0 NONE float xy
+// TEXCOORD 0 xy 1 NONE float xy
+//
+//
+// 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.xy
+dcl_input v1.xy
+dcl_output_siv o0.xyzw, position
+dcl_output o1.xy
+mov o0.xy, v0.xyxx
+mov o0.zw, l(0,0,0,1.000000)
+mov o1.xy, v1.xyxx
+ret
+// Approximately 4 instruction slots used
+#endif
+
+const BYTE g_passThroughVS[] =
+{
+ 68, 88, 66, 67, 187, 133,
+ 114, 171, 205, 36, 113, 9,
+ 245, 108, 33, 122, 172, 89,
+ 138, 214, 1, 0, 0, 0,
+ 136, 2, 0, 0, 5, 0,
+ 0, 0, 52, 0, 0, 0,
+ 172, 0, 0, 0, 0, 1,
+ 0, 0, 88, 1, 0, 0,
+ 236, 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,
+ 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, 76, 0, 0, 0,
+ 2, 0, 0, 0, 8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 0, 0, 0,
+ 70, 16, 16, 0, 1, 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/d3d11/shaders/pointGS.hlsl b/demo/d3d11/shaders/pointGS.hlsl
new file mode 100644
index 0000000..2d8126e
--- /dev/null
+++ b/demo/d3d11/shaders/pointGS.hlsl
@@ -0,0 +1,84 @@
+#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)
+{
+ float4 gl_Position;
+ float4 gl_TexCoord[6];
+
+ {
+ [unroll]
+ for (int i = 0; i < 6; i++)
+ gl_TexCoord[i] = float4(0.0f, 0.0f, 0.0f, 0.0f);
+ }
+
+ const float4x4 gl_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;
+
+ float4 viewPos = input[0].position;
+ float density = input[0].density;
+ unsigned int phase = input[0].phase;
+ float4 gl_Vertex = input[0].vertex;
+
+ //float gl_PointSize = -pointScale * (pointRadius / viewPos.z);
+ //float spriteSize = (pointRadius / viewPos.z);
+ float spriteSize = pointRadius * 2;
+
+ PointGeoOut output;
+
+ for (int i = 0; i < 4; ++i)
+ {
+
+ float4 eyePos = viewPos; // start with point position
+ eyePos.xy += spriteSize * (corners[i] - float2(0.5, 0.5)); // add corner position
+ gl_Position = mul(gParams.projection, eyePos); // complete transformation
+
+ gl_TexCoord[0].xy = corners[i].xy; // use corner as texCoord
+ gl_TexCoord[0].y = 1.0f - gl_TexCoord[0].y; // flip the y component of uv (glsl to hlsl conversion)
+ gl_TexCoord[1] = mul(lightTransform, float4(gl_Vertex.xyz - lightDir * pointRadius * 2.0, 1.0));
+ gl_TexCoord[2] = mul(gl_ModelViewMatrix, float4(lightDir, 0.0));
+
+ if (mode == 1)
+ {
+ // density visualization
+ if (density < 0.0f)
+ gl_TexCoord[3].xyz = lerp(float3(0.1, 0.1, 1.0), float3(0.1, 1.0, 1.0), -density);
+ else
+ gl_TexCoord[3].xyz = lerp(float3(1.0, 1.0, 1.0), float3(0.1, 0.2, 1.0), density);
+ }
+ else if (mode == 2)
+ {
+ //gl_PointSize *= clamp(gl_Vertex.w * 0.25, 0.0f, 1.0);
+ float tmp = clamp(gl_Vertex.w * 0.05, 0.0f, 1.0);
+ gl_TexCoord[3].xyzw = float4(tmp, tmp, tmp, tmp);
+ }
+ else
+ {
+ gl_TexCoord[3].xyz = lerp(gParams.colors[phase % 8].xyz * 2.0, float3(1.0, 1.0, 1.0), 0.1);
+ }
+
+ gl_TexCoord[4].xyz = gl_Vertex.xyz;
+ gl_TexCoord[5].xyz = viewPos.xyz;
+
+ output.position = gl_Position;
+ [unroll]
+ for (int j = 0; j < 6; j++)
+ output.texCoord[j] = gl_TexCoord[j];
+
+ triStream.Append(output);
+ }
+}
diff --git a/demo/d3d11/shaders/pointGS.hlsl.h b/demo/d3d11/shaders/pointGS.hlsl.h
new file mode 100644
index 0000000..afc1b76
--- /dev/null
+++ b/demo/d3d11/shaders/pointGS.hlsl.h
@@ -0,0 +1,740 @@
+#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 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
+//
+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_indexableTemp x0[6], 4
+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.xyzw
+dcl_maxout 4
+mov x0[3].w, l(0)
+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 r2.xyzw, cb0[1].xyzw, cb0[33].yyyy
+mad r2.xyzw, cb0[0].xyzw, cb0[33].xxxx, r2.xyzw
+mad r2.xyzw, cb0[2].xyzw, cb0[33].zzzz, r2.xyzw
+lt r0.y, v[0][1].x, l(0.000000)
+mad r3.xyz, v[0][1].xxxx, l(0.000000, -0.900000, 0.000000, 0.000000), l(0.100000, 0.100000, 1.000000, 0.000000)
+mad r4.xyz, v[0][1].xxxx, l(-0.900000, -0.800000, 0.000000, 0.000000), l(1.000000, 1.000000, 1.000000, 0.000000)
+ieq r0.zw, l(0, 0, 1, 2), cb0[35].xxxx
+mul r3.w, l(0.050000), v[0][3].w
+mov_sat r5.xyz, r3.wwww
+and r3.w, l(7), v[0][2].x
+add r6.xyz, cb0[r3.w + 12].xyzx, cb0[r3.w + 12].xyzx
+mad r7.xyz, -cb0[r3.w + 12].xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(1.000000, 1.000000, 1.000000, 0.000000)
+mad r6.xyz, r7.xyzx, l(0.100000, 0.100000, 0.100000, 0.000000), r6.xyzx
+movc r3.xyz, r0.yyyy, r3.xyzx, r4.xyzx
+mov r0.y, l(0)
+loop
+ ige r3.w, r0.y, l(4)
+ breakc_nz r3.w
+ add r4.xy, l(-0.500000, -0.500000, 0.000000, 0.000000), icb[r0.y + 0].xyxx
+ mad r4.xy, r0.xxxx, r4.xyxx, v[0][0].xyxx
+ mul r7.xyzw, r4.yyyy, cb0[5].xyzw
+ mad r4.xyzw, cb0[4].xyzw, r4.xxxx, r7.xyzw
+ mad r4.xyzw, cb0[6].xyzw, v[0][0].zzzz, r4.xyzw
+ mad r4.xyzw, cb0[7].xyzw, v[0][0].wwww, r4.xyzw
+ add r3.w, l(1.000000), -icb[r0.y + 0].y
+ if_nz r0.z
+ mov r7.xyz, r3.xyzx
+ else
+ if_nz r0.w
+ mov x0[3].w, r5.z
+ mov r7.xyz, r5.xyzx
+ else
+ mov r7.xyz, r6.xyzx
+ endif
+ endif
+ mov r5.w, x0[3].w
+ mov o0.xyzw, r4.xyzw
+ mov o1.x, icb[r0.y + 0].x
+ mov o1.y, r3.w
+ mov o1.zw, l(0,0,0,0)
+ mov o2.xyzw, r1.xyzw
+ mov o3.xyzw, r2.xyzw
+ mov o4.xyz, r7.xyzx
+ mov o4.w, r5.w
+ mov o5.xyz, v[0][3].xyzx
+ mov o5.w, l(0)
+ mov o6.xyz, v[0][0].xyzx
+ mov o6.w, l(0)
+ emit_stream m0
+ iadd r0.y, r0.y, l(1)
+endloop
+ret
+// Approximately 60 instruction slots used
+#endif
+
+const BYTE g_pointGS[] =
+{
+ 68, 88, 66, 67, 83, 238,
+ 66, 156, 86, 118, 105, 62,
+ 85, 224, 176, 224, 229, 4,
+ 226, 151, 1, 0, 0, 0,
+ 188, 13, 0, 0, 5, 0,
+ 0, 0, 52, 0, 0, 0,
+ 176, 3, 0, 0, 64, 4,
+ 0, 0, 44, 5, 0, 0,
+ 32, 13, 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,
+ 118, 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,
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, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0
+};
diff --git a/demo/d3d11/shaders/pointPS.hlsl b/demo/d3d11/shaders/pointPS.hlsl
new file mode 100644
index 0000000..e8bcaf4
--- /dev/null
+++ b/demo/d3d11/shaders/pointPS.hlsl
@@ -0,0 +1,103 @@
+#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 gl_TexCoord[6])
+{
+ float3 pos = float3(gl_TexCoord[1].xyz / gl_TexCoord[1].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.SampleCmpLevelZero(shadowSampler, uvw.xy + shadowTaps * radius, uvw.z);
+ }
+ s /= 8.0;
+
+ return s;
+}
+
+float4 pointPS(PointGeoOut input
+ //, out float gl_FragDepth : SV_DEPTH
+) : SV_TARGET
+{
+ //gl_FragDepth = 0.0f;
+
+ const float spotMin = gParams.spotMin;
+ const float spotMax = gParams.spotMax;
+
+ float4 gl_FragColor;
+ float4 gl_TexCoord[6];
+
+ [unroll]
+ for (int i = 0; i < 6; i++)
+ gl_TexCoord[i] = input.texCoord[i];
+
+ // calculate normal from texture coordinates
+ float3 normal;
+ normal.xy = gl_TexCoord[0].xy * 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 * gl_TexCoord[3].w;
+ gl_FragColor.xyz = gl_TexCoord[3].xyz * alpha;
+ gl_FragColor.w = alpha;
+
+ return gl_FragColor;
+ }
+
+ // calculate lighting
+ float shadow = shadowSample(gl_TexCoord);
+
+ float3 lPos = float3(gl_TexCoord[1].xyz / gl_TexCoord[1].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 = gl_TexCoord[3].xyz;
+
+ float3 Lo = diffuse * reflectance * max(0.0, sqr(-dot(gl_TexCoord[2].xyz, normal) * 0.5 + 0.5)) * max(0.2, shadow) * attenuation;
+
+ const float tmp = 1.0 / 2.2;
+ gl_FragColor = float4(pow(abs(Lo), float3(tmp, tmp, tmp)), 1.0);
+
+ /*
+ const float pointRadius = gParams.pointRadius;
+ const float4x4 gl_ProjectionMatrix = gParams.projection;
+
+ float3 eyePos = gl_TexCoord[5].xyz + normal * pointRadius;
+ float4 ndcPos = mul(gl_ProjectionMatrix, float4(eyePos, 1.0));
+ ndcPos.z /= ndcPos.w;
+ gl_FragDepth = ndcPos.z;
+ */
+
+ return gl_FragColor;
+}
diff --git a/demo/d3d11/shaders/pointPS.hlsl.h b/demo/d3d11/shaders/pointPS.hlsl.h
new file mode 100644
index 0000000..843b166
--- /dev/null
+++ b/demo/d3d11/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 xyzw 1 NONE float xy
+// TEXCOORD 1 xyzw 2 NONE float xyzw
+// TEXCOORD 2 xyzw 3 NONE float xyz
+// TEXCOORD 3 xyzw 4 NONE float xyzw
+// TEXCOORD 4 xyzw 5 NONE float
+// TEXCOORD 5 xyzw 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 4
+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
+if_z r0.w
+ lt r0.w, r2.y, l(0.000000)
+ lt r1.z, l(1.000000), r2.y
+ or r0.w, r0.w, r1.z
+ if_z r0.w
+ add r0.w, -cb0[20].y, l(1.000000)
+ mul r3.x, cb0[20].x, l(0.002000)
+ mul r3.y, r0.w, l(0.002000)
+ add r2.w, -r2.y, l(1.000000)
+ add r1.zw, r2.xxxw, r3.xxxy
+ sample_c_lz_indexable(texture2d)(float,float,float,float) r0.w, r1.zwzz, t0.xxxx, s0, r2.z
+ add r1.z, -cb0[21].y, l(1.000000)
+ mul r3.x, cb0[21].x, l(0.002000)
+ mul r3.y, r1.z, l(0.002000)
+ add r1.zw, r2.xxxw, r3.xxxy
+ sample_c_lz_indexable(texture2d)(float,float,float,float) r1.z, r1.zwzz, t0.xxxx, s0, r2.z
+ add r0.w, r0.w, r1.z
+ add r1.z, -cb0[22].y, l(1.000000)
+ mul r3.x, cb0[22].x, l(0.002000)
+ mul r3.y, r1.z, l(0.002000)
+ add r1.zw, r2.xxxw, r3.xxxy
+ sample_c_lz_indexable(texture2d)(float,float,float,float) r1.z, r1.zwzz, t0.xxxx, s0, r2.z
+ add r0.w, r0.w, r1.z
+ add r1.z, -cb0[23].y, l(1.000000)
+ mul r3.x, cb0[23].x, l(0.002000)
+ mul r3.y, r1.z, l(0.002000)
+ add r1.zw, r2.xxxw, r3.xxxy
+ sample_c_lz_indexable(texture2d)(float,float,float,float) r1.z, r1.zwzz, t0.xxxx, s0, r2.z
+ add r0.w, r0.w, r1.z
+ add r1.z, -cb0[24].y, l(1.000000)
+ mul r3.x, cb0[24].x, l(0.002000)
+ mul r3.y, r1.z, l(0.002000)
+ add r1.zw, r2.xxxw, r3.xxxy
+ sample_c_lz_indexable(texture2d)(float,float,float,float) r1.z, r1.zwzz, t0.xxxx, s0, r2.z
+ add r0.w, r0.w, r1.z
+ add r1.z, -cb0[25].y, l(1.000000)
+ mul r3.x, cb0[25].x, l(0.002000)
+ mul r3.y, r1.z, l(0.002000)
+ add r1.zw, r2.xxxw, r3.xxxy
+ sample_c_lz_indexable(texture2d)(float,float,float,float) r1.z, r1.zwzz, t0.xxxx, s0, r2.z
+ add r0.w, r0.w, r1.z
+ add r1.z, -cb0[26].y, l(1.000000)
+ mul r3.x, cb0[26].x, l(0.002000)
+ mul r3.y, r1.z, l(0.002000)
+ add r1.zw, r2.xxxw, r3.xxxy
+ sample_c_lz_indexable(texture2d)(float,float,float,float) r1.z, r1.zwzz, t0.xxxx, s0, r2.z
+ add r0.w, r0.w, r1.z
+ add r1.z, -cb0[27].y, l(1.000000)
+ mul r3.x, cb0[27].x, l(0.002000)
+ mul r3.y, r1.z, l(0.002000)
+ add r1.zw, r2.xxxw, r3.xxxy
+ sample_c_lz_indexable(texture2d)(float,float,float,float) r1.z, r1.zwzz, t0.xxxx, s0, r2.z
+ add r0.w, r0.w, r1.z
+ 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, 43, 46,
+ 192, 8, 211, 105, 212, 151,
+ 103, 8, 148, 62, 30, 192,
+ 144, 175, 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, 118, 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,
+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+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0,
+ 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/d3d11/shaders/pointVS.hlsl b/demo/d3d11/shaders/pointVS.hlsl
new file mode 100644
index 0000000..6ab4b6c
--- /dev/null
+++ b/demo/d3d11/shaders/pointVS.hlsl
@@ -0,0 +1,26 @@
+#include "shaderCommon.h"
+
+cbuffer constBuf : register(b0)
+{
+ PointShaderConst gParams;
+};
+
+PointVertexOut pointVS(PointVertexIn input, uint instance : SV_VertexID)
+{
+ const float4 gl_Vertex = input.position;
+ const float4x4 gl_ModelViewMatrix = gParams.modelview;
+
+ float density = input.density;
+ int phase = input.phase;
+
+ // calculate window-space point size
+ float4 viewPos = mul(gl_ModelViewMatrix, float4(gl_Vertex.xyz, 1.0));
+
+ PointVertexOut output;
+ output.position = viewPos;
+ output.density = density;
+ output.phase = phase;
+ output.vertex = gl_Vertex;
+
+ return output;
+}
diff --git a/demo/d3d11/shaders/pointVS.hlsl.h b/demo/d3d11/shaders/pointVS.hlsl.h
new file mode 100644
index 0000000..b78b3f1
--- /dev/null
+++ b/demo/d3d11/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, 195, 164,
+ 148, 248, 252, 197, 222, 222,
+ 84, 139, 94, 6, 43, 78,
+ 110, 120, 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,
+ 118, 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,
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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/d3d11/shaders/shaderCommon.h b/demo/d3d11/shaders/shaderCommon.h
new file mode 100644
index 0000000..176c97d
--- /dev/null
+++ b/demo/d3d11/shaders/shaderCommon.h
@@ -0,0 +1,237 @@
+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 _pad2;
+};
+
+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;
+ float4 texCoord[8] : TEXCOORD;
+ //float clipDistance[1] : CLIP_DISTANCE;
+};
+#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 position : POSITION;
+ float density : DENSITY;
+ int phase : PHASE;
+ float4 vertex : VERTEX;
+};
+
+struct PointGeoOut
+{
+ float4 position : SV_POSITION;
+ float4 texCoord[6] : TEXCOORD;
+};
+#endif
+
+struct FluidShaderConst
+{
+ float4x4 modelviewprojection;
+ float4x4 modelview;
+ float4x4 projection; // ogl projection
+ float4x4 modelview_inverse;
+ float4x4 projection_inverse; // 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 texCoord[6] : TEXCOORD;
+};
+
+struct FluidGeoOut
+{
+ float4 position : SV_POSITION;
+ float4 texCoord[4] : TEXCOORD;
+};
+
+struct PassthroughVertexIn
+{
+ float2 position : POSITION;
+ float2 texCoord : TEXCOORD;
+};
+
+struct PassthroughVertexOut
+{
+ float4 position : SV_POSITION;
+ float2 texCoord[1] : 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;
+};
+
+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;
+
+ float4 uv : UV;
+
+};
+
+#endif
+
diff --git a/demo/d3d11/shadersD3D11.cpp b/demo/d3d11/shadersD3D11.cpp
new file mode 100644
index 0000000..9e1d278
--- /dev/null
+++ b/demo/d3d11/shadersD3D11.cpp
@@ -0,0 +1,1041 @@
+#include "core/maths.h"
+#include "core/extrude.h"
+
+#include "shaders.h"
+
+#include "meshRender.h"
+#include "pointRender.h"
+#include "fluidRender.h"
+#include "diffuseRender.h"
+#include "debugLineRender.h"
+
+#include "shadowMap.h"
+#include "renderTarget.h"
+
+#include "imguiGraph.h"
+#include "imguiGraphD3D11.h"
+
+#include "appD3D11Ctx.h"
+
+#include <d3d11.h>
+#include <d3dcompiler.h>
+
+#include <cstdlib>
+
+DebugLineRender gDebugLineRender;
+MeshRenderer gMeshRenderer;
+PointRenderer gPointRenderer;
+DiffuseRenderer gDiffuseRenderer;
+
+AppGraphCtx* gAppGraphCtx;
+
+static float gSpotMin = 0.5f;
+static float gSpotMax = 1.0f;
+float gShadowBias = 0.075f;
+
+struct RenderContext
+{
+ RenderContext()
+ {
+ memset(&mMeshDrawParams, 0, sizeof(MeshDrawParams));
+ }
+
+ MeshDrawParams mMeshDrawParams;
+
+ Matrix44 view;
+ Matrix44 proj;
+
+ ShadowMap* shadowMap;
+ GpuMesh* immediateMesh;
+
+ SDL_Window* window;
+
+ int msaaSamples;
+};
+
+RenderContext gContext;
+
+
+// convert an OpenGL style projection matrix to D3D (clip z range [0, 1])
+Matrix44 ConvertToD3DProjection(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;
+}
+
+#define checkDxErrors(err) __checkDxErrors (err, __FILE__, __LINE__)
+
+inline void __checkDxErrors(HRESULT err, const char *file, const int line)
+{
+ if (FAILED(err))
+ {
+ char* lpMsgBuf;
+
+ FormatMessage(
+ FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM |
+ FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ err,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ (LPTSTR)&lpMsgBuf,
+ 0, NULL);
+
+ fprintf(stdout, "DX Error = %04d \"%s\" from file <%s>, line %i.\n",
+ err, lpMsgBuf, file, line);
+
+ exit(EXIT_FAILURE);
+ }
+}
+
+void InitRender(SDL_Window* window, bool fullscreen, int msaaSamples)
+{
+ // must always have at least one sample
+ msaaSamples = Max(1, msaaSamples);
+
+ // create app graph context
+ gAppGraphCtx = AppGraphCtxCreate(0);
+
+ AppGraphCtxInitRenderTarget(gAppGraphCtx, window, fullscreen, msaaSamples);
+ //gScene = getScene(0);
+
+ float clearVal[4] = { 0.0f, 0.0f, 0.0f, 1.0f };
+ AppGraphCtxFrameStart(gAppGraphCtx, clearVal);
+
+ // create imgui, connect to app graph context
+
+ ImguiGraphDesc desc;
+ desc.device = gAppGraphCtx->m_device;
+ desc.deviceContext = gAppGraphCtx->m_deviceContext;
+ desc.winW = gAppGraphCtx->m_winW;
+ desc.winH = gAppGraphCtx->m_winH;
+
+ imguiGraphInit("../../data/DroidSans.ttf", &desc);
+
+ AppGraphCtxFramePresent(gAppGraphCtx, true);
+
+ gPointRenderer.Init(gAppGraphCtx->m_device, gAppGraphCtx->m_deviceContext);
+ gMeshRenderer.Init(gAppGraphCtx->m_device, gAppGraphCtx->m_deviceContext);
+ gDebugLineRender.Init(gAppGraphCtx->m_device, gAppGraphCtx->m_deviceContext);
+ gDiffuseRenderer.Init(gAppGraphCtx->m_device, gAppGraphCtx->m_deviceContext);
+
+ // create a mesh for immediate mode rendering
+ gContext.immediateMesh = new GpuMesh(gAppGraphCtx->m_device, gAppGraphCtx->m_deviceContext);
+
+ gContext.window = window;
+ gContext.msaaSamples = msaaSamples;
+}
+
+void GetRenderDevice(ID3D11Device** device, ID3D11DeviceContext** context)
+{
+ *device = gAppGraphCtx->m_device;
+ *context = gAppGraphCtx->m_deviceContext;
+}
+
+void ReshapeRender(SDL_Window* window)
+{
+ AppGraphCtxReleaseRenderTarget(gAppGraphCtx);
+ AppGraphCtxInitRenderTarget(gAppGraphCtx, window, false, gContext.msaaSamples);
+}
+
+void DestroyRender()
+{
+ gDebugLineRender.Destroy();
+ gMeshRenderer.Destroy();
+ gPointRenderer.Destroy();
+ gDiffuseRenderer.Destroy();
+
+ imguiGraphDestroy();
+
+ delete gContext.immediateMesh;
+
+ // do this first, since it flushes all GPU work
+ AppGraphCtxReleaseRenderTarget(gAppGraphCtx);
+ AppGraphCtxRelease(gAppGraphCtx);
+
+ gAppGraphCtx = nullptr;
+}
+
+void StartFrame(Vec4 clear)
+{
+ AppGraphCtxFrameStart(gAppGraphCtx, clear);
+
+ MeshDrawParams meshDrawParams;
+ memset(&meshDrawParams, 0, sizeof(MeshDrawParams));
+ meshDrawParams.renderStage = MESH_DRAW_LIGHT;
+ meshDrawParams.renderMode = MESH_RENDER_SOLID;
+ meshDrawParams.cullMode = MESH_CULL_BACK;
+ meshDrawParams.projection = (XMMATRIX)Matrix44::kIdentity;
+ meshDrawParams.view = (XMMATRIX)Matrix44::kIdentity;
+ meshDrawParams.model = DirectX::XMMatrixMultiply(
+ DirectX::XMMatrixScaling(1.0f, 1.0f, 1.0f),
+ DirectX::XMMatrixTranslation(0.0f, 0.0f, 0.0f)
+ );
+
+ gContext.mMeshDrawParams = meshDrawParams;
+}
+
+void FlushFrame()
+{
+ gAppGraphCtx->m_deviceContext->Flush();
+
+}
+
+void EndFrame()
+{
+ FlushFrame();
+
+ ImguiGraphDesc desc;
+ desc.device = gAppGraphCtx->m_device;
+ desc.deviceContext = gAppGraphCtx->m_deviceContext;
+ desc.winW = gAppGraphCtx->m_winW;
+ desc.winH = gAppGraphCtx->m_winH;
+
+ imguiGraphUpdate(&desc);
+}
+
+void PresentFrame(bool fullsync)
+{
+ AppGraphCtxFramePresent(gAppGraphCtx, fullsync);
+
+}
+
+void ReadFrame(int* backbuffer, int width, int height)
+{
+ assert(0);
+}
+
+void GetViewRay(int x, int y, Vec3& origin, Vec3& dir)
+{
+ using namespace DirectX;
+
+ XMVECTOR nearVector = XMVector3Unproject(XMVectorSet(float(x), float(gAppGraphCtx->m_winH-y), 0.0f, 0.0f), 0.0f, 0.0f, (float)gAppGraphCtx->m_winW, (float)gAppGraphCtx->m_winH, 0.0f, 1.0f, (XMMATRIX)gContext.proj, XMMatrixIdentity(), (XMMATRIX)gContext.view);
+ XMVECTOR farVector = XMVector3Unproject(XMVectorSet(float(x), float(gAppGraphCtx->m_winH-y), 1.0f, 0.0f), 0.0f, 0.0f, (float)gAppGraphCtx->m_winW, (float)gAppGraphCtx->m_winH, 0.0f, 1.0f, (XMMATRIX)gContext.proj, XMMatrixIdentity(), (XMMATRIX)gContext.view);
+
+ origin = Vec3(XMVectorGetX(nearVector), XMVectorGetY(nearVector), XMVectorGetZ(nearVector));
+ XMVECTOR tmp = farVector - nearVector;
+ dir = Normalize(Vec3(XMVectorGetX(tmp), XMVectorGetY(tmp), XMVectorGetZ(tmp)));
+
+}
+
+Colour gColors[] =
+{
+ Colour(0.0f, 0.5f, 1.0f),
+ Colour(0.797f, 0.354f, 0.000f),
+ Colour(0.092f, 0.465f, 0.820f),
+ Colour(0.000f, 0.349f, 0.173f),
+ Colour(0.875f, 0.782f, 0.051f),
+ Colour(0.000f, 0.170f, 0.453f),
+ Colour(0.673f, 0.111f, 0.000f),
+ Colour(0.612f, 0.194f, 0.394f)
+};
+
+
+void SetFillMode(bool wire)
+{
+ gContext.mMeshDrawParams.renderMode = wire?MESH_RENDER_WIREFRAME:MESH_RENDER_SOLID;
+}
+
+void SetCullMode(bool enabled)
+{
+ gContext.mMeshDrawParams.cullMode = enabled?MESH_CULL_BACK:MESH_CULL_NONE;
+}
+
+void SetView(Matrix44 view, Matrix44 projection)
+{
+ Matrix44 vp = projection*view;
+
+ gContext.mMeshDrawParams.model = (XMMATRIX)Matrix44::kIdentity;
+ gContext.mMeshDrawParams.view = (XMMATRIX)view;
+ gContext.mMeshDrawParams.projection = (XMMATRIX)(ConvertToD3DProjection(projection));
+
+ gContext.view = view;
+ gContext.proj = ConvertToD3DProjection(projection);
+}
+
+
+
+FluidRenderer* CreateFluidRenderer(uint32_t width, uint32_t height)
+{
+ FluidRenderer* renderer = new(_aligned_malloc(sizeof(FluidRenderer), 16)) FluidRenderer();
+ renderer->Init(gAppGraphCtx->m_device, gAppGraphCtx->m_deviceContext, width, height);
+
+ return renderer;
+}
+
+void DestroyFluidRenderer(FluidRenderer* renderer)
+{
+ renderer->Destroy();
+ renderer->~FluidRenderer();
+
+ _aligned_free(renderer);
+}
+
+FluidRenderBuffers CreateFluidRenderBuffers(int numParticles, bool enableInterop)
+{
+ FluidRenderBuffers buffers = {};
+ buffers.mNumFluidParticles = numParticles;
+
+ {
+ D3D11_BUFFER_DESC bufDesc;
+ bufDesc.ByteWidth = numParticles*sizeof(Vec4);
+ bufDesc.Usage = D3D11_USAGE_DYNAMIC;
+ bufDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
+ bufDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
+ bufDesc.MiscFlags = 0;
+ bufDesc.StructureByteStride = 0;
+
+ gAppGraphCtx->m_device->CreateBuffer(&bufDesc, NULL, &buffers.mPositionVBO);
+
+ gAppGraphCtx->m_device->CreateBuffer(&bufDesc, NULL, &buffers.mAnisotropyVBO[0]);
+ gAppGraphCtx->m_device->CreateBuffer(&bufDesc, NULL, &buffers.mAnisotropyVBO[1]);
+ gAppGraphCtx->m_device->CreateBuffer(&bufDesc, NULL, &buffers.mAnisotropyVBO[2]);
+
+ bufDesc.ByteWidth = numParticles*sizeof(float);
+ gAppGraphCtx->m_device->CreateBuffer(&bufDesc, NULL, &buffers.mDensityVBO);
+ }
+
+ {
+ D3D11_BUFFER_DESC bufDesc;
+ bufDesc.ByteWidth = numParticles * sizeof(int);
+ bufDesc.Usage = D3D11_USAGE_DYNAMIC;
+ bufDesc.BindFlags = D3D11_BIND_INDEX_BUFFER;
+ bufDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
+ bufDesc.MiscFlags = 0;
+ bufDesc.StructureByteStride = 0;
+
+ gAppGraphCtx->m_device->CreateBuffer(&bufDesc, NULL, &buffers.mIndices);
+ }
+
+ if (enableInterop)
+ {
+ extern NvFlexLibrary* g_flexLib;
+
+ buffers.mPositionBuf = NvFlexRegisterD3DBuffer(g_flexLib, buffers.mPositionVBO, numParticles, sizeof(Vec4));
+ buffers.mDensitiesBuf = NvFlexRegisterD3DBuffer(g_flexLib, buffers.mDensityVBO, numParticles, sizeof(float));
+ buffers.mIndicesBuf = NvFlexRegisterD3DBuffer(g_flexLib, buffers.mIndices, numParticles, sizeof(int));
+
+ buffers.mAnisotropyBuf[0] = NvFlexRegisterD3DBuffer(g_flexLib, buffers.mAnisotropyVBO[0], numParticles, sizeof(Vec4));
+ buffers.mAnisotropyBuf[1] = NvFlexRegisterD3DBuffer(g_flexLib, buffers.mAnisotropyVBO[1], numParticles, sizeof(Vec4));
+ buffers.mAnisotropyBuf[2] = NvFlexRegisterD3DBuffer(g_flexLib, buffers.mAnisotropyVBO[2], numParticles, sizeof(Vec4));
+ }
+
+ return buffers;
+}
+
+void UpdateFluidRenderBuffers(FluidRenderBuffers buffers, NvFlexSolver* solver, bool anisotropy, bool density)
+{
+ if (!anisotropy)
+ {
+ // regular particles
+ NvFlexGetParticles(solver, buffers.mPositionBuf, buffers.mNumFluidParticles);
+ }
+ else
+ {
+ // fluid buffers
+ NvFlexGetSmoothParticles(solver, buffers.mPositionBuf, buffers.mNumFluidParticles);
+ NvFlexGetAnisotropy(solver, buffers.mAnisotropyBuf[0], buffers.mAnisotropyBuf[1], buffers.mAnisotropyBuf[2]);
+ }
+
+ if (density)
+ {
+ NvFlexGetDensities(solver, buffers.mDensitiesBuf, buffers.mNumFluidParticles);
+ }
+ else
+ {
+ NvFlexGetPhases(solver, buffers.mDensitiesBuf, buffers.mNumFluidParticles);
+ }
+
+ NvFlexGetActive(solver, buffers.mIndicesBuf);
+}
+
+void UpdateFluidRenderBuffers(FluidRenderBuffers buffers, Vec4* particles, float* densities, Vec4* anisotropy1, Vec4* anisotropy2, Vec4* anisotropy3, int numParticles, int* indices, int numIndices)
+{
+ D3D11_MAPPED_SUBRESOURCE res;
+
+ // vertices
+ if (particles)
+ {
+ gAppGraphCtx->m_deviceContext->Map(buffers.mPositionVBO, 0, D3D11_MAP_WRITE_DISCARD, 0, &res);
+ memcpy(res.pData, particles, sizeof(Vec4)*numParticles);
+ gAppGraphCtx->m_deviceContext->Unmap(buffers.mPositionVBO, 0);
+ }
+
+ if (anisotropy1)
+ {
+ gAppGraphCtx->m_deviceContext->Map(buffers.mAnisotropyVBO[0], 0, D3D11_MAP_WRITE_DISCARD, 0, &res);
+ memcpy(res.pData, anisotropy1, sizeof(Vec4)*numParticles);
+ gAppGraphCtx->m_deviceContext->Unmap(buffers.mAnisotropyVBO[0], 0);
+ }
+
+ if (anisotropy2)
+ {
+ gAppGraphCtx->m_deviceContext->Map(buffers.mAnisotropyVBO[1], 0, D3D11_MAP_WRITE_DISCARD, 0, &res);
+ memcpy(res.pData, anisotropy2, sizeof(Vec4)*numParticles);
+ gAppGraphCtx->m_deviceContext->Unmap(buffers.mAnisotropyVBO[1], 0);
+ }
+
+ if (anisotropy3)
+ {
+ gAppGraphCtx->m_deviceContext->Map(buffers.mAnisotropyVBO[2], 0, D3D11_MAP_WRITE_DISCARD, 0, &res);
+ memcpy(res.pData, anisotropy3, sizeof(Vec4)*numParticles);
+ gAppGraphCtx->m_deviceContext->Unmap(buffers.mAnisotropyVBO[2], 0);
+ }
+
+ if (densities)
+ {
+ gAppGraphCtx->m_deviceContext->Map(buffers.mDensityVBO, 0, D3D11_MAP_WRITE_DISCARD, 0, &res);
+ memcpy(res.pData, densities, sizeof(float)*numParticles);
+ gAppGraphCtx->m_deviceContext->Unmap(buffers.mDensityVBO, 0);
+ }
+
+ // indices
+ if (indices)
+ {
+ gAppGraphCtx->m_deviceContext->Map(buffers.mIndices, 0, D3D11_MAP_WRITE_DISCARD, 0, &res);
+ memcpy(res.pData, indices, sizeof(int)*numIndices);
+ gAppGraphCtx->m_deviceContext->Unmap(buffers.mIndices, 0);
+ }
+
+}
+
+void DestroyFluidRenderBuffers(FluidRenderBuffers buffers)
+{
+ COMRelease(buffers.mPositionVBO);
+ COMRelease(buffers.mAnisotropyVBO[0]);
+ COMRelease(buffers.mAnisotropyVBO[1]);
+ COMRelease(buffers.mAnisotropyVBO[2]);
+ COMRelease(buffers.mDensityVBO);
+ COMRelease(buffers.mIndices);
+
+ NvFlexUnregisterD3DBuffer(buffers.mPositionBuf);
+ NvFlexUnregisterD3DBuffer(buffers.mDensitiesBuf);
+ NvFlexUnregisterD3DBuffer(buffers.mIndicesBuf);
+
+ NvFlexUnregisterD3DBuffer(buffers.mAnisotropyBuf[0]);
+ NvFlexUnregisterD3DBuffer(buffers.mAnisotropyBuf[1]);
+ NvFlexUnregisterD3DBuffer(buffers.mAnisotropyBuf[2]);
+}
+
+
+static const int kShadowResolution = 2048;
+
+
+ShadowMap* ShadowCreate()
+{
+ ShadowMap* shadowMap = new(_aligned_malloc(sizeof(ShadowMap), 16)) ShadowMap();
+ shadowMap->init(gAppGraphCtx->m_device, kShadowResolution);
+
+ return shadowMap;
+}
+
+void ShadowDestroy(ShadowMap* map)
+{
+ map->~ShadowMap();
+ _aligned_free(map);
+}
+
+void ShadowBegin(ShadowMap* map)
+{
+ ShadowMap* shadowMap = map;
+ shadowMap->bindAndClear(gAppGraphCtx->m_deviceContext);
+
+ gContext.mMeshDrawParams.renderStage = MESH_DRAW_SHADOW;
+}
+
+void ShadowEnd()
+{
+ AppGraphCtx* context = gAppGraphCtx;
+
+ // reset to main frame buffer
+ context->m_deviceContext->RSSetViewports(1, &context->m_viewport);
+ context->m_deviceContext->OMSetRenderTargets(1, &context->m_rtv, context->m_dsv);
+ context->m_deviceContext->OMSetDepthStencilState(context->m_depthState, 0u);
+ context->m_deviceContext->ClearDepthStencilView(context->m_dsv, D3D11_CLEAR_DEPTH, 1.0, 0);
+
+ gContext.mMeshDrawParams.renderStage = MESH_DRAW_NULL;
+
+}
+
+
+struct ShadowParams
+{
+ DirectX::XMMATRIX lightTransform;
+ float3 lightPos;
+ float3 lightDir;
+ float bias;
+ float4 shadowTaps[12];
+};
+
+void ShadowApply(ShadowParams* params, Vec3 lightPos, Vec3 lightTarget, Matrix44 lightTransform, void* shadowTex)
+{
+ params->lightTransform = (DirectX::XMMATRIX&)(ConvertToD3DProjection(lightTransform));
+ params->lightPos = (float3&)lightPos;
+ params->lightDir = (float3&)Normalize(lightTarget - lightPos);
+ params->bias = gShadowBias;
+
+ 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(params->shadowTaps, taps, sizeof(taps));
+
+}
+
+void BindSolidShader(Vec3 lightPos, Vec3 lightTarget, Matrix44 lightTransform, ShadowMap* shadowMap, float bias, Vec4 fogColor)
+{
+ gContext.mMeshDrawParams.renderStage = MESH_DRAW_LIGHT;
+
+ gContext.mMeshDrawParams.grid = 0;
+ gContext.mMeshDrawParams.spotMin = gSpotMin;
+ gContext.mMeshDrawParams.spotMax = gSpotMax;
+ gContext.mMeshDrawParams.fogColor = (float4&)fogColor;
+
+ gContext.mMeshDrawParams.objectTransform = (float4x4&)Matrix44::kIdentity;
+
+ ShadowParams shadow;
+ ShadowApply(&shadow, lightPos, lightTarget, lightTransform, shadowMap);
+ gContext.mMeshDrawParams.lightTransform = shadow.lightTransform;
+ gContext.mMeshDrawParams.lightDir = shadow.lightDir;
+ gContext.mMeshDrawParams.lightPos = shadow.lightPos;
+ gContext.mMeshDrawParams.bias = shadow.bias;
+ memcpy(gContext.mMeshDrawParams.shadowTaps, shadow.shadowTaps, sizeof(shadow.shadowTaps));
+
+ gContext.shadowMap = shadowMap;
+
+}
+
+void UnbindSolidShader()
+{
+ gContext.mMeshDrawParams.renderStage = MESH_DRAW_NULL;
+}
+
+void DrawMesh(const Mesh* m, Vec3 color)
+{
+ if (m)
+ {
+ if (m->m_colours.size())
+ {
+ gContext.mMeshDrawParams.colorArray = 1;
+ gContext.immediateMesh->UpdateData((Vec3*)&m->m_positions[0], &m->m_normals[0], NULL, (Vec4*)&m->m_colours[0], (int*)&m->m_indices[0], m->GetNumVertices(), int(m->GetNumFaces()));
+ }
+ else
+ {
+ gContext.mMeshDrawParams.colorArray = 0;
+ gContext.immediateMesh->UpdateData((Vec3*)&m->m_positions[0], &m->m_normals[0], NULL, NULL, (int*)&m->m_indices[0], m->GetNumVertices(), int(m->GetNumFaces()));
+ }
+
+ gContext.mMeshDrawParams.color = (float4&)color;
+ gContext.mMeshDrawParams.secondaryColor = (float4&)color;
+ gContext.mMeshDrawParams.objectTransform = (float4x4&)Matrix44::kIdentity;
+ gContext.mMeshDrawParams.shadowMap = gContext.shadowMap;
+
+ gMeshRenderer.Draw(gContext.immediateMesh, &gContext.mMeshDrawParams);
+
+ if (m->m_colours.size())
+ gContext.mMeshDrawParams.colorArray = 0;
+
+ }
+}
+
+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)
+{
+ if (!numTris)
+ return;
+
+ gContext.immediateMesh->UpdateData(positions, normals, NULL, NULL, indices, numPositions, numTris);
+
+ if (twosided)
+ SetCullMode(false);
+
+ gContext.mMeshDrawParams.bias = 0.0f;
+ gContext.mMeshDrawParams.expand = expand;
+
+ gContext.mMeshDrawParams.color = (float4&)(gColors[colorIndex + 1] * 1.5f);
+ gContext.mMeshDrawParams.secondaryColor = (float4&)(gColors[colorIndex] * 1.5f);
+ gContext.mMeshDrawParams.objectTransform = (float4x4&)Matrix44::kIdentity;
+ gContext.mMeshDrawParams.shadowMap = gContext.shadowMap;
+
+ gMeshRenderer.Draw(gContext.immediateMesh, &gContext.mMeshDrawParams);
+
+ if (twosided)
+ SetCullMode(true);
+
+ gContext.mMeshDrawParams.bias = gShadowBias;
+ gContext.mMeshDrawParams.expand = 0.0f;
+
+}
+
+void DrawRope(Vec4* positions, int* indices, int numIndices, float radius, int color)
+{
+ if (numIndices < 2)
+ return;
+
+ std::vector<Vec3> vertices;
+ std::vector<Vec3> normals;
+ std::vector<int> triangles;
+
+ // flatten curve
+ std::vector<Vec3> curve(numIndices);
+ for (int i = 0; i < numIndices; ++i)
+ curve[i] = Vec3(positions[indices[i]]);
+
+ const int resolution = 8;
+ const int smoothing = 3;
+
+ vertices.reserve(resolution*numIndices*smoothing);
+ normals.reserve(resolution*numIndices*smoothing);
+ triangles.reserve(numIndices*resolution * 6 * smoothing);
+
+ Extrude(&curve[0], int(curve.size()), vertices, normals, triangles, radius, resolution, smoothing);
+
+ gContext.immediateMesh->UpdateData(&vertices[0], &normals[0], NULL, NULL, &triangles[0], int(vertices.size()), int(triangles.size())/3);
+
+ SetCullMode(false);
+
+ gContext.mMeshDrawParams.color = (float4&)(gColors[color % 8] * 1.5f);
+ gContext.mMeshDrawParams.secondaryColor = (float4&)(gColors[color % 8] * 1.5f);
+ gContext.mMeshDrawParams.objectTransform = (float4x4&)Matrix44::kIdentity;
+ gContext.mMeshDrawParams.shadowMap = gContext.shadowMap;
+
+ gMeshRenderer.Draw(gContext.immediateMesh, &gContext.mMeshDrawParams);
+
+ SetCullMode(true);
+}
+
+void DrawPlane(const Vec4& p, bool color)
+{
+ std::vector<Vec3> vertices;
+ std::vector<Vec3> normals;
+ std::vector<int> indices;
+
+ Vec3 u, v;
+ BasisFromVector(Vec3(p.x, p.y, p.z), &u, &v);
+
+ Vec3 c = Vec3(p.x, p.y, p.z)*-p.w;
+
+ gContext.mMeshDrawParams.shadowMap = gContext.shadowMap;
+
+ if (color)
+ gContext.mMeshDrawParams.color = (float4&)(p * 0.5f + Vec4(0.5f, 0.5f, 0.5f, 0.5f));
+
+ const float kSize = 200.0f;
+ const int kGrid = 3;
+
+ // draw a grid of quads, otherwise z precision suffers
+ for (int x = -kGrid; x <= kGrid; ++x)
+ {
+ for (int y = -kGrid; y <= kGrid; ++y)
+ {
+ Vec3 coff = c + u*float(x)*kSize*2.0f + v*float(y)*kSize*2.0f;
+
+ int indexStart = int(vertices.size());
+
+ vertices.push_back(Vec3(coff + u*kSize + v*kSize));
+ vertices.push_back(Vec3(coff - u*kSize + v*kSize));
+ vertices.push_back(Vec3(coff - u*kSize - v*kSize));
+ vertices.push_back(Vec3(coff + u*kSize - v*kSize));
+
+ normals.push_back(Vec3(p.x, p.y, p.z));
+ normals.push_back(Vec3(p.x, p.y, p.z));
+ normals.push_back(Vec3(p.x, p.y, p.z));
+ normals.push_back(Vec3(p.x, p.y, p.z));
+
+
+ indices.push_back(indexStart+0);
+ indices.push_back(indexStart+1);
+ indices.push_back(indexStart+2);
+
+ indices.push_back(indexStart+2);
+ indices.push_back(indexStart+3);
+ indices.push_back(indexStart+0);
+ }
+ }
+
+ gContext.immediateMesh->UpdateData(&vertices[0], &normals[0], NULL, NULL, &indices[0], int(vertices.size()), int(indices.size())/3);
+ gMeshRenderer.Draw(gContext.immediateMesh, &gContext.mMeshDrawParams);
+}
+
+void DrawPlanes(Vec4* planes, int n, float bias)
+{
+ gContext.mMeshDrawParams.color = (float4&)Vec4(0.9f, 0.9f, 0.9f, 1.0f);
+
+ gContext.mMeshDrawParams.bias = 0.0f;
+ gContext.mMeshDrawParams.grid = 1;
+ gContext.mMeshDrawParams.expand = 0;
+
+ for (int i = 0; i < n; ++i)
+ {
+ Vec4 p = planes[i];
+ p.w -= bias;
+
+ DrawPlane(p, false);
+ }
+
+ gContext.mMeshDrawParams.grid = 0;
+ gContext.mMeshDrawParams.bias = gShadowBias;
+
+}
+
+GpuMesh* CreateGpuMesh(const Mesh* m)
+{
+ GpuMesh* mesh = new GpuMesh(gAppGraphCtx->m_device, gAppGraphCtx->m_deviceContext);
+
+ mesh->UpdateData((Vec3*)&m->m_positions[0], &m->m_normals[0], NULL, NULL, (int*)&m->m_indices[0], m->GetNumVertices(), int(m->GetNumFaces()));
+
+ return mesh;
+}
+
+void DestroyGpuMesh(GpuMesh* m)
+{
+ delete m;
+}
+
+void DrawGpuMesh(GpuMesh* m, const Matrix44& xform, const Vec3& color)
+{
+ if (m)
+ {
+ MeshDrawParams params = gContext.mMeshDrawParams;
+
+ params.color = (float4&)color;
+ params.secondaryColor = (float4&)color;
+ params.objectTransform = (float4x4&)xform;
+ params.shadowMap = gContext.shadowMap;
+
+ gMeshRenderer.Draw(m, &params);
+ }
+}
+
+void DrawGpuMeshInstances(GpuMesh* m, const Matrix44* xforms, int n, const Vec3& color)
+{
+ if (m)
+ {
+ gContext.mMeshDrawParams.color = (float4&)color;
+ gContext.mMeshDrawParams.secondaryColor = (float4&)color;
+ gContext.mMeshDrawParams.shadowMap = gContext.shadowMap;
+
+ // copy params
+ MeshDrawParams params = gContext.mMeshDrawParams;
+
+ for (int i = 0; i < n; ++i)
+ {
+ params.objectTransform = (float4x4&)xforms[i];
+
+ gMeshRenderer.Draw(m, &params);
+ }
+ }
+}
+
+void DrawPoints(VertexBuffer positions, VertexBuffer colors, IndexBuffer indices, int n, int offset, float radius, float screenWidth, float screenAspect, float fov, Vec3 lightPos, Vec3 lightTarget, Matrix44 lightTransform, ShadowMap* shadowTex, bool showDensity)
+{
+ if (n == 0)
+ return;
+
+ PointDrawParams params;
+
+ params.renderMode = POINT_RENDER_SOLID;
+ params.cullMode = POINT_CULL_BACK;
+ params.model = (XMMATRIX&)Matrix44::kIdentity;
+ params.view = (XMMATRIX&)gContext.view;
+ params.projection = (XMMATRIX&)gContext.proj;
+
+ params.pointRadius = radius;
+ params.pointScale = screenWidth / screenAspect * (1.0f / (tanf(fov * 0.5f)));
+ params.spotMin = gSpotMin;
+ params.spotMax = gSpotMax;
+
+ int mode = 0;
+ if (showDensity)
+ mode = 1;
+ if (shadowTex == 0)
+ mode = 2;
+ params.mode = mode;
+
+ for (int i = 0; i < 8; i++)
+ params.colors[i] = *((float4*)&gColors[i].r);
+
+ // set shadow parameters
+ ShadowParams shadow;
+ ShadowApply(&shadow, lightPos, lightTarget, lightTransform, shadowTex);
+ params.lightTransform = shadow.lightTransform;
+ params.lightDir = shadow.lightDir;
+ params.lightPos = shadow.lightPos;
+ memcpy(params.shadowTaps, shadow.shadowTaps, sizeof(shadow.shadowTaps));
+
+ if (gContext.mMeshDrawParams.renderStage == MESH_DRAW_SHADOW)
+ {
+ params.renderStage = POINT_DRAW_SHADOW;
+ params.mode = 2;
+ }
+ else
+ params.renderStage = POINT_DRAW_LIGHT;
+
+ params.shadowMap = gContext.shadowMap;
+
+ gPointRenderer.Draw(&params, positions, colors, indices, n, offset);
+
+}
+
+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)
+{
+ if (n == 0)
+ return;
+
+ FluidDrawParams params;
+
+ params.renderMode = FLUID_RENDER_SOLID;
+ params.cullMode = FLUID_CULL_BACK;
+ params.model = (XMMATRIX&)Matrix44::kIdentity;
+ params.view = (XMMATRIX&)gContext.view;
+ params.projection = (XMMATRIX&)gContext.proj;
+
+ params.offset = offset;
+ params.n = n;
+ params.renderStage = FLUID_DRAW_LIGHT;
+
+ const float viewHeight = tanf(fov / 2.0f);
+ params.invViewport = float3(1.0f / screenWidth, screenAspect / screenWidth, 1.0f);
+ params.invProjection = float3(screenAspect * viewHeight, viewHeight, 1.0f);
+
+ params.shadowMap = gContext.shadowMap;
+
+ renderer->mDepthTex.BindAndClear(gAppGraphCtx->m_deviceContext);
+
+ // draw static shapes into depth buffer
+ //DrawShapes();
+
+ renderer->DrawEllipsoids(&params, &buffers);
+
+
+ //---------------------------------------------------------------
+ // build smooth depth
+
+ renderer->mDepthSmoothTex.BindAndClear(gAppGraphCtx->m_deviceContext);
+
+ params.blurRadiusWorld = radius * 0.5f;
+ params.blurScale = screenWidth / screenAspect * (1.0f / (tanf(fov * 0.5f)));
+ params.invTexScale = float4(1.0f / screenAspect, 1.0f, 0.0f, 0.0f);
+ params.blurFalloff = blur;
+ params.debug = debug;
+
+ renderer->DrawBlurDepth(&params);
+
+ //---------------------------------------------------------------
+ // composite
+
+ AppGraphCtx* context = gAppGraphCtx;
+
+ {
+ context->m_deviceContext->RSSetViewports(1, &context->m_viewport);
+ context->m_deviceContext->RSSetScissorRects(0, nullptr);
+
+ context->m_deviceContext->OMSetRenderTargets(1, &context->m_rtv, context->m_dsv);
+ context->m_deviceContext->OMSetDepthStencilState(context->m_depthState, 0u);
+
+ float blendFactor[4] = { 1.0, 1.0, 1.0, 1.0 };
+ context->m_deviceContext->OMSetBlendState(context->m_blendState, blendFactor, 0xffff);
+ }
+
+ params.invTexScale = (float4&)Vec2(1.0f / screenWidth, screenAspect / screenWidth);
+ params.clipPosToEye = (float4&)Vec2(tanf(fov*0.5f)*screenAspect, tanf(fov*0.5f));
+ params.color = (float4&)color;
+ params.ior = ior;
+ params.spotMin = gSpotMin;
+ params.spotMax = gSpotMax;
+ params.debug = debug;
+
+ params.lightPos = (float3&)lightPos;
+ params.lightDir = (float3&)-Normalize(lightTarget - lightPos);
+ params.lightTransform = (XMMATRIX&)(ConvertToD3DProjection(lightTransform));
+
+
+ AppGraphCtxResolveFrame(context);
+
+
+ renderer->DrawComposite(&params, context->m_resolvedTargetSRV);
+
+ {
+ AppGraphCtx* context = gAppGraphCtx;
+ context->m_deviceContext->OMSetBlendState(nullptr, 0, 0xffff);
+ }
+}
+
+DiffuseRenderBuffers CreateDiffuseRenderBuffers(int numParticles, bool& enableInterop)
+{
+ DiffuseRenderBuffers buffers = {};
+ buffers.mNumDiffuseParticles = numParticles;
+ if (numParticles > 0)
+ {
+ {
+ D3D11_BUFFER_DESC bufDesc;
+ bufDesc.ByteWidth = numParticles * sizeof(Vec4);
+ bufDesc.Usage = D3D11_USAGE_DYNAMIC;
+ bufDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
+ bufDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
+ bufDesc.MiscFlags = 0;
+ if (enableInterop)
+ {
+ bufDesc.CPUAccessFlags = 0;
+ bufDesc.Usage = D3D11_USAGE_DEFAULT;
+ bufDesc.MiscFlags = D3D11_RESOURCE_MISC_SHARED;
+ }
+
+ gAppGraphCtx->m_device->CreateBuffer(&bufDesc, NULL, &buffers.mDiffusePositionVBO);
+ gAppGraphCtx->m_device->CreateBuffer(&bufDesc, NULL, &buffers.mDiffuseVelocityVBO);
+ }
+
+ {
+ D3D11_BUFFER_DESC bufDesc;
+ bufDesc.ByteWidth = numParticles * sizeof(int);
+ bufDesc.Usage = D3D11_USAGE_DYNAMIC;
+ bufDesc.BindFlags = D3D11_BIND_INDEX_BUFFER;
+ bufDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
+ bufDesc.MiscFlags = 0;
+ if (enableInterop)
+ {
+ bufDesc.CPUAccessFlags = 0;
+ bufDesc.Usage = D3D11_USAGE_DEFAULT;
+ bufDesc.MiscFlags = D3D11_RESOURCE_MISC_SHARED;
+ }
+
+ gAppGraphCtx->m_device->CreateBuffer(&bufDesc, NULL, &buffers.mDiffuseIndicesIBO);
+ }
+
+ if (enableInterop)
+ {
+ extern NvFlexLibrary* g_flexLib;
+
+ buffers.mDiffuseIndicesBuf = NvFlexRegisterD3DBuffer(g_flexLib, buffers.mDiffuseIndicesIBO, numParticles, sizeof(int));
+ buffers.mDiffusePositionsBuf = NvFlexRegisterD3DBuffer(g_flexLib, buffers.mDiffusePositionVBO, numParticles, sizeof(Vec4));
+ buffers.mDiffuseVelocitiesBuf = NvFlexRegisterD3DBuffer(g_flexLib, buffers.mDiffuseVelocityVBO, numParticles, sizeof(Vec4));
+
+ if (buffers.mDiffuseIndicesBuf == nullptr ||
+ buffers.mDiffusePositionsBuf == nullptr ||
+ buffers.mDiffuseVelocitiesBuf == nullptr)
+ enableInterop = false;
+ }
+ }
+
+ return buffers;
+}
+
+void DestroyDiffuseRenderBuffers(DiffuseRenderBuffers buffers)
+{
+ if (buffers.mNumDiffuseParticles > 0)
+ {
+ COMRelease(buffers.mDiffusePositionVBO);
+ COMRelease(buffers.mDiffuseVelocityVBO);
+ COMRelease(buffers.mDiffuseIndicesIBO);
+
+ NvFlexUnregisterD3DBuffer(buffers.mDiffuseIndicesBuf);
+ NvFlexUnregisterD3DBuffer(buffers.mDiffusePositionsBuf);
+ NvFlexUnregisterD3DBuffer(buffers.mDiffuseVelocitiesBuf);
+ }
+}
+
+void UpdateDiffuseRenderBuffers(DiffuseRenderBuffers buffers, NvFlexSolver* solver)
+{
+ // diffuse particles
+ if (buffers.mNumDiffuseParticles)
+ {
+ NvFlexGetDiffuseParticles(solver, buffers.mDiffusePositionsBuf, buffers.mDiffuseVelocitiesBuf, buffers.mDiffuseIndicesBuf);
+ }
+}
+
+void UpdateDiffuseRenderBuffers(DiffuseRenderBuffers buffers, Vec4* diffusePositions, Vec4* diffuseVelocities, int* diffuseIndices, int numDiffuseParticles)
+{
+ D3D11_MAPPED_SUBRESOURCE res;
+
+ // vertices
+ if (diffusePositions)
+ {
+ gAppGraphCtx->m_deviceContext->Map(buffers.mDiffusePositionVBO, 0, D3D11_MAP_WRITE_DISCARD, 0, &res);
+ memcpy(res.pData, diffusePositions, sizeof(Vec4)*numDiffuseParticles);
+ gAppGraphCtx->m_deviceContext->Unmap(buffers.mDiffusePositionVBO, 0);
+ }
+
+ if (diffuseVelocities)
+ {
+ gAppGraphCtx->m_deviceContext->Map(buffers.mDiffuseVelocityVBO, 0, D3D11_MAP_WRITE_DISCARD, 0, &res);
+ memcpy(res.pData, diffuseVelocities, sizeof(Vec4)*numDiffuseParticles);
+ gAppGraphCtx->m_deviceContext->Unmap(buffers.mDiffuseVelocityVBO, 0);
+ }
+
+ if (diffuseIndices)
+ {
+ gAppGraphCtx->m_deviceContext->Map(buffers.mDiffuseIndicesIBO, 0, D3D11_MAP_WRITE_DISCARD, 0, &res);
+ memcpy(res.pData, diffuseIndices, sizeof(int)*numDiffuseParticles);
+ gAppGraphCtx->m_deviceContext->Unmap(buffers.mDiffuseIndicesIBO, 0);
+ }
+
+}
+
+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)
+{
+ if (n == 0)
+ return;
+
+ DiffuseDrawParams params;
+
+ params.model = (const XMMATRIX&)Matrix44::kIdentity;
+ params.view = (const XMMATRIX&)gContext.view;
+ params.projection = (const XMMATRIX&)gContext.proj;
+ params.diffuseRadius = screenWidth / screenAspect * (1.0f / (tanf(fov * 0.5f)));
+ params.diffuseScale = radius;
+ params.spotMin = gSpotMin;
+ params.spotMax = gSpotMax;
+ params.color = float4(1.0f, 1.0f, 1.0f, 1.0f);
+ params.motionScale = motionBlur;
+
+ // set shadow parameters
+ ShadowParams shadow;
+ ShadowApply(&shadow, lightPos, lightTarget, lightTransform, shadowMap);
+ params.lightTransform = shadow.lightTransform;
+ params.lightDir = shadow.lightDir;
+ params.lightPos = shadow.lightPos;
+ params.shadowMap = gContext.shadowMap;
+
+ memcpy(params.shadowTaps, shadow.shadowTaps, sizeof(shadow.shadowTaps));
+
+
+ gDiffuseRenderer.Draw(&params, buffers.mDiffusePositionVBO, buffers.mDiffuseVelocityVBO, buffers.mDiffuseIndicesIBO, n);
+
+ // reset depth stencil state
+ gAppGraphCtx->m_deviceContext->OMSetDepthStencilState(gAppGraphCtx->m_depthState, 0u);
+
+
+}
+
+
+void BeginLines()
+{
+
+}
+
+void DrawLine(const Vec3& p, const Vec3& q, const Vec4& color)
+{
+ gDebugLineRender.AddLine(p, q, color);
+}
+
+void EndLines()
+{
+ // draw
+ Matrix44 projectionViewWorld = ((Matrix44&)(gContext.mMeshDrawParams.projection))*((Matrix44&)(gContext.mMeshDrawParams.view));
+
+ gDebugLineRender.FlushLines(projectionViewWorld);
+}
+
+void BeginPoints(float size) {}
+void DrawPoint(const Vec3& p, const Vec4& color) {}
+void EndPoints() {}
+
diff --git a/demo/d3d11/shadowMap.cpp b/demo/d3d11/shadowMap.cpp
new file mode 100644
index 0000000..403ec59
--- /dev/null
+++ b/demo/d3d11/shadowMap.cpp
@@ -0,0 +1,162 @@
+/*
+ * 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 "shadowMap.h"
+
+ShadowMap::ShadowMap()
+{
+}
+
+static D3D11_TEXTURE2D_DESC _getTextureDesc(DXGI_FORMAT format, UINT width, UINT height,
+ UINT bindFlags, UINT sampleCount = 1, D3D11_USAGE usage = D3D11_USAGE_DEFAULT, UINT cpuAccessFlags = 0,
+ UINT miscFlags = 0, UINT arraySize = 1, UINT mipLevels = 1)
+{
+ D3D11_TEXTURE2D_DESC desc;
+ desc.Format = format;
+ desc.Width = width;
+ desc.Height = height;
+
+ desc.ArraySize = arraySize;
+ desc.MiscFlags = miscFlags;
+ desc.MipLevels = mipLevels;
+
+ desc.SampleDesc.Count = sampleCount;
+ desc.SampleDesc.Quality = 0;
+ desc.BindFlags = bindFlags;
+ desc.Usage = usage;
+ desc.CPUAccessFlags = cpuAccessFlags;
+ return desc;
+}
+
+static D3D11_DEPTH_STENCIL_VIEW_DESC _getDsvDesc(DXGI_FORMAT format, D3D11_DSV_DIMENSION viewDimension, UINT flags = 0, UINT mipSlice = 0)
+{
+ D3D11_DEPTH_STENCIL_VIEW_DESC desc;
+ desc.Format = format;
+ desc.ViewDimension = viewDimension;
+ desc.Flags = flags;
+ desc.Texture2D.MipSlice = mipSlice;
+ return desc;
+}
+
+static D3D11_SHADER_RESOURCE_VIEW_DESC _getSrvDesc(DXGI_FORMAT format)
+{
+ D3D11_SHADER_RESOURCE_VIEW_DESC desc;
+ desc.Format = format;
+ desc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D;
+ desc.Texture2D.MostDetailedMip = 0;
+ desc.Texture2D.MipLevels = -1;
+
+ return desc;
+}
+
+HRESULT ShadowMap::init(ID3D11Device* device, int resolution)
+{
+ // set viewport
+ {
+ m_viewport.Width = float(resolution);
+ m_viewport.Height = float(resolution);
+ m_viewport.MinDepth = 0;
+ m_viewport.MaxDepth = 1;
+ m_viewport.TopLeftX = 0;
+ m_viewport.TopLeftY = 0;
+ }
+
+ // create shadow render target
+ {
+ D3D11_TEXTURE2D_DESC texDesc = _getTextureDesc(DXGI_FORMAT_R32_FLOAT, UINT(resolution), UINT(resolution),
+ D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE);
+
+ NV_RETURN_ON_FAIL(device->CreateTexture2D(&texDesc, NV_NULL, m_backTexture.ReleaseAndGetAddressOf()));
+ NV_RETURN_ON_FAIL(device->CreateShaderResourceView(m_backTexture.Get(), NV_NULL, m_backSrv.ReleaseAndGetAddressOf()));
+ NV_RETURN_ON_FAIL(device->CreateRenderTargetView(m_backTexture.Get(), NV_NULL, m_backRtv.ReleaseAndGetAddressOf()));
+ }
+
+ // create shadow depth stencil
+ {
+ D3D11_TEXTURE2D_DESC texDesc = _getTextureDesc(DXGI_FORMAT_R32_TYPELESS, UINT(resolution), UINT(resolution),
+ D3D11_BIND_DEPTH_STENCIL | D3D11_BIND_SHADER_RESOURCE);
+ NV_RETURN_ON_FAIL(device->CreateTexture2D(&texDesc, NV_NULL, m_depthTexture.ReleaseAndGetAddressOf()));
+
+ D3D11_DEPTH_STENCIL_VIEW_DESC dsvDesc = _getDsvDesc(DXGI_FORMAT_D32_FLOAT, D3D11_DSV_DIMENSION_TEXTURE2D);
+ NV_RETURN_ON_FAIL(device->CreateDepthStencilView(m_depthTexture.Get(), &dsvDesc, m_depthDsv.ReleaseAndGetAddressOf()));
+
+ D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc = _getSrvDesc(DXGI_FORMAT_R32_FLOAT);
+ NV_RETURN_ON_FAIL(device->CreateShaderResourceView(m_depthTexture.Get(), &srvDesc, m_depthSrv.ReleaseAndGetAddressOf()));
+ }
+
+ {
+ // example texture sampler (use any texture sampler of your own choice)
+ D3D11_SAMPLER_DESC samplerDesc =
+ {
+ D3D11_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR,
+ D3D11_TEXTURE_ADDRESS_CLAMP,
+ D3D11_TEXTURE_ADDRESS_CLAMP,
+ D3D11_TEXTURE_ADDRESS_CLAMP,
+ 0.0, 0, D3D11_COMPARISON_LESS_EQUAL,
+ 0.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, D3D11_FLOAT32_MAX,
+ };
+ NV_RETURN_ON_FAIL(device->CreateSamplerState(&samplerDesc, m_linearSampler.ReleaseAndGetAddressOf()));
+ }
+ {
+ D3D11_SAMPLER_DESC samplerDesc =
+ {
+ D3D11_FILTER_MIN_MAG_MIP_POINT,
+ D3D11_TEXTURE_ADDRESS_CLAMP,
+ D3D11_TEXTURE_ADDRESS_CLAMP,
+ D3D11_TEXTURE_ADDRESS_CLAMP,
+ 0.0, 0, D3D11_COMPARISON_NEVER,
+ 0.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, D3D11_FLOAT32_MAX,
+ };
+ NV_RETURN_ON_FAIL(device->CreateSamplerState(&samplerDesc, m_pointSampler.ReleaseAndGetAddressOf()));
+ }
+
+ return S_OK;
+}
+
+void ShadowMap::bindAndClear(ID3D11DeviceContext* context)
+{
+ ID3D11RenderTargetView* ppRtv[1] = { m_backRtv.Get() };
+ context->OMSetRenderTargets(1, ppRtv, m_depthDsv.Get());
+
+ context->RSSetViewports(1, &m_viewport);
+
+ float clearDepth = FLT_MAX;
+ float clearColor[4] = { clearDepth, clearDepth, clearDepth, clearDepth };
+
+ context->ClearRenderTargetView(m_backRtv.Get(), clearColor);
+ context->ClearDepthStencilView(m_depthDsv.Get(), D3D11_CLEAR_DEPTH, 1.0, 0);
+}
+
+void ShadowMap::setDefaultLight(FXMVECTOR eye, FXMVECTOR at, FXMVECTOR up)
+{
+ float sizeX = 50.0f;
+ float sizeY = 50.0f;
+ float znear = -200.0f;
+ float zfar = 200.0f;
+
+ setLightMatrices(eye, at, up, sizeX, sizeY, znear, zfar);
+}
+
+void ShadowMap::setLightMatrices(FXMVECTOR eye, FXMVECTOR lookAt, FXMVECTOR up, float sizeX, float sizeY, float zNear, float zFar)
+{
+ m_lightView = XMMatrixLookAtLH(eye, lookAt, up);
+
+ m_lightProjection = XMMatrixOrthographicLH(sizeX, sizeY, zNear, zFar);
+
+ DirectX::XMMATRIX clip2Tex(0.5, 0, 0, 0,
+ 0, -0.5, 0, 0,
+ 0, 0, 1, 0,
+ 0.5, 0.5, 0, 1);
+
+ DirectX::XMMATRIX viewProjection = m_lightView * m_lightProjection;
+ m_lightWorldToTex = viewProjection * clip2Tex;
+}
diff --git a/demo/d3d11/shadowMap.h b/demo/d3d11/shadowMap.h
new file mode 100644
index 0000000..2ed15ca
--- /dev/null
+++ b/demo/d3d11/shadowMap.h
@@ -0,0 +1,51 @@
+/*
+ * 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
+
+#include <d3d11.h>
+#include <DirectXMath.h>
+#include <wrl.h>
+
+using namespace DirectX;
+using namespace Microsoft::WRL;
+
+#define NV_NULL nullptr
+#define NV_RETURN_ON_FAIL(x) { HRESULT _res = (x); if (FAILED(_res)) { return _res; } }
+
+struct ShadowMap
+{
+
+ ShadowMap();
+
+ HRESULT init(ID3D11Device* device, int resolution);
+
+ void setDefaultLight(FXMVECTOR eye, FXMVECTOR at, FXMVECTOR up);
+ void setLightMatrices(FXMVECTOR eye, FXMVECTOR lookAt, FXMVECTOR up, float sizeX, float sizeY, float zNear, float zFar);
+
+ void bindAndClear(ID3D11DeviceContext* context);
+
+ XMMATRIX m_lightView;
+ XMMATRIX m_lightProjection;
+ XMMATRIX m_lightWorldToTex;
+
+ ComPtr<ID3D11Texture2D> m_backTexture;
+ ComPtr<ID3D11RenderTargetView> m_backRtv;
+ ComPtr<ID3D11ShaderResourceView> m_backSrv;
+
+ ComPtr<ID3D11Texture2D> m_depthTexture;
+ ComPtr<ID3D11DepthStencilView> m_depthDsv;
+ ComPtr<ID3D11ShaderResourceView> m_depthSrv;
+
+ ComPtr<ID3D11SamplerState> m_linearSampler;
+ ComPtr<ID3D11SamplerState> m_pointSampler;
+
+ D3D11_VIEWPORT m_viewport;
+};