1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

UE2 - UT2kX Sun as a corona

Discussion in 'Mapping' started by Mircea, Jun 2, 2008.

  1. Mircea

    Mircea New Member

    Joined:
    Feb 25, 2008
    Messages:
    87
    Likes Received:
    0
    Testing random things around the map I'm currently working on, I managed to find a really beautiful effect I am really determined to add. Like in every outdoor map, I made a skybox and the substract my map is in a fake backdrop. In the skybox I can add the sun as a texture, but then I don't have the advantage of the sun covering things in my view any more and being so big like a real sun. I discovered that by making the sun a lightning corona, I can obtain a beautiful realistic sun effect. Attached a screenshot to display exactly how the sun covers some hills... a very beautiful view to be able to simulate.

    However, I have a big problem with this; The only way I can do it is of course by adding the light with the corona somewhere in the corner of my map (not skybox as through skyboxes a light's corona doesn't render). When the player gets too close, it's easy to see when the image scrolls that the sun is just a fake light put somewhere in the nearby corner, and that ruins everything.

    I thought about making the substract bigger while limiting access to the same area in then map, but ut2k4 has a problem in which geometry and everything else stops being rendered after a certain distance, hiding my light after 50000 meters / units or something like that. To test this just make a giant (but giant) cube in an empty map and substract it... what's too far from the camera displays cut away.

    So what I need is an idea about how I could still have a sun made of a corona that covers what's around it like in the attached screenshot. The methods that would help me accomplish this are:

    - A way to have the light itsself move together with each player's position in the rhythm of the skybox but without ever disappearing outside of my substract. This is probalby not possible unless you can map an item to the position of the camera in a way.

    - A way for the corona to display like that through the skybox... most likely impossible.

    - A way to fix the issue with not rendering anything after a certain distance in the 3D space (most preferred but I want it to be a map setting not UT one so it displays correctly for anyone I send it to).

    - Alternatively to the above, a way for the light's corona to display over *everything* (outside of the substract from mid space and through this cut away distance too)

    This is probably a difficult idea but I'd very much appreciate any way I can make it display in. It's a very nice effect and it's a shame for nothing to be doable for it when there are a bunch of ways. Don't forget however that the sun needs to stop displaying once the light (center of the corona) is covered by something else in the player's view (terrain, another mesh, anything), so the sun doesn't display through objects. So yeah, any idea is welcome.
     
    Last edited: Jun 2, 2008
  2. Hourences

    Hourences New Member

    Joined:
    Aug 29, 2000
    Messages:
    5,050
    Likes Received:
    0
    Just like the fog volume problem, youre hitting the limits of the engine with this issue too. UE3 doesnt has these issues anymore. You cant fix this in UE2 without programming, and likely access to the source code, especially to fix things like the maximum draw distance, which is set at 65536 btw, the old UE1 limit.

    You can make a regular sprite in the skybox, that is camera facing, but then it wont nicely clip over things like a corona does, so thats not the best solution.
     
  3. Mircea

    Mircea New Member

    Joined:
    Feb 25, 2008
    Messages:
    87
    Likes Received:
    0
    Yeah I know the engine doesn't normally accept some things... I was just wondering about a way to improvise as it's really close to looking good. Thought maybe a setting for the light or something could bypass the draw distance or anything like that... I just need the corona itsself to display infinitely.

    [EDIT] Another trick would be making a sprite or simple static mesh render through objects and do that through the skybox. And only disappear when an object covers its center spot. But I'm guessing that's probably hard too...

    [EDIT 2] I did the above and it half-solved the problem. I put on a static mesh, went to the Display area and set DrawType to DT_Sprite then assigned the flare texture under the Texture section. It's now an always facing sprite that renders through the skybox too, but it doesn't cover objects behind it. If anyone knows any trick now to make it be always on top in my field of view unless its center is covered, it would be all I need. In an extreme case, I guess I can even modify the light's code / script to do this but only if nothing else is possible.
     
    Last edited: Jun 2, 2008
  4. xMurphyx

    xMurphyx New Member

    Joined:
    Jun 2, 2008
    Messages:
    1,503
    Likes Received:
    0
    Just a wild idea:
    Maybe you can create a weathereffect that spawns sprites that look like a corona and make it spawn them really far away from the player so that mountains and the like can get between it an the player.
    It's not perfect. For example if you are looking over a huge open plane towards a mountain that is farther away than the spawning sprites it appears before it, which a real sun wouldn't of course, but it's better than nothing.
     
  5. Mircea

    Mircea New Member

    Joined:
    Feb 25, 2008
    Messages:
    87
    Likes Received:
    0
    It wouldn't really work... mainly because I don't think that even weather effects which are spawned at a distance from the player would display through the BSP itsself. Also weather effects are many particles, and first of all weather particles hide like sprites behing stuff, not when the center is reached like a corona.
     
  6. Mircea

    Mircea New Member

    Joined:
    Feb 25, 2008
    Messages:
    87
    Likes Received:
    0
    Ok, I managed to fix this in the end. If anyone else is interested in making such a sun effect on their map, this is what I did; I basically used my first idea, putting the sun corona in the corner of my substract in which the map itsself lyes. However, the problem was that when getting to close it became visible the corona is just floating there above your head. To prevent this, I used the softflare texture from the epic-particles package, and set the corona size so that when you're close it covers the entire screen. Since the softflare texture is half-transparent and the center doesn't differ from the radius, when you're close you just see a brightness increase on your screen when the light is in your FOV but don't see where it's coming from. That fully fixed my issue and I managed to add the sun corona to my map :)
     

Share This Page