6#include <DirectXMath.h>
36 ID3D11RenderTargetView* scene,
const SceneDepth11& depth,
37 const D3D11_VIEWPORT& viewport,
unsigned activeHeadlights = 0,
bool atmosphericFog =
false,
bool spatialRain =
false,
bool belowNominalCloudBase =
false);
39 ID3D11RenderTargetView* scene,
const SceneDepth11& depth,
const D3D11_VIEWPORT& viewport,
40 ID3D11ShaderResourceView* atmosphere, ID3D11Buffer* vertices,
41 const DirectX::XMFLOAT4X4& world, UINT segments,
float physicalScale);
43 ID3D11RenderTargetView* scene,
const SceneDepth11& depth,
const D3D11_VIEWPORT& viewport,
44 ID3D11Buffer* vertices,
const DirectX::XMFLOAT4X4& world, UINT drops);
46 ID3D11RenderTargetView* scene,
const SceneDepth11& depth,
const D3D11_VIEWPORT& viewport,
47 ID3D11Buffer* vertices, ID3D11Buffer* indices, UINT drops,
bool cloudAttenuation =
true);
56 for(
auto& direct:
topDirect)direct.ReleaseTargets();
74#ifdef RISE_CLOUD_TEST_TEMPORAL_DIAGNOSTICS
75 unsigned TestTopLoadingFallbacks()
const {
return testTopLoadingFallbacks;}
76 static unsigned TestLoadingActiveWorkers();
90 Microsoft::WRL::ComPtr<ID3D11Texture2D>
texture;
91 Microsoft::WRL::ComPtr<ID3D11RenderTargetView>
rtv;
92 Microsoft::WRL::ComPtr<ID3D11ShaderResourceView>
srv;
97 const SceneDepth11& depth,
const D3D11_VIEWPORT& viewport);
99 ID3D11RenderTargetView* scene,
const SceneDepth11& depth,
const D3D11_VIEWPORT& viewport,
100 ID3D11Buffer* vertices, UINT stride, UINT count, D3D11_PRIMITIVE_TOPOLOGY topology,
101 ID3D11Buffer* indices =
nullptr, UINT indexCount = 0,
bool premultiplied =
false);
103 Microsoft::WRL::ComPtr<ID3D11Device>
device;
104 Microsoft::WRL::ComPtr<ID3DDeviceContextState>
passState;
105 Microsoft::WRL::ComPtr<ID3D11RasterizerState>
raster;
108 std::vector<Microsoft::WRL::ComPtr<ID3D11SamplerState>>
samplers;
128 for(
auto& program:*list)program.Reset();
132 HRESULT PreparePrograms(
unsigned variant,
bool fog,
bool headlights,
bool spatialRain,
bool rainMaskEnabled,
bool cached,
bool sharedSearch,
bool directComposite);
151 std::vector<LoadingJob>
LoadingJobs(UINT samples,
bool organic,
size_t& topBegin);
162 Microsoft::WRL::ComPtr<ID3D11ComputeShader>
scan;
174#ifdef RISE_CLOUD_TEST_TEMPORAL_DIAGNOSTICS
175 unsigned testTopLoadingFallbacks=0;
188 Microsoft::WRL::ComPtr<ID3D11BlendState>
adBlend;
209 std::string
status=
"native cloud pass not initialized";
HRESULT(WINAPI *CUniBuffer::_ScriptApplyDigitSubstitution)(const SCRIPT_DIGITSUBSTITUTE *
std::array< Program11, 4 > seededEdge
HRESULT LoadFullscreenProgram(Program11 &program, const std::string &name)
void LoadingFramePresented()
HRESULT RenderRainParticles(ID3D11DeviceContext *context, Parameters11 ¶meters, ID3D11RenderTargetView *scene, const SceneDepth11 &depth, const D3D11_VIEWPORT &viewport, ID3D11Buffer *vertices, ID3D11Buffer *indices, UINT drops, bool cloudAttenuation=true)
void SetRainMsaaSharingEnabled(bool enabled)
std::array< bool, 4 > hiddenAvailable
Program11 organicLightDepth
bool hiddenRayOptimizationEnabled
const LoadingProgress & LoadingStatus() const
std::filesystem::path shaderDirectory
LoadingProgress loadingDisplayProgress
bool rainMsaaSharingEnabled
void SetAdOpacityTarget(ID3D11RenderTargetView *target)
std::array< bool, 4 > cachedCompositeAvailable
std::array< Program11, 4 > adPixel
Microsoft::WRL::ComPtr< ID3D11UnorderedAccessView > compositeArgumentsView
std::array< Program11, 4 > visibleComposite
HRESULT Initialize(ID3D11Device *device, const std::filesystem::path &shaderDirectory={})
ID3D11ShaderResourceView * Image() const
HRESULT PrepareLoadingStepNow(ID3D11DeviceContext *context, UINT samples, bool organic)
std::array< Program11, 4 > compositeFogPixel
std::array< bool, 4 > sharedSearchAvailable
std::array< bool, 4 > compositeWorkAvailable
std::array< Program11, 4 > adFogPixel
std::array< Microsoft::WRL::ComPtr< ID3D11ComputeShader >, 4 > compositeWorkScan
OrganicPrograms organicTop
Microsoft::WRL::ComPtr< ID3D11BlendState > adBlend
Microsoft::WRL::ComPtr< ID3D11Buffer > compositeArguments
HRESULT PrepareLoadingObjects(const LoadingJob &job, unsigned variant)
Microsoft::WRL::ComPtr< ID3D11RenderTargetView > adOpacityTarget
CloudTemporal11::Frame temporalFrame
Program11 orbitalCoverage
ID3D11ShaderResourceView * Distance() const
std::array< Program11, 4 > adFogEdge
bool orbitalCoverageAvailable
std::array< Program11, 4 > completeComposite
void ConfigureTemporal(const CloudTemporal11::Frame &frame, bool enabled)
HRESULT PrepareOrganicRain()
void SetHiddenRayOptimizationEnabled(bool enabled)
const std::string & Status() const
std::shared_ptr< LoadingWorker > loadingWorker
HRESULT InitializeOrganic()
bool OrganicOrbitAvailable() const
HRESULT RenderRainLines(ID3D11DeviceContext *context, Parameters11 ¶meters, ID3D11RenderTargetView *scene, const SceneDepth11 &depth, const D3D11_VIEWPORT &viewport, ID3D11Buffer *vertices, const DirectX::XMFLOAT4X4 &world, UINT drops)
OrganicPrograms * activeOrganic
std::array< Program11, 4 > classifyHidden
HRESULT PrepareAdOpacity()
bool AdOpacityWritten() const
LoadingProgress loadingProgress
HRESULT ConfigureOrganic(bool enabled, bool aboveDeck)
void SetRainCloudOcclusionEnabled(bool enabled)
HRESULT PrepareCompositeWork(unsigned variant)
std::array< Program11, 4 > firstHitClassify
std::array< Program11, 4 > cachedComposite
bool OrganicFlightAvailable() const
Microsoft::WRL::ComPtr< ID3D11BlendState > straightBlend
std::array< Program11, 4 > compositeEdge
std::vector< Microsoft::WRL::ComPtr< ID3D11SamplerState > > samplers
std::array< TopDirectState, 4 > topDirect
HRESULT ValidateScene(ID3D11DeviceContext *context, ID3D11RenderTargetView *scene, const SceneDepth11 &depth, const D3D11_VIEWPORT &viewport)
HRESULT RenderSkyRing(ID3D11DeviceContext *context, Parameters11 ¶meters, ID3D11RenderTargetView *scene, const SceneDepth11 &depth, const D3D11_VIEWPORT &viewport, ID3D11ShaderResourceView *atmosphere, ID3D11Buffer *vertices, const DirectX::XMFLOAT4X4 &world, UINT segments, float physicalScale)
Microsoft::WRL::ComPtr< ID3D11DepthStencilState > disabledDepth
HRESULT PreparePrograms(unsigned variant, bool fog, bool headlights, bool spatialRain, bool rainMaskEnabled, bool cached, bool sharedSearch, bool directComposite)
Program11 organicRainParticles
OrganicPath SelectedOrganicPath() const
HRESULT PrepareTopDirectTargets(unsigned variant, const D3D11_TEXTURE2D_DESC &scene)
void SetResolutionScale(float value)
void StartLoadingWorker(UINT samples, bool organic)
std::array< Program11, 4 > compositePixel
std::array< Program11, 4 > rainEdge
ID3D11ShaderResourceView * HeadlightDepth() const
Microsoft::WRL::ComPtr< ID3D11RasterizerState > raster
HRESULT Render(ID3D11DeviceContext *context, Parameters11 ¶meters, ID3D11RenderTargetView *scene, const SceneDepth11 &depth, const D3D11_VIEWPORT &viewport, unsigned activeHeadlights=0, bool atmosphericFog=false, bool spatialRain=false, bool belowNominalCloudBase=false)
void SetVisibilityOptimizationEnabled(bool enabled)
OrganicPrograms organicFlight
bool rainCloudOcclusionEnabled
bool loadingWorkPendingPresentation
Microsoft::WRL::ComPtr< ID3D11DepthStencilState > compositeDepth
Microsoft::WRL::ComPtr< ID3D11BlendState > blend
std::array< unsigned, 8 > loadingStep
void AdoptLoadingPrograms(CloudPass11 &prepared)
Microsoft::WRL::ComPtr< ID3D11Device > device
HRESULT TargetCreate(Target &target, UINT w, UINT h, DXGI_FORMAT format)
std::array< Program11, 4 > rainPixel
HRESULT PrepareLoadingStep(ID3D11DeviceContext *context, UINT samples, bool organic)
std::array< Program11, 4 > compositeFogEdge
HRESULT Draw(ID3D11DeviceContext *context, Program11 &program, Parameters11 ¶meters)
Microsoft::WRL::ComPtr< ID3D11Texture2D > hiddenDepthTexture
HRESULT Geometry(ID3D11DeviceContext *context, Program11 &program, Parameters11 ¶meters, ID3D11RenderTargetView *scene, const SceneDepth11 &depth, const D3D11_VIEWPORT &viewport, ID3D11Buffer *vertices, UINT stride, UINT count, D3D11_PRIMITIVE_TOPOLOGY topology, ID3D11Buffer *indices=nullptr, UINT indexCount=0, bool premultiplied=false)
Microsoft::WRL::ComPtr< ID3D11DepthStencilState > hiddenRead
std::array< Program11, 4 > adEdge
Microsoft::WRL::ComPtr< ID3D11DepthStencilState > hiddenWrite
Microsoft::WRL::ComPtr< ID3DDeviceContextState > passState
Microsoft::WRL::ComPtr< ID3D11DepthStencilView > hiddenDepth
bool visibilityOptimizationEnabled
HRESULT Fail(const char *stage, HRESULT hr)
Program11 clearRainParticles
HRESULT PrepareTopDirectPrograms(unsigned variant)
HRESULT PrepareTopDirectWork(unsigned variant)
bool temporalProgramsReady
std::array< Program11, 4 > rainClassify
std::vector< LoadingJob > LoadingJobs(UINT samples, bool organic, size_t &topBegin)
std::array< Program11, 4 > seededFogEdge
float ResolutionScale() const
ID3D11ShaderResourceView * Image() const
ID3D11ShaderResourceView * Distance() const
std::array< Program11, 4 > edge
std::array< Program11, 4 > adPixel
std::array< Program11, 4 > adFogEdge
std::array< Program11, 4 > pixel
std::array< Program11, 4 > adFogPixel
std::array< Program11, 4 > fogEdge
std::array< Program11, 4 > fogPixel
std::array< Program11, 4 > adEdge
Microsoft::WRL::ComPtr< ID3D11Texture2D > texture
Microsoft::WRL::ComPtr< ID3D11ShaderResourceView > srv
Microsoft::WRL::ComPtr< ID3D11RenderTargetView > rtv
Microsoft::WRL::ComPtr< ID3D11ComputeShader > scan
Microsoft::WRL::ComPtr< ID3D11Buffer > arguments
Microsoft::WRL::ComPtr< ID3D11UnorderedAccessView > argumentView