Home Unreal Engine

Moon Texture Issues

polycounter lvl 12
Offline / Send Message
searlee polycounter lvl 12
Hi,

I'm working on a scene for my University project and in the project I'm using an edited version of the Skybox that comes as default. The only problem is that I have a moon texture that I would like to apply to the disk and I cannot for the life of me figure out where I need to plug it in. below is a small section of the shader network that controls the colour and the radius of the sun/moon.

The attached pictures should help (a little) but any help with where I can plug it in or screenshots of the required shader connections would be very much appreciated.

Thanks in advance

Paul :)

Replies

  • Oniram
    Options
    Offline / Send Message
    Oniram polycounter lvl 17
    id say maybe after your last multiply. however since the color of your moon is so intense.. the texture may be very faint.

    you may also have to play around with the size of your moon (both disk and texture) to get them looking right.
  • ImSlightlyBored
    Options
    Offline / Send Message
    ImSlightlyBored polycounter lvl 13
    just multiply over your color with a generic detail texture.

    Personally, I'd recommend a different approach than a sphere mask for that though, just import a clamped (make sure you clamp the UV wrap feature in the texture itself.) texture of the moon if you want a texture defined moon, and scale/reposition/brighten it in the shader, rather than do the sphere mask technique.

    Depends on your direction though, and what's in there at the moment is certainly working.
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    There is a solution, its a lot more than a simple multiply, or just a spot to plug in a moon texture.
    The sphere mask is what creates the disk. The light vector is what positions the center of that disk. The disk is in texture space. So what you'll have to do is position the center of your moon texture at the light vector, then scale the moon to the size of the disk created by the sphere mask, then multiply that texture by your intense moon color.

    I'll have a better explanation in the morning. :)

    Sleep is needed.
  • searlee
    Options
    Offline / Send Message
    searlee polycounter lvl 12
    thanks for the replies,

    @Oniram: I've tried plugging it into where you have said and it just applies itself to the sky rather than the moon disk.

    @ImSlightlyBored: I'll try this but there must be an easier way than changing this whole section of the material network.

    @Vailias: I'm very intrigued, I would like to hear more on this :)

    Thanks again.

    Paul
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    So I have a solution, but it's imperfect, and would likely do better with a different mesh for the skybox.
    However I do have a bright moon texture that follows the light, though it sometimes needs a little adjustment to match the light's position accurately, so it is not suitable for dynamic night/day environments. :/

    InGame.jpg
    ShaderNetwork.jpg
    TextureProperties.jpg
    These bits in the texture are important, so that the moon doesn't repeat all over the sky, or generate weird artifacts in its mip maps.

    For a dynamic textured moon, either a new skybox model (and shader accordingly) will be needed, OR just make a more complex skybox with the clouds as a separate entity from the background, then get the moon in there as a sprite linked to follow a light.
  • searlee
    Options
    Offline / Send Message
    searlee polycounter lvl 12
    I've plugged all that in and cannot get it showing. I assumed that the off-screen connections were going to the same place that they currently go. (left multiply goes to the multiply next to the one minus node) (sphere mask plugs into the same as the other two sphere masks) the texture that I have clamped seems to be streaking across the texture page in the texture sample previewer and I have no sun at all. mental. I'll have a tweak later today. Thanks again. you have been a great help :)
  • searlee
    Options
    Offline / Send Message
    searlee polycounter lvl 12
    Ok, got it working now, just the one problem of it's streaking across the sky from the moon texture :(

    It's clamped in the texture so I don't know what could be causing that. I'm trying to fix it now so I'll shout up if I fix it before anyone replies :)
  • searlee
    Options
    Offline / Send Message
    searlee polycounter lvl 12
    ok, fixed it, false alarm, hadn't hooked up the alpha anywhere on the moon. that seems to work now :)

    thanks again for all your help, case closed!
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    ah good.. I didn't actually use an alpha. The streaking is caused by the mip maps. You need to clamp the texture AND have preserve border checkboxes set.. and ( I forgot to mention) leave at least 2 pixels(preferably 4) of blank space between the edge of the moon and the edge of the texture.
    Glad you got it working. I'm still annoyed its not a perfect projection, but hey, if it works for your purposes then its good enough for now.
  • searlee
    Options
    Offline / Send Message
    searlee polycounter lvl 12
    Yeah, that was the issue, sorted it out now so it has 4 pixels either side of the moon, no streaking and I didn't need to use the alpha. It's not perfect no but it's a damn sight better than a glowing orb with no texture on it, thank you again :)
  • yodude87
    Options
    Offline / Send Message
    yodude87 polycounter lvl 5
    when im working in night scenes i usually just cover the directional light dfisk with a texture on a plane... alpha, diffuse and emissive. that does it for me. nothing fancy, and looks good, as long as you dont have any day-night cycle.
  • downarmy
    Options
    Offline / Send Message
    downarmy polycounter lvl 7
    Hey guys i am trying to get a moon like u guys and i tried to make it whit the sun disk tutorial by julio juarez and all i get is a faint bleu disk is there an easy way to do this? i tried to do the shader u did vallias but there is node that connect outside the image and it still not working

    Thanbks for any help u guys caan get me i am intrigue by the clamp tecnique
Sign In or Register to comment.