| 158 | } |
| 159 | |
| 160 | bool 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 | |
| 187 | bool ReflectionsPass::setupResources() |
| 188 | { |
no test coverage detected