Rise
The Vieneo Province
Loading...
Searching...
No Matches
FogBeams11.cpp
Go to the documentation of this file.
1#include "FogBeams11.h"
2#include "ShaderBytecode11.h"
3#include "FrameProfiler11.h"
4#include <algorithm>
5#include <cmath>
6using namespace DirectX;
7using Microsoft::WRL::ComPtr;
8namespace Rendering
9{
10 namespace
11 {
12 void Unbind(ID3D11DeviceContext* context)
13 {
14 ID3D11ShaderResourceView* empty[D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT]{};
15 context->PSSetShaderResources(0,UINT(std::size(empty)),empty);
16 context->VSSetShaderResources(0,UINT(std::size(empty)),empty);
17 context->OMSetRenderTargets(0,nullptr,nullptr);
18 }
19 struct Restore
20 {
21 ComPtr<ID3D11DeviceContext1> context;ComPtr<ID3DDeviceContextState> previous;
22 ~Restore(){if(previous){Unbind(context.Get());context->SwapDeviceContextState(previous.Get(),nullptr);}}
23 };
24 bool Bounds(const FogBeams11::Light& light,const XMMATRIX& view,const XMMATRIX& projection,
25 const D3D11_VIEWPORT& viewport,D3D11_RECT& rectangle)
26 {
27 const auto angles=light.profile.Angles<XMFLOAT4>();
28 const auto origin=XMLoadFloat3(&light.position),direction=XMLoadFloat3(&light.direction),up=XMLoadFloat3(&light.up);
29 const auto right=XMVector3Cross(direction,up),end=XMVectorAdd(origin,XMVectorScale(direction,light.profile.rangeKm));
30 float x0=1,y0=1,x1=-1,y1=-1;unsigned behind=0;
31 for(unsigned i=0;i<5;++i)
32 {
33 auto point=origin;
34 if(i)point=XMVectorAdd(end,XMVectorAdd(XMVectorScale(right,(i&1 ? 1.f : -1.f)*angles.z*light.profile.rangeKm),
35 XMVectorScale(up,(i&2 ? 1.f : -1.f)*angles.w*light.profile.rangeKm)));
36 const auto camera=XMVector3TransformNormal(point,view);
37 const auto clip=XMVector4Transform(XMVectorSetW(camera,1),projection);
38 const float w=XMVectorGetW(clip);
39 if(w<=1e-6f){++behind;continue;}
40 const float x=XMVectorGetX(clip)/w,y=XMVectorGetY(clip)/w;
41 x0=(std::min)(x0,x);x1=(std::max)(x1,x);y0=(std::min)(y0,y);y1=(std::max)(y1,y);
42 }
43 if(behind==5)return false;
44 if(behind){x0=y0=-1;x1=y1=1;} // includes the camera/near-plane crossing
45 if(x0>=1 || x1<=-1 || y0>=1 || y1<=-1)return false;
46 rectangle={LONG(std::floor(viewport.TopLeftX+(std::max)(-1.f,x0)*viewport.Width*.5f+viewport.Width*.5f)),
47 LONG(std::floor(viewport.TopLeftY+(1-(std::min)(1.f,y1))*viewport.Height*.5f)),
48 LONG(std::ceil(viewport.TopLeftX+(std::min)(1.f,x1)*viewport.Width*.5f+viewport.Width*.5f)),
49 LONG(std::ceil(viewport.TopLeftY+(1-(std::max)(-1.f,y0))*viewport.Height*.5f))};
50 return rectangle.right>rectangle.left && rectangle.bottom>rectangle.top;
51 }
52 }
54 {
55 for(auto& program:pixel)program.Reset();for(auto& program:edge)program.Reset();
56 for(auto& program:organicPixel)program.Reset();for(auto& program:organicEdge)program.Reset();
57 for(auto& program:lowPixel)program.Reset();for(auto& program:organicLowPixel)program.Reset();
58 for(auto& program:resolvePixel)program.Reset();for(auto& program:resolveEdge)program.Reset();
61 state.Reset();raster.Reset();stencil.Reset();blend.Reset();lowBlend.Reset();fallbackSampler.Reset();device.Reset();lastDraws=0;
62 }
63 HRESULT FogBeams11::Initialize(ID3D11Device* native,const std::filesystem::path& directory)
64 {
65 Reset();if(!native)return E_INVALIDARG;device=native;shaderDirectory=directory;
66 HRESULT hr=S_OK;
67 for(unsigned i=0;i<4;++i)for(unsigned pass=0;pass<2;++pass)
68 {
69 if(!HasShaderBytecode11(directory/(std::string("FogBeams-")+(pass ? "FogEdge-" : "FogPixel-")+std::to_string(1u<<i)+".cso")))return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
70 }
71 if(!HasShaderBytecode11(directory/"FogBeams-FogVertex-1.cso"))return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
72 for(unsigned i=0;i<4;++i)for(const char* entry:{"FogLow","FogResolvePixel","FogResolveEdge"})
73 if(!HasShaderBytecode11(directory/(std::string("FogBeams-")+entry+"-"+std::to_string(1u<<i)+".cso")))return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
74 if(HasShaderBytecode11(directory/"FogOrganic-FogPixel-1.cso"))
75 {
76 for(unsigned i=0;i<4;++i)for(unsigned pass=0;pass<2;++pass)
77 {
78 if(!HasShaderBytecode11(directory/(std::string("FogOrganic-")+(pass ? "FogEdge-" : "FogPixel-")+std::to_string(1u<<i)+".cso")))return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
79 }
80 organicReady=true;
81 for(unsigned i=0;i<4;++i)
82 if(!HasShaderBytecode11(directory/("FogOrganic-FogLow-"+std::to_string(1u<<i)+".cso")))return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
83 }
84 D3D11_RASTERIZER_DESC rs{};rs.FillMode=D3D11_FILL_SOLID;rs.CullMode=D3D11_CULL_NONE;
85 rs.DepthClipEnable=rs.MultisampleEnable=rs.ScissorEnable=TRUE;
86 if(FAILED(hr=device->CreateRasterizerState(&rs,&raster)))return hr;
87 D3D11_DEPTH_STENCIL_DESC ds{};ds.DepthFunc=D3D11_COMPARISON_ALWAYS;
88 ds.StencilEnable=TRUE;ds.StencilReadMask=255;
89 ds.FrontFace={D3D11_STENCIL_OP_KEEP,D3D11_STENCIL_OP_KEEP,D3D11_STENCIL_OP_KEEP,D3D11_COMPARISON_GREATER};ds.BackFace=ds.FrontFace;
90 if(FAILED(hr=device->CreateDepthStencilState(&ds,&stencil)))return hr;
91 D3D11_BLEND_DESC bs{};bs.RenderTarget[0]={TRUE,D3D11_BLEND_ONE,D3D11_BLEND_ONE,D3D11_BLEND_OP_ADD,
92 D3D11_BLEND_ZERO,D3D11_BLEND_ONE,D3D11_BLEND_OP_ADD,D3D11_COLOR_WRITE_ENABLE_RED|D3D11_COLOR_WRITE_ENABLE_GREEN|D3D11_COLOR_WRITE_ENABLE_BLUE};
93 if(FAILED(hr=device->CreateBlendState(&bs,&blend)))return hr;
94 bs.RenderTarget[0].SrcBlendAlpha=bs.RenderTarget[0].DestBlendAlpha=D3D11_BLEND_ONE;
95 bs.RenderTarget[0].BlendOpAlpha=D3D11_BLEND_OP_MAX;bs.RenderTarget[0].RenderTargetWriteMask=D3D11_COLOR_WRITE_ENABLE_ALL;
96 if(FAILED(hr=device->CreateBlendState(&bs,&lowBlend)))return hr;
97 D3D11_SAMPLER_DESC sampler{};sampler.Filter=D3D11_FILTER_MIN_MAG_MIP_LINEAR;
98 sampler.AddressU=sampler.AddressV=sampler.AddressW=D3D11_TEXTURE_ADDRESS_CLAMP;sampler.MaxLOD=D3D11_FLOAT32_MAX;
99 sampler.ComparisonFunc=D3D11_COMPARISON_NEVER;sampler.MaxAnisotropy=1;
100 if(FAILED(hr=device->CreateSamplerState(&sampler,&fallbackSampler)))return hr;
101 ComPtr<ID3D11Device1> device1;if(FAILED(hr=device.As(&device1)))return hr;
102 const auto level=device->GetFeatureLevel();
103 return device1->CreateDeviceContextState(0,&level,1,D3D11_SDK_VERSION,__uuidof(ID3D11Device),nullptr,&state);
104 }
106 {
107 if(resolutionDivisor!=1)
108 {
109 if((organic ? organicLowPixel : lowPixel)[variant].Ready() && resolvePixel[variant].Ready() &&
110 (!variant || resolveEdge[variant].Ready()))return S_OK;
111 }
112 else if((organic ? organicPixel : pixel)[variant].Ready() &&
113 (!variant || (organic ? organicEdge : edge)[variant].Ready()))return S_OK;
114 const auto vs=ReadShaderBytecode11(shaderDirectory/"FogBeams-FogVertex-1.cso");
115 if(resolutionDivisor!=1)
116 {
117 auto prepare=[&](Program11& program,const std::string& source,const char* entry) {
118 if(program.Ready())return S_OK;
119 const auto ps=ReadShaderBytecode11(shaderDirectory/(source+"-"+entry+"-"+std::to_string(1u<<variant)+".cso"));
120 return program.Create(device.Get(),vs.data(),vs.size(),ps.data(),ps.size());
121 };
122 HRESULT hr=prepare((organic ? organicLowPixel : lowPixel)[variant],organic ? "FogOrganic" : "FogBeams","FogLow");
123 if(FAILED(hr))return hr;
124 if(FAILED(hr=prepare(resolvePixel[variant],"FogBeams","FogResolvePixel")))return hr;
125 return variant ? prepare(resolveEdge[variant],"FogBeams","FogResolveEdge") : S_OK;
126 }
127 for(unsigned pass=0;pass<(variant ? 2u : 1u);++pass)
128 {
129 auto& program=organic ? (pass ? organicEdge : organicPixel)[variant] : (pass ? edge : pixel)[variant];
130 if(program.Ready())continue;
131 const auto ps=ReadShaderBytecode11(shaderDirectory/(std::string(organic ? "FogOrganic-" : "FogBeams-")
132 +(pass ? "FogEdge-" : "FogPixel-")+std::to_string(1u<<variant)+".cso"));
133 const HRESULT hr=program.Create(device.Get(),vs.data(),vs.size(),ps.data(),ps.size());if(FAILED(hr))return hr;
134 }
135 return S_OK;
136 }
141 HRESULT FogBeams11::PrepareTargets(unsigned width,unsigned height)
142 {
143 if(scattering && bufferWidth==width && bufferHeight==height)return S_OK;
145 D3D11_TEXTURE2D_DESC desc{};desc.Width=width;desc.Height=height;desc.MipLevels=1;desc.ArraySize=1;
146 desc.Format=DXGI_FORMAT_R16G16B16A16_FLOAT;desc.SampleDesc.Count=1;
147 desc.BindFlags=D3D11_BIND_RENDER_TARGET|D3D11_BIND_SHADER_RESOURCE;
148 HRESULT hr=device->CreateTexture2D(&desc,nullptr,&scattering);if(FAILED(hr))return hr;
149 D3D11_SHADER_RESOURCE_VIEW_DESC source{};source.Format=desc.Format;source.ViewDimension=D3D11_SRV_DIMENSION_TEXTURE2DARRAY;
150 source.Texture2DArray.MipLevels=source.Texture2DArray.ArraySize=1;
151 if(FAILED(hr=device->CreateShaderResourceView(scattering.Get(),&source,&scatteringView)))return hr;
152 D3D11_RENDER_TARGET_VIEW_DESC target{};target.Format=desc.Format;target.ViewDimension=D3D11_RTV_DIMENSION_TEXTURE2DARRAY;
153 target.Texture2DArray.ArraySize=1;
154 if(FAILED(hr=device->CreateRenderTargetView(scattering.Get(),&target,&scatteringAll)))return hr;
155 bufferWidth=width;bufferHeight=height;return S_OK;
156 }
157 HRESULT FogBeams11::Render(ID3D11DeviceContext* context,ID3D11RenderTargetView* scene,const SceneDepth11& depth,
158 const D3D11_VIEWPORT& viewport,const Matrix& view,const Matrix& projection,
159 const std::vector<Light>& lights,const Parameters11* clouds)
160 {
161 lastDraws=0;if(lights.empty())return S_OK;
162 if(!Ready() || !context || !scene || !depth.ReadView())return E_UNEXPECTED;
163 if(viewport.Width<1 || viewport.Height<1 || viewport.TopLeftX<0 || viewport.TopLeftY<0
164 || viewport.TopLeftX+viewport.Width>depth.Description().Width || viewport.TopLeftY+viewport.Height>depth.Description().Height
165 || !std::isfinite(projection._11) || !std::isfinite(projection._22) || std::abs(projection._11)<1e-8f || std::abs(projection._22)<1e-8f)return E_INVALIDARG;
166 unsigned variant=0;while(variant<4 && (1u<<variant)!=depth.Description().SampleDesc.Count)++variant;
167 if(variant==4)return E_INVALIDARG;
168 const HRESULT prepared=PreparePrograms(variant);if(FAILED(prepared))return prepared;
169 const bool reduced=resolutionDivisor!=1;
170 const float divisor=resolutionDivisor ? float(resolutionDivisor) :
171 (std::max)(4.f,(std::max)(viewport.Width/384.f,viewport.Height/216.f));
172 D3D11_VIEWPORT lowViewport{0,0,std::ceil(viewport.Width/divisor),std::ceil(viewport.Height/divisor),0,1};
173 // Keep the automatic ceiling exact when float division rounds just
174 // above an integer (for example an unusual wide viewport).
175 if(!resolutionDivisor){lowViewport.Width=(std::min)(384.f,lowViewport.Width);lowViewport.Height=(std::min)(216.f,lowViewport.Height);}
176 if(reduced){const HRESULT hr=PrepareTargets(unsigned(lowViewport.Width),unsigned(lowViewport.Height));if(FAILED(hr))return hr;}
177 Parameters11 values=clouds ? *clouds : Parameters11{};
178 if(!clouds)for(const char* name:{"noiseSampler","weatherPreviousSampler","weatherCurrentSampler","headlightDepthSampler","localBaseSampler"})
179 values.Sampler(name,fallbackSampler.Get());
180 Matrix inverse;XMVECTOR determinant;const auto v=XMLoadFloat4x4(&view),p=XMLoadFloat4x4(&projection);
181 XMStoreFloat4x4(&inverse,XMMatrixInverse(&determinant,v));
182 if(!std::isfinite(XMVectorGetX(determinant)) || std::abs(XMVectorGetX(determinant))<1e-8f)return E_INVALIDARG;
183 values.Set("fogView",view);values.Set("fogInverseView",inverse);values.Set("fogProjection",projection);
184 values.Set("fogViewport",XMFLOAT4(viewport.TopLeftX,viewport.TopLeftY,viewport.Width,viewport.Height));
185 values.Set("fogBufferSize",XMFLOAT4(lowViewport.Width,lowViewport.Height,0,0));
186 values.Set("fogClouds",int(clouds!=nullptr));values.Set("riseSceneStencilAvailable",UINT(depth.StencilView()!=nullptr));
187 values.Texture("riseSceneDepth",depth.ShaderView());values.Texture("riseSceneStencil",depth.StencilView());
188 Restore restore;HRESULT hr=context->QueryInterface(IID_PPV_ARGS(&restore.context));if(FAILED(hr))return hr;
189 restore.context->SwapDeviceContextState(state.Get(),&restore.previous);
190 Unbind(context);context->OMSetRenderTargets(1,&scene,depth.ReadView());context->RSSetViewports(1,&viewport);
191 context->RSSetState(raster.Get());context->OMSetDepthStencilState(stencil.Get(),3);context->OMSetBlendState(blend.Get(),nullptr,UINT_MAX);
192 context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
193 context->GSSetShader(nullptr,nullptr,0);context->HSSetShader(nullptr,nullptr,0);context->DSSetShader(nullptr,nullptr,0);
194 ProfileScope11 timing("Fog headlight scattering");
195 if(reduced)
196 {
197 const float empty[4]{0,0,0,-1};context->ClearRenderTargetView(scatteringAll.Get(),empty);
198 context->OMSetDepthStencilState(nullptr,0);context->OMSetBlendState(lowBlend.Get(),nullptr,UINT_MAX);
199 auto* target=scatteringAll.Get();context->OMSetRenderTargets(1,&target,nullptr);
200 context->RSSetViewports(1,&lowViewport);
201 }
202 std::array<XMFLOAT4,MaxLights> positions{},directions{},ups{},angles{},profiles{};
203 unsigned count=0;
204 D3D11_RECT resolveBounds{LONG(viewport.TopLeftX+viewport.Width),LONG(viewport.TopLeftY+viewport.Height),LONG(viewport.TopLeftX),LONG(viewport.TopLeftY)};
205 for(size_t index=0;index<(std::min)(lights.size(),size_t(MaxLights));++index)
206 {
207 auto light=lights[index];
208 if(!(light.extinctionPerKm>0) || !(light.color.w>0) || !std::isfinite(light.extinctionPerKm) || !(light.profile.rangeKm>0))continue;
209 const float length=XMVectorGetX(XMVector3Length(XMLoadFloat3(&light.direction)));
210 if(!std::isfinite(length) || length<1e-8f)return E_INVALIDARG;
211 XMStoreFloat3(&light.direction,XMVectorScale(XMLoadFloat3(&light.direction),1/length));
212 light.up=LandingLights::OrthonormalUp(light.up,light.direction);
213 D3D11_RECT rectangle;if(!Bounds(light,v,p,viewport,rectangle))continue;
214 if(reduced)
215 {
216 resolveBounds.left=(std::min)(resolveBounds.left,rectangle.left);resolveBounds.top=(std::min)(resolveBounds.top,rectangle.top);
217 resolveBounds.right=(std::max)(resolveBounds.right,rectangle.right);resolveBounds.bottom=(std::max)(resolveBounds.bottom,rectangle.bottom);
218 positions[count]={light.position.x,light.position.y,light.position.z,light.profile.rangeKm};
219 directions[count]={light.direction.x,light.direction.y,light.direction.z,0};ups[count]={light.up.x,light.up.y,light.up.z,0};
220 angles[count]=light.profile.Angles<XMFLOAT4>();profiles[count]=light.profile.Parameters<XMFLOAT4>(light.extinctionPerKm);
221 const float sx=lowViewport.Width/viewport.Width,sy=lowViewport.Height/viewport.Height;
222 rectangle={LONG(std::floor((rectangle.left-viewport.TopLeftX)*sx)),LONG(std::floor((rectangle.top-viewport.TopLeftY)*sy)),
223 LONG(std::ceil((rectangle.right-viewport.TopLeftX)*sx)),LONG(std::ceil((rectangle.bottom-viewport.TopLeftY)*sy))};
224 ++count;
225 }
226 context->RSSetScissorRects(1,&rectangle);
227 values.Set("fogLampPosition",XMFLOAT4(light.position.x,light.position.y,light.position.z,light.profile.rangeKm));
228 values.Set("fogLampDirection",XMFLOAT4(light.direction.x,light.direction.y,light.direction.z,0));
229 values.Set("fogLampUp",XMFLOAT4(light.up.x,light.up.y,light.up.z,0));values.Set("fogLampColor",light.color);
230 values.Set("fogLampAngles",light.profile.Angles<XMFLOAT4>());
231 values.Set("fogLampParameters",light.profile.Parameters<XMFLOAT4>(light.extinctionPerKm));
232 values.Set("fogCloudIndex",light.cloudIndex);
233 if(reduced)
234 {
235 if(FAILED(hr=(organic ? organicLowPixel[variant] : lowPixel[variant]).Bind(context,values)))return hr;
236 context->Draw(3,0);++lastDraws;continue;
237 }
238 if(FAILED(hr=(organic ? organicPixel[variant] : pixel[variant]).Bind(context,values)))return hr;context->Draw(3,0);++lastDraws;
239 if(variant){if(FAILED(hr=(organic ? organicEdge[variant] : edge[variant]).Bind(context,values)))return hr;context->Draw(3,0);++lastDraws;}
240 }
241 if(reduced && count)
242 {
243 context->OMSetRenderTargets(1,&scene,depth.ReadView());context->RSSetViewports(1,&viewport);
244 context->RSSetScissorRects(1,&resolveBounds);context->OMSetDepthStencilState(stencil.Get(),3);context->OMSetBlendState(blend.Get(),nullptr,UINT_MAX);
245 values.Set("fogResolveCount",count);values.Set("fogResolvePositions",positions);values.Set("fogResolveDirections",directions);
246 values.Set("fogResolveUps",ups);values.Set("fogResolveAngles",angles);values.Set("fogResolveProfiles",profiles);
247 values.Texture("fogScattering",scatteringView.Get());
248 if(FAILED(hr=resolvePixel[variant].Bind(context,values)))return hr;context->Draw(3,0);++lastDraws;
249 if(variant){if(FAILED(hr=resolveEdge[variant].Bind(context,values)))return hr;context->Draw(3,0);++lastDraws;}
250 }
251 return S_OK;
252 }
253}
HRESULT(WINAPI *CUniBuffer::_ScriptApplyDigitSubstitution)(const SCRIPT_DIGITSUBSTITUTE *
Microsoft::WRL::ComPtr< ID3D11Device > device
Definition FogBeams11.h:49
Microsoft::WRL::ComPtr< ID3D11DepthStencilState > stencil
Definition FogBeams11.h:52
unsigned resolutionDivisor
Definition FogBeams11.h:61
HRESULT PrepareTargets(unsigned width, unsigned height)
Microsoft::WRL::ComPtr< ID3D11Texture2D > scattering
Definition FogBeams11.h:58
HRESULT Initialize(ID3D11Device *device, const std::filesystem::path &directory={})
HRESULT Render(ID3D11DeviceContext *context, ID3D11RenderTargetView *scene, const SceneDepth11 &depth, const D3D11_VIEWPORT &viewport, const Matrix &view, const Matrix &projection, const std::vector< Light > &lights, const Parameters11 *clouds=nullptr)
std::array< Program11, 4 > pixel
Definition FogBeams11.h:55
std::array< Program11, 4 > edge
Definition FogBeams11.h:55
Microsoft::WRL::ComPtr< ID3D11BlendState > lowBlend
Definition FogBeams11.h:53
static constexpr unsigned MaxLights
Definition FogBeams11.h:17
std::array< Program11, 4 > organicEdge
Definition FogBeams11.h:56
std::array< Program11, 4 > resolveEdge
Definition FogBeams11.h:57
std::filesystem::path shaderDirectory
Definition FogBeams11.h:48
std::array< Program11, 4 > organicLowPixel
Definition FogBeams11.h:57
Microsoft::WRL::ComPtr< ID3D11ShaderResourceView > scatteringView
Definition FogBeams11.h:59
std::array< Program11, 4 > lowPixel
Definition FogBeams11.h:57
Microsoft::WRL::ComPtr< ID3D11RenderTargetView > scatteringAll
Definition FogBeams11.h:60
Microsoft::WRL::ComPtr< ID3D11RasterizerState > raster
Definition FogBeams11.h:51
HRESULT PreparePrograms(unsigned variant)
Microsoft::WRL::ComPtr< ID3D11SamplerState > fallbackSampler
Definition FogBeams11.h:54
bool Ready() const
Definition FogBeams11.h:35
DirectX::XMFLOAT4X4 Matrix
Definition FogBeams11.h:19
Microsoft::WRL::ComPtr< ID3DDeviceContextState > state
Definition FogBeams11.h:50
std::array< Program11, 4 > organicPixel
Definition FogBeams11.h:56
std::array< Program11, 4 > resolvePixel
Definition FogBeams11.h:57
Microsoft::WRL::ComPtr< ID3D11BlendState > blend
Definition FogBeams11.h:53
void Set(const std::string &name, const void *data, size_t bytes)
Definition Program11.cpp:45
void Texture(const std::string &name, ID3D11ShaderResourceView *value)
Definition Program11.cpp:55
void Sampler(const std::string &name, ID3D11SamplerState *value)
Definition Program11.cpp:66
HRESULT Create(ID3D11Device *device, const void *vertexCode, size_t vertexSize, const void *pixelCode, size_t pixelSize, const D3D11_INPUT_ELEMENT_DESC *elements=nullptr, UINT elementCount=0, UINT bgraColorMask=0)
bool Ready() const
Definition Program11.h:66
ID3D11ShaderResourceView * StencilView() const
Definition Device11.h:21
ID3D11ShaderResourceView * ShaderView() const
Definition Device11.h:20
const D3D11_TEXTURE2D_DESC & Description() const
Definition Device11.h:22
ID3D11DepthStencilView * ReadView() const
Definition Device11.h:19
Definition DDS.h:24
Vector OrthonormalUp(Vector up, const Vector &direction)
Definition BeamProfile.h:43
bool HasShaderBytecode11(const std::filesystem::path &path)
std::vector< char > ReadShaderBytecode11(const std::filesystem::path &path, HMODULE resourceModule=nullptr)
Model.