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

Method Render

src/render/EnvironmentMapPass.cpp:115–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113}
114
115void EnvironmentMapPass::Render(
116 nvrhi::ICommandList* commandList,
117 const ICompositeView& compositeView)
118{
119 commandList->beginMarker("Environment Map");
120
121 for (uint viewIndex = 0; viewIndex < compositeView.GetNumChildViews(ViewType::PLANAR); viewIndex++)
122 {
123 const IView* view = compositeView.GetChildView(ViewType::PLANAR, viewIndex);
124
125 nvrhi::GraphicsState state;
126 state.pipeline = m_RenderPso;
127 state.framebuffer = m_FramebufferFactory->GetFramebuffer(*view);
128 state.bindings = { m_RenderBindingSet };
129 state.viewport = view->GetViewportState();
130
131 SkyConstants skyConstants = {};
132 skyConstants.matClipToTranslatedWorld = view->GetInverseViewProjectionMatrix() * affineToHomogeneous(translation(-view->GetViewOrigin()));
133 commandList->writeBuffer(m_SkyCB, &skyConstants, sizeof(skyConstants));
134
135 commandList->setGraphicsState(state);
136
137 nvrhi::DrawArguments args;
138 args.instanceCount = 1;
139 args.vertexCount = 4;
140 commandList->draw(args);
141 }
142
143 commandList->endMarker();
144}

Callers

nothing calls this directly

Calls 8

affineToHomogeneousFunction · 0.85
translationFunction · 0.85
GetNumChildViewsMethod · 0.45
GetChildViewMethod · 0.45
GetFramebufferMethod · 0.45
GetViewportStateMethod · 0.45
GetViewOriginMethod · 0.45

Tested by

no test coverage detected