Generating a skybox based on physics data

Is it possible to do this with panda and how? I wish to create a skybox from a generated sky image like this: … ning_1.png … ning_2.png … ning_6.png … ethane.png … ethane.png … ethane.png

The problem is that images cannot be pre-rendered. The sun position depends on the date and time of the day which is different for each star system and also the atmosphere composition and the type of star. Starflight (the game we are trying to remake) has aprox. 1000 procedurally generated planets.

i found that you can use draw your sky scene take a snap shot with
base.saveCubeMap(‘sky_#.jpg’, size = 2048)
then load it again as a cube map. I dont want to to by dynamic every second b/c that is very expansive for large sky boxes like mine so this work out except i cant get the stupid transparency to work right it alpha blits with bad results on my card hope you have better luck!

This is what I do:

(1) For geometry I use a sky-dome (basically the upper third of a sphere)
(2) For the gradient two colours (zenith and horizon) that change with time-of-day, or in your case the current planet. And either a shader (color transition based on interpolated z in the fragment shader) or, if you don’t want to use shaders, you can do a monochrome sky dome with zenith color and then apply a fog to it with horizon colour. Gradient can be controlled via the sky-dome curvature.
(3) For the sun I use a simple billboard (point eye mode) than moves inside the sky-dome.

Hint 1: have a look at texture wrap modes if you have strange strips near the edges.
Hint 2: the python bisect module is useful for colour-table lookups too.


well for the sky itself you could use a number of prerendered textures. lets say one for every or every two hours and blend two of them together using a lerpinterval. for the sun you can go ennox’s way. oyu can change size and brightness of the sun depending on the daytime.
oh. if you want a nice sun-set you should use distant fog with the same color as the horizon has :slight_smile:, looks good =)

Thanks. The problem remains how to generate a sky texture dynamically. There’s just too many variables for planets (star class, orbit number, planet size, atmosphere composition) to have it in any other way.

Computing the image would not have to be done every frame. It could be done every 5 minutes and then swap textures so this would not be a problem.

PS: Shaders may be the best solution but it’s too complex for me at the moment.

I agree with treeform. Create a cube map by rendering the sky objects at the beginning of the level. Use a simple LOD system where most objects in the distance (most stars and far off planets) can simply be rendered as a screen sprite with modulated brightness, color, size, and alpha value.

If some objects need to move in real time, I would isolate these and render the other objects into the cube map, then render the moving objects in real time.