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

Method Init

Source/Engine/Renderer/ReflectionsPass.cpp:160–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158}
159
160bool ReflectionsPass::Init()
161{
162#if GENERATE_GF_CACHE
163 // Generate cache
164 PreIntegratedGF::Generate();
165#endif
166
167 // Create pipeline states
168 _psProbe = GPUDevice::Instance->CreatePipelineState();
169 _psProbeInside = GPUDevice::Instance->CreatePipelineState();
170 _psCombinePass = GPUDevice::Instance->CreatePipelineState();
171 _depthBounds = GPUDevice::Instance->Limits.HasDepthBounds && GPUDevice::Instance->Limits.HasReadOnlyDepth;
172
173 // Load assets
174 _shader = Content::LoadAsyncInternal<Shader>(TEXT("Shaders/Reflections"));
175 _sphereModel = Content::LoadAsyncInternal<Model>(TEXT("Engine/Models/Sphere"));
176 _boxModel = Content::LoadAsyncInternal<Model>(TEXT("Engine/Models/Box"));
177 _preIntegratedGF = Content::LoadAsyncInternal<Texture>(PRE_INTEGRATED_GF_ASSET_NAME);
178 if (_shader == nullptr || _sphereModel == nullptr || _boxModel == nullptr || _preIntegratedGF == nullptr)
179 return true;
180#if COMPILE_WITH_DEV_ENV
181 _shader.Get()->OnReloading.Bind<ReflectionsPass, &ReflectionsPass::OnShaderReloading>(this);
182#endif
183
184 return false;
185}
186
187bool ReflectionsPass::setupResources()
188{

Callers 2

setupResourcesMethod · 0.45
RenderMethod · 0.45

Calls 3

GenerateFunction · 0.85
CreatePipelineStateMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected