MCPcopy Create free account
hub / github.com/NVIDIA-RTX/Donut / PlanarShadowMap

Method PlanarShadowMap

src/render/PlanarShadowMap.cpp:31–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29using namespace donut::render;
30
31PlanarShadowMap::PlanarShadowMap(
32 nvrhi::IDevice* device,
33 int resolution,
34 nvrhi::Format format)
35{
36 nvrhi::TextureDesc desc;
37 desc.width = resolution;
38 desc.height = resolution;
39 desc.sampleCount = 1;
40 desc.isRenderTarget = true;
41 desc.isTypeless = true;
42 desc.format = format;
43 desc.debugName = "ShadowMap";
44 desc.useClearValue = true;
45 desc.clearValue = nvrhi::Color(1.f);
46 desc.initialState = nvrhi::ResourceStates::ShaderResource;
47 desc.keepInitialState = true;
48 desc.dimension = nvrhi::TextureDimension::Texture2DArray;
49 m_ShadowMapTexture = device->createTexture(desc);
50
51 m_ShadowMapSize = float2(static_cast<float>(resolution));
52 m_TextureSize = m_ShadowMapSize;
53
54 m_View = std::make_shared<engine::PlanarView>();
55 m_View->SetViewport(nvrhi::Viewport(float(resolution), float(resolution)));
56 m_View->SetArraySlice(0);
57}
58
59PlanarShadowMap::PlanarShadowMap(
60 nvrhi::IDevice* device,

Callers

nothing calls this directly

Calls 2

SetArraySliceMethod · 0.80
SetViewportMethod · 0.45

Tested by

no test coverage detected