I’ve been working on implementing a procedural sky I’d like to share when completed (maybe a tutorial), but being a noob at some of this, I’m still missing some thing(s).
A technique I’m currently using uses multiple cubemaps as layers - sky, sunlight, sun, etc. The faces are rendered by quad to named rendertargets (‘auxiliary views’ with no camera/scene), which should be sampled later by ‘inner’ cubes. Then I have a Skybox sample that and render to the camera/scene view.
The problem seems to be that nothing is rendered to the quads.
Here’s part of the setup for one cube.
texCube_.SetSize(128, Graphics::GetRGBAFormat(), TEXTURE_RENDERTARGET);
String name = "texcube";
String textureName = "viewport"; // other cubes use named rendertargets
for (unsigned i = 0; i < MAX_CUBEMAP_FACES; ++i) {
RenderTargetInfo rti;
rti.name = name + String(i);
rti.tag_ = name;
rti.filtered_ = true;
rti.persistent_ = true;
rti.size_ = Vector2(128, 128);
rti.format_ = Graphics::GetRGBAFormat();
renderPath->AddRenderTarget(rti);
RenderPathCommand rpc;
rpc.tag_ = name;
rpc.type_ = CMD_QUAD;
rpc.pass_ = "base";
rpc.vertexShadername = "renderface";
rpc.pixelShadername = "renderface";
rpc.outputNames_.Push(name + String(i));
if (textureName != "viewport") {
textureName += String(i); // sequential
}
rpc.textureNames_[TU_DIFFUSE] = textureName;
renderPath->AddCommand(rpc);
RenderSurface* surf = texCube_.GetRenderSurface((CubeMapFace)i);
SharedPtr<Viewport> vp(new Viewport(context_, NULL, NULL, renderPath));
surf->SetViewport(0, vp);
surf->SetUpdateMode(SURFACE_UPDATEALWAYS); // manual later
//etc
}
Grateful for any advice.