Rise
The Vieneo Province
Loading...
Searching...
No Matches
CloudVolumeRenderer.cpp
Go to the documentation of this file.
2void CloudVolumeRenderer::SetHeadlights(const std::vector<Headlight>& lights)
3{
4 std::vector<Rendering::CloudRenderer11::Headlight> native;native.reserve(lights.size());
5 for(const auto& light:lights)native.push_back({light.position,light.direction,{light.color.r,light.color.g,light.color.b,light.color.a},light.rangeKm,light.up,light.profile,light.extinctionPerKm});
7}
9 const RiseMath::Vector3& eye,const CloudVolume::Parameters& parameters,const RiseMath::Vector3& sunlight,
10 const RiseMath::Color& light,const RiseMath::Color& ambient,const RiseMath::Color& airglow,
11 const RiseMath::Vector4& horizon,const RiseMath::Vector4& atmosphere,const RiseMath::Vector4& nightVisionGain)
12{
13 if(!device)return E_INVALIDARG;
14 return renderer.Render(device->Context(),device->Owner().SceneTarget(),device->Owner().Depth(),device->Draws().Viewport(),view,projection,
15 eye,parameters,sunlight,{light.r,light.g,light.b,light.a},{ambient.r,ambient.g,ambient.b,ambient.a},
16 {airglow.r,airglow.g,airglow.b,airglow.a},horizon,atmosphere,nightVisionGain);
17}
19 Rendering::RenderBuffer* vertices,const RiseMath::Matrix& world,UINT segments,float scale)
20{
21 if(!device || !atmosphere || !vertices)return E_INVALIDARG;
22 Microsoft::WRL::ComPtr<ID3D11Buffer> buffer;const HRESULT hr=vertices->Geometry().NativeBuffer(device->Context(),&buffer);if(FAILED(hr))return hr;
23 auto parameters=renderer.Parameters();
24 return renderer.Pass().RenderSkyRing(device->Context(),parameters,device->Owner().SceneTarget(),device->Owner().Depth(),
25 device->Draws().Viewport(),atmosphere->View(),buffer.Get(),world,segments,scale);
26}
28{
29 if(!device)return E_INVALIDARG;const auto state=device->Capture();if(!state.vertices)return E_UNEXPECTED;
30 Microsoft::WRL::ComPtr<ID3D11Buffer> buffer;const HRESULT hr=state.vertices->Geometry().NativeBuffer(device->Context(),&buffer);if(FAILED(hr))return hr;
31 auto parameters=renderer.Parameters();
32 return renderer.Pass().RenderRainLines(device->Context(),parameters,device->Owner().SceneTarget(),device->Owner().Depth(),
33 device->Draws().Viewport(),buffer.Get(),world,drops);
34}
HRESULT(WINAPI *CUniBuffer::_ScriptApplyDigitSubstitution)(const SCRIPT_DIGITSUBSTITUTE *
Rendering::CloudRenderer11 renderer
HRESULT RenderRain(Rendering::RenderDevice *device, const RiseMath::Matrix &world, UINT drops)
void SetHeadlights(const std::vector< Headlight > &lights)
HRESULT RenderSkyRing(Rendering::RenderDevice *device, Rendering::RenderTexture *atmosphere, Rendering::RenderBuffer *vertices, const RiseMath::Matrix &world, UINT segments, float physicalScale=1)
HRESULT Render(Rendering::RenderDevice *device, const RiseMath::Matrix &view, const RiseMath::Matrix &projection, const RiseMath::Vector3 &eye, const CloudVolume::Parameters &parameters, const RiseMath::Vector3 &sunlight, const RiseMath::Color &light, const RiseMath::Color &ambient, const RiseMath::Color &airglow=RiseMath::Color(.125f,.375f,.25f, 1), const RiseMath::Vector4 &horizon=RiseMath::Vector4(0, 0, 0, 0), const RiseMath::Vector4 &atmosphere=RiseMath::Vector4(0, 0, 0, 0), const RiseMath::Vector4 &nightVisionGain=RiseMath::Vector4(1, 1, 1, 0))
HRESULT RenderRainLines(ID3D11DeviceContext *context, Parameters11 &parameters, ID3D11RenderTargetView *scene, const SceneDepth11 &depth, const D3D11_VIEWPORT &viewport, ID3D11Buffer *vertices, const DirectX::XMFLOAT4X4 &world, UINT drops)
HRESULT RenderSkyRing(ID3D11DeviceContext *context, Parameters11 &parameters, ID3D11RenderTargetView *scene, const SceneDepth11 &depth, const D3D11_VIEWPORT &viewport, ID3D11ShaderResourceView *atmosphere, ID3D11Buffer *vertices, const DirectX::XMFLOAT4X4 &world, UINT segments, float physicalScale)
HRESULT Render(ID3D11DeviceContext *context, ID3D11RenderTargetView *scene, const SceneDepth11 &depth, const D3D11_VIEWPORT &viewport, const Matrix &view, const Matrix &projection, const Vector &planetEye, const CloudVolume::Parameters &params, const Vector &sunlight, const Color &light, const Color &ambient, const Color &airglow=Color(.125f,.375f,.25f, 1), const Color &horizonHaze=Color(0, 0, 0, 0), const Color &atmosphereHaze=Color(0, 0, 0, 0), const Color &nightVisionGain=Color(1, 1, 1, 0))
void SetHeadlights(const std::vector< Headlight > &lights)
const Parameters11 & Parameters() const
ID3D11RenderTargetView * SceneTarget() const
Definition Device11.h:68
const SceneDepth11 & Depth() const
Definition Device11.h:70
const D3D11_VIEWPORT & Viewport() const
HRESULT NativeBuffer(ID3D11DeviceContext *context, ID3D11Buffer **result)
DrawContext11 & Draws()
ID3D11DeviceContext * Context()
ID3D11ShaderResourceView * View() const