i’m getting a strange error in the script that i made to teste the pc.RenderTarget, it says: ERROR: FRAMEBUFFER_INCOMPLETE_ATTACHMENT
i did not find any solution or at least a cause for this here is the script code atached to a camera:
var texture = this.app.assets.get(5036732); //Getting the CubeMap
var renderTarget = new pc.RenderTarget(this.app.graphicsDevice, texture,{
face: 0
});
this.entity.camera.renderTarget = renderTarget;
You can’t create a cubemap (or regular 2D texture) in the PlayCanvas UI and then render to it. Although we recognise this would be a cool feature to have and we’ll no doubt add it before too long.
In the meantime, it’s probably easier to achieve what you want to do in script. I’ve had a first stab here:
There’s a few problems though. First, the cubemap looks flipped horizontally (looks at the cone and the cylinder). Also, I can’t figure out how to generate a mipmapped cubemap so I’ve set the filter to bilinear for now. But it’s close and a good start. Maybe @Mr_F has some thoughts on this topic. It would be cool if dynamic cubemaps were easier to achieve generally.