Announcement

Collapse
No announcement yet.

Procedural Sky Material: Sunlight slightly off the sun

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Procedural Sky Material: Sunlight slightly off the sun

    Hi there,

    I'm experimenting with procedural sky and sunlight, and I'm experiencing something strange. Perhaps it's a known issue. If it is, please tell me how to fix it. Well, one picture is worth a thousand words, so I've made a screenshot of what I'm talking about.

    Here's the pic: http://img145.imageshack.us/i/lightoff.png/

    As you can probably see in the picture, the sun itself is slightly shifted to the right of its own light shafts. The sun is apparently built from a DominantDirectionalLightMovable.

    So, how do I correct the placement of the sun relative to its light shafts?

    Thanks a lot!

    Hendrik

    #2
    The light shafts are mainly a post process effect and are approximate and not exacting. I suspect you have things lined up just right in a way that exaggerates the approximation. I don't think there is a "fix" fix for it other than work around it on the content side.

    Comment


      #3
      Shouldn't it actually simply work?

      It's created merely by placing a skydome and a DominantDirectionalLightMovable, a terrain and some SpeedTrees. All involved assets and items are from the original UDK package. Aside from the shape of the terrain and the SpeedTrees there's nothing more that I created by myself. I just mixed up existing stuff and, aside from activating the shafts, left all settings on default. So from my point of view this looks like a bug.

      Comment


        #4
        No, I might have confused you with the Content comment. The placement of the lightshafts are approximate as it is mostly a post process effect and not something that actually emits from the light source. I don't know the math behind it, but I do know that the shafts are not actual meshes placed at the light itself.

        What I meant with the content is I think the combination of the camera angle and tree placement exaggerated that approximation. Not that the content itself was the cause.

        Comment


          #5
          Hmm... I'm not sure I'm getting you right. I know that the shafts are not precisely calculated as it would eat up to much performance. But that's not the problem I'm talking about (or is it? I'm not sure).

          Please take a closer look at the picture that I've posted! I'm talking about the distance between the sun disc and the origin of the light shafts. A distance that should be zero (shafts should come out of the center of the sun disc).

          The position of the DominantDirectionalLightMovable seems to become irrelevant for the placement of the shafts as soon as I apply a procedural sky material to the skydome. But that's okay.

          The distance between the sun disc and the shafts however is not okay and I'd like to know what causes this issue and how to fix it, and if anybody else encountered this issue.

          Nevertheless, John J, thanks for your efforts to help me!

          Comment


            #6
            It just happens, apparently it's correct the way it is :\

            Try moving even further away from the world origin, the lightshaft direction will be even more wrong then. I take it that the skydome uses the light vector to calculate the spot of the sun?

            Comment


              #7
              Originally posted by John J View Post
              No, I might have confused you with the Content comment. The placement of the lightshafts are approximate as it is mostly a post process effect and not something that actually emits from the light source. I don't know the math behind it, but I do know that the shafts are not actual meshes placed at the light itself.

              What I meant with the content is I think the combination of the camera angle and tree placement exaggerated that approximation. Not that the content itself was the cause.
              The lightshafts aren't meshes at all, but he's not talking about that.

              They shouldn't be placed anywhere but where the sun is providing you've done the sun positioning correctly.

              Comment


                #8
                Exactly, Legend286.

                The sun positioning is apparently done by the procedural sky material applied to the skydome mesh and hence eludes my influence. It moves across the sky when I change the rotation of the DominantDirectionalLightMovable.

                Playing around with another map I figured that there the shafts are rendered correctly, coming out of the center of the sun. If I remember correctly, there is no difference between the map with the misplaced shaftes and the other map where it works, at least regarding the way I created the lighting.

                The other map though contains no terrain but merely a large block where the player can stand on plus a SkyLight, a DominantDirectionalLightMovable, a skydome mesh and another single small static mesh.

                And there, wonder of wonders, it works!

                Comment


                  #9
                  I may have misunderstood what you were saying then.... The shafts are emitted from the light source and as I said, they are not meshes but a post process effect. I have no idea how that sun disc was built and I think that was the confusion. Regardless, the shafts are approximated and there are cases where they are slightly disconnected from the light source depending on the angle viewed and if there is some unique obstructing geometry, like a tree, placed near by that "scatters" the shafts in a certain way.

                  I was thinking you might have hit that low percentage arrangement of pieces to do that.

                  Comment


                    #10
                    Originally posted by John J View Post
                    I may have misunderstood what you were saying then.... The shafts are emitted from the light source and as I said, they are not meshes but a post process effect. I have no idea how that sun disc was built and I think that was the confusion. Regardless, the shafts are approximated and there are cases where they are slightly disconnected from the light source depending on the angle viewed and if there is some unique obstructing geometry, like a tree, placed near by that "scatters" the shafts in a certain way.

                    I was thinking you might have hit that low percentage arrangement of pieces to do that.
                    The lightshaft position isn't approximated though, so his sun should be exactly in the right place.

                    Comment


                      #11
                      My SunLightShafts looks this http://picfront.de/d/86tB
                      I've followed that Tutorial http://forums.epicgames.com/showthread.php?t=744541 and placed the material on a "naked" Skydome.

                      Comment


                        #12
                        Yeah, the position should be correct. What I was talking about (I didn't explain it very well at all) was that the effect of the shafts is approximate. So based on view angle and geometry its casting through, you can see the shafts at slightly odd angles and things like that. Trees produce more "shafts" so it can get more pronounced. One area I have seen a few times is shadows of trees on the ground are not at the same angle as the light shafts.

                        All that being said, we are really talking two different things here anyway.

                        Comment


                          #13
                          But you might be right regarding the cause of the problem, John J. The items that produce the shafts are indeed trees as you all probably can see on the picture. On the other hand, the map that behaves as designated, as I already mentioned, contains no trees, but only some static meshes, some brushes, a skydome with the very same procedural material as the one in the map that doesn't, and the light source.

                          However, considering all this I tend to come to the conclusion that this behavior is a bug (or let me call it 'maloperation') caused by erroneous calculations concerning the approximation of the shafts. Or is it finally indeed intended to behave like that?

                          Comment

                          Working...
                          X