Can I create a skybox from a fixed camera location?

A number of game engines support the idea of a fixed camera somewhere in the world that follows camera rotation and projects what it sees first, then what your attached camera sees next.

Is this something that can be done in BabylonJS, maybe not ‘natively’ but perhaps with some tricks?

An example would be, creating a bunch of cubes textured to look like a scifi city, with flying cars all around - and then using that as a backdrop to the main scene’s camera? so you get the feeling there’s a bunch of flying scifi cars overhead.

That is a great question. Maybe @sebavan would know?

I’m not sure if I understand the situation entirely, but perhaps this is a use case for Use Multi-Views - Babylon.js Documentation?

Or RenderTargetTexture as mentioned in this question: Use what a camera sees as a texture

this would be the way : How to use Reflection Probes - Babylon.js Documentation :slight_smile:

@sebavan your response made me realize I’m probably only asking “half a question”, or I’m missing half the story and you’re getting it on a different level than me :wink:

Just to make sure I’m correct here - You’re suggesting to use the reflection probes to draw some geometry into a dynamic texture - and then I would put that into skybox.?

My project, has a lot of dynamic objects coming in the scene (controlled by a user) knowing what’s in the skybox area might run me into an n-body problem. It’s doable, if I partition the scene objects but I was considering an alternative, if this is at all possible…

Can I render the scene twice? Once from my skybox’s area, this skybox will be rather small, so I could set the camera’s limits low - rotate the camera to match the players camera, and then without erasing the canvas, and also maybe the z buffer, draw the scene from the perspective of the players camera and rotation?

I understand the scene might not have proper reflections, but that’s not a concern ATM. There’ will still be a “skybox” 6 sided texture within this skybox area, so I’ll make sure that is the scene’s skybox map and it will look close enough I think.

ohhhh ok so in the case you could look into RenderTargetTexture ? They are able to render any list of chosen objects from a given camera.

You could control their refresh rate and so on.

So yes, it would end up in 2 renders but it should work.