Need some advice for making a triple star 3D background, please.

DetonatressDetonatress Posts: 48Member

I've heard that particles can be used to make stars, but what about a system like this, of only 3 stars, with one looking like a sun?

So far I've managed to create a sun using the environment, but I doubt the stars would look well due to the way the environment works. They'd just end up moving into the sun the moment the character moves around.

Do I have to paint a sky with the smaller stars and apply it as environment, then add the sun? Is that possible?

Best Answer

  • SIsilicon28SIsilicon28 Posts: 703
    Accepted Answer

    Sort of. Godot doesn't support cubemaps as environment map textures. It uses equirectangular panoramas instead. It should be easy to convert though. Just go to any cubemap to equirectangular converter online, like this one, and use the resulting image in Godot.

Answers

  • cyberealitycybereality Posts: 927Moderator

    Probably the easiest thing would be to use 3D meshes. For simple shapes like spheres, you can create them in Godot without any 3D editor. You can apply different material to get the color you want. If you need them to have any shape, then you'd need to model, but for far away planets, a sphere with a good texture should be fine.

    Also, if they don't move, you can pre-render as a equirectangular cube map (from Blender, or other tools that can generate them). This would use useful if you had a full sky worth of planets and stars, as having it rendered to a single cubemap texture would save a lot of performance (and also probably look better).

  • DetonatressDetonatress Posts: 48Member

    @cybereality said:
    Probably the easiest thing would be to use 3D meshes. For simple shapes like spheres, you can create them in Godot without any 3D editor. You can apply different material to get the color you want. If you need them to have any shape, then you'd need to model, but for far away planets, a sphere with a good texture should be fine.

    Also, if they don't move, you can pre-render as a equirectangular cube map (from Blender, or other tools that can generate them). This would use useful if you had a full sky worth of planets and stars, as having it rendered to a single cubemap texture would save a lot of performance (and also probably look better).

    I have tried the mesh sphere way before resorting to environment sun, but mesh doesn't glow in pitch black void.
    When the sky is blue, sure, it glows (barely):

    But once I darken the background, it's even less convincing:

    Also, if I try to move them into the distance, the viewport cannot "see" all the way there, so they just get swallowed up by the void. If they're too close, changing view angle ruins the illusion when the smaller spheres start "drifting" into the big sun.

    I only need to put the big sun and the 2 stars (story-related, this is all that's left of the universe the drone is exploring). They won't move, but are important to be seen from before entering the space station museum (the green spaceship thing) as well as from one room within it later on.
    Can I load a cubemap into Godot via environment? Because that seems to be my only option. Any mesh cannot be seen that far.

  • SIsilicon28SIsilicon28 Posts: 703Moderator
    Accepted Answer

    Sort of. Godot doesn't support cubemaps as environment map textures. It uses equirectangular panoramas instead. It should be easy to convert though. Just go to any cubemap to equirectangular converter online, like this one, and use the resulting image in Godot.

  • DetonatressDetonatress Posts: 48Member

    @SIsilicon28 said:
    Sort of. Godot doesn't support cubemaps as environment map textures. It uses equirectangular panoramas instead. It should be easy to convert though. Just go to any cubemap to equirectangular converter online, like this one, and use the resulting image in Godot.

    Thanks for the link. I've made one of those that ended up looking like this as a test:

    But where do I load it? If it has to be put on a dome mesh, the problem is the scene seems to not want to allow me to see far enough for a large dome to be put around the space station. Can I adjust the distance / size of the scene so that I can see further away?
    As it is, if I move my camera away, even the gizmos start to get "eaten".

  • SIsilicon28SIsilicon28 Posts: 703Moderator

    Use a WorldEnvironment node to add a custom Environment resource. In there you can set a custom sky.

  • DetonatressDetonatress Posts: 48Member

    @SIsilicon28 said:
    Use a WorldEnvironment node to add a custom Environment resource. In there you can set a custom sky.

    I have one already in the scene, the problem was I was using Procedural Sky instead of Panorama, which doesn't seem to allow for custom images.
    I'll create the suns in Godot, then put them on images and reassemble them into a panoramic image.

  • SIsilicon28SIsilicon28 Posts: 703Moderator

    You can set a custom panorama instead by setting a PanoramaSky instead of a ProceduralSky.

  • DetonatressDetonatress Posts: 48Member
    edited May 10

    @SIsilicon28 said:
    You can set a custom panorama instead by setting a PanoramaSky instead of a ProceduralSky.

    I've replaced the Procedural with Panorama, but now I'll have to figure out how to arrange the stars. I'm not sure how this happened:

    When my cubemap looks like this:

    Cubemaps confuse me.

    The equi map looks like this and doesn't show anything.

    EDIT:
    I had to upload them separately to keep the order. It's almost good. Just need to make the tiny stars look rounder. Maybe if I bring them closer to the sun they'll look better.

  • MegalomaniakMegalomaniak Posts: 2,618Admin

    the middlesome square in the cubemap is the top, right? Equirectangular map gets sort of sphere mapped if you will(think something like UV mapped sphere, though this is a simplification) so with the large star being in the middle it gets drawn at the top(in mapping terms) of the map which is that edge.

  • DetonatressDetonatress Posts: 48Member

    @Megalomaniak said:
    the middlesome square in the cubemap is the top, right? Equirectangular map gets sort of sphere mapped if you will(think something like UV mapped sphere, though this is a simplification) so with the large star being in the middle it gets drawn at the top(in mapping terms) of the map which is that edge.

    Ah so that one was the top. I thought the up one was the top.
    I've chosen the option of uploading the images in order until they were placed correctly, then edited the result in GIMP. At first it crashed Godot for some reason and the error was something along the lines of "Failed to get modified time for: Equirectangular.png"
    Seems to be working now though with a lower res one and doesn't distort too much.

Sign In or Register to comment.