MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / RenderDebug

Method RenderDebug

Source/Engine/Renderer/GlobalSignDistanceFieldPass.cpp:1075–1103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1073}
1074
1075void GlobalSignDistanceFieldPass::RenderDebug(RenderContext& renderContext, GPUContext* context, GPUTexture* output)
1076{
1077 BindingData bindingData;
1078 if (Render(renderContext, context, bindingData))
1079 {
1080 context->Draw(output, renderContext.Buffers->GBuffer0);
1081 return;
1082 }
1083
1084 PROFILE_GPU_CPU("Global SDF Debug");
1085 const Float2 outputSize(output->Size());
1086 {
1087 Data data;
1088 data.ViewWorldPos = renderContext.View.Position;
1089 data.ViewNearPlane = renderContext.View.Near;
1090 data.ViewFarPlane = renderContext.View.Far;
1091 for (int32 i = 0; i < 4; i++)
1092 data.ViewFrustumWorldRays[i] = Float4(renderContext.List->FrustumCornersWs[i + 4], 0);
1093 data.GlobalSDF = bindingData.Constants;
1094 context->UpdateCB(_cb0, &data);
1095 context->BindCB(0, _cb0);
1096 }
1097 context->BindSR(0, bindingData.Texture ? bindingData.Texture->ViewVolume() : nullptr);
1098 context->BindSR(1, bindingData.TextureMip ? bindingData.TextureMip->ViewVolume() : nullptr);
1099 context->SetState(_psDebug);
1100 context->SetRenderTarget(output->View());
1101 context->SetViewportAndScissors(outputSize.X, outputSize.Y);
1102 context->DrawFullscreenTriangle();
1103}
1104
1105void GlobalSignDistanceFieldPass::GetCullingData(BoundingBox& bounds) const
1106{

Callers

nothing calls this directly

Calls 12

Float4Class · 0.85
RenderFunction · 0.50
DrawMethod · 0.45
SizeMethod · 0.45
UpdateCBMethod · 0.45
BindCBMethod · 0.45
BindSRMethod · 0.45
ViewVolumeMethod · 0.45
SetStateMethod · 0.45
SetRenderTargetMethod · 0.45
ViewMethod · 0.45

Tested by

no test coverage detected