| 57 | } |
| 58 | |
| 59 | bool Skybox::init() |
| 60 | { |
| 61 | _customCommand.setTransparent(false); |
| 62 | _customCommand.set3D(true); |
| 63 | |
| 64 | _customCommand.setBeforeCallback(AX_CALLBACK_0(Skybox::onBeforeDraw, this)); |
| 65 | _customCommand.setAfterCallback(AX_CALLBACK_0(Skybox::onAfterDraw, this)); |
| 66 | |
| 67 | // create and set our custom shader |
| 68 | setProgramStateByProgramId(backend::ProgramType::SKYBOX_3D); |
| 69 | |
| 70 | auto& pipelineDescriptor = _customCommand.getPipelineDescriptor(); |
| 71 | |
| 72 | pipelineDescriptor.programState = _programState; |
| 73 | // disable blend |
| 74 | pipelineDescriptor.blendDescriptor.blendEnabled = false; |
| 75 | |
| 76 | _uniformColorLoc = _programState->getUniformLocation("u_color"); |
| 77 | _uniformCameraRotLoc = _programState->getUniformLocation("u_cameraRot"); |
| 78 | _uniformEnvLoc = _programState->getUniformLocation("u_Env"); |
| 79 | |
| 80 | initBuffers(); |
| 81 | return true; |
| 82 | } |
| 83 | |
| 84 | bool Skybox::init(std::string_view positive_x, |
| 85 | std::string_view negative_x, |
no test coverage detected