For a few weeks, ProcSky component is failing to render TextureCube faces. ghidra helped to narrow the problem.
Unlike RenderToTexture sample, I did not need to setup RenderSurfaces or new viewports or rendering camera… just render quads. I think the problem is not in the shader.
Currently I am looking at this in particular (edited slightly for clarity):
// Create a Skybox to draw to. Set its Material, Technique, and render size.
skybox_ = node_->CreateComponent<Skybox>();
Model* model(cache->GetResource<Model>("Models/Box.mdl"));
skybox_->SetModel(model);
SharedPtr<Material> skyboxMat(new Material(context_));
skyboxMat->SetTechnique(0, cache->GetResource<Technique>("Techniques/DiffSkybox.xml"));
skyboxMat->SetCullMode(CULL_NONE);
skybox_->SetMaterial(skyboxMat);
SetRenderSize(renderSize_);
ProcSky::SetRenderSize(unsigned size) {
// Create a TextureCube and assign to the ProcSky material.
SharedPtr<TextureCube> skyboxTexCube(new TextureCube(context_));
skyboxTexCube->SetName("DiffProcSky");
skyboxTexCube->SetSize(size, Graphics::GetRGBAFormat(), TEXTURE_RENDERTARGET);
skyboxTexCube->SetFilterMode(FILTER_BILINEAR);
skyboxTexCube->SetAddressMode(COORD_U, ADDRESS_CLAMP);
skyboxTexCube->SetAddressMode(COORD_V, ADDRESS_CLAMP);
skyboxTexCube->SetAddressMode(COORD_W, ADDRESS_CLAMP);
GetSubsystem<ResourceCache>()->AddManualResource(skyboxTexCube);
skybox_->GetMaterial()->SetTexture(TU_DIFFUSE, skyboxTexCube);
renderSize_ = size;
}
Full source github.com/carnalis/ProcSky/blo … ProcSky.cc
Maybe I was not using the proper way to accomplish RTT.
Maybe a recent change requires one of my own?
Only this recent commit stands out: github.com/urho3d/Urho3D/commit … 54913455c8
Any advice is welcome.