Hello Urho’s community,
I just started to develop some thing with Urho but I have some issues with TextureCube.
I just want to bind one texture by side on Box model so I try this:
Urho3D::Model *boxModel = cache->GetResource<Urho3D::Model>("Models/Box.mdl");
Urho3D::TextureCube *myCube = new Urho3D::TextureCube(context_);
Urho3D::Texture2D *leftSide = cache->GetResource<Urho3D::Texture2D>("textures/left_side.png");
Urho3D::Texture2D *rightSide = cache->GetResource<Urho3D::Texture2D>("textures/right_side.png");
...
myCube->SetData(Urho3D::CubeMapFace::FACE_POSITIVE_Z, leftSide->GetImage());
myCube->SetData(Urho3D::CubeMapFace::FACE_NEGATIVE_Z, rightSide->GetImage());
...
Urho3D::Material *cubeMat = new Urho3D::Material(context_);
cubeMat->SetTechnique(0, cache->GetResource<Urho3D::Technique>("Techniques/Diff.xml"));
cubeMat->SetTexture(Urho3D::TU_DIFFUSE, myCube);
Urho3D::Node *boxNode_ = m_scene->CreateChild("Box");
boxNode_->SetPosition(Urho3D::Vector3(17, 34, 17));
boxNode_->SetScale(Urho3D::Vector3(1, 1, 1));
Urho3D::StaticModel *boxObject = boxNode_->CreateComponent<Urho3D::StaticModel>();
boxObject->SetModel(boxModel);
boxObject->SetMaterial(cubeMat);
But I just obtain a black box (and no error has been logged), so what am I doing bad ?