SelectionRenderer::SelectionRenderer() :mCore(nullptr) { HMaterial selectionMat = BuiltinEditorResources::instance().createSelectionMat(); mCore.store(bs_new<SelectionRendererCore>(SelectionRendererCore::PrivatelyConstuct()), std::memory_order_release); gCoreAccessor().queueCommand(std::bind(&SelectionRenderer::initializeCore, this, selectionMat->getCore())); }
/** Create a material using the active shader, and assign the relevant textures to it. */ void createMaterial(Assets& assets) { // Create a material with the active shader. HMaterial exampleMaterial = Material::create(assets.exampleShader); // Assign the four textures requires by the PBS shader exampleMaterial->setTexture("gAlbedoTex", assets.exampleAlbedoTex); exampleMaterial->setTexture("gNormalTex", assets.exampleNormalsTex); exampleMaterial->setTexture("gRoughnessTex", assets.exampleRoughnessTex); exampleMaterial->setTexture("gMetalnessTex", assets.exampleMetalnessTex); assets.exampleMaterial = exampleMaterial; }
SelectionRenderer::SelectionRenderer() { HMaterial selectionMat = BuiltinEditorResources::instance().createSelectionMat(); mRenderer = RendererExtension::create<ct::SelectionRendererCore>(selectionMat->getCore()); }