How best to recreate a sun

Killpo1Killpo1 Join Date: 2009-11-13 Member: 69373Members
Hi, I'm currently making a map that utilizing the sun as lighting for a few major areas, has anyone perfected a way to create a very good lightning technique that simulates the sun?
«1

Comments

  • UncleRayUncleRay Join Date: 2010-03-08 Member: 70881Members
    This would be the easiest with creating a sprite, and attaching a light source in front, or behind it. Best of my knowledge :]
  • Donner & BlitzenDonner & Blitzen Join Date: 2010-03-08 Member: 70879Members
    In theory, a very bright light with the colour set to 0 0 0 might look realistic.
  • Killpo1Killpo1 Join Date: 2009-11-13 Member: 69373Members
    See the only problem with doing that is for some reason light likes to clip threw the walls/roofs, lighting up a whole area that was not intended to be lit, so it doesn't really look like a sun but ambient light. If you know a fix for this thought i will <3 you forever, no homo of course
  • WatchMakerWatchMaker Join Date: 2003-09-26 Member: 21233Members, Constellation
    Honestly, I'd go about making a sprite or half dome model. Slap a good texture on it, and with some really clever particle work, it could look really nice.
  • Killpo1Killpo1 Join Date: 2009-11-13 Member: 69373Members
    Watch do you know any way to prevent the sun lighting up an area threw walls? I can show you a screen shot of what i mean if you would like
  • Killpo1Killpo1 Join Date: 2009-11-13 Member: 69373Members
    edited August 2010
    For example note in this picture *The fake sun is on the opposite side of the map, i set it to a very high intensity to demonstrate the effects, notice how it ignores the fact that a face is there and lights up an area as if the face were not there.



    <img src="http://i142.photobucket.com/albums/r93/fatboy987789/Untitled-13.png" border="0" class="linked-image" />
  • pSyk0mAnpSyk0mAn Nerdish by Nature Germany Join Date: 2003-08-07 Member: 19166Members, NS2 Playtester, Squad Five Silver, NS2 Community Developer
    edited August 2010
    The problem is that a lot of props don't have backfaces to block lights from outside.
    First of all you have to use a spot_light with true shadowcasting. Then you either add geometry that causes proper shadows or you adjust the spot_light position, angle, cone and range so it only falls on a certain part of the map, where no additional geometry is needed and the sun_light can actually be seen.


    (Also please post a picture from farther away, so we can see the whole room and the sun above and get an idea how to help.)
  • Killpo1Killpo1 Join Date: 2009-11-13 Member: 69373Members
    edited August 2010
    Here are some shots of the area, theres another but if i can find a way to work with this one i can apply it to the other, this is my best attempt to lighting as you can light still goes threw the walls and such.


    <img src="http://i142.photobucket.com/albums/r93/fatboy987789/lightning3.png" border="0" class="linked-image" />



    <img src="http://i142.photobucket.com/albums/r93/fatboy987789/lightning2.png" border="0" class="linked-image" />



    <img src="http://i142.photobucket.com/albums/r93/fatboy987789/lightning1.png" border="0" class="linked-image" />





    Note: I may very well be scrapping this map due to a few problems with level design.
  • SgtBarlowSgtBarlow Level Designer Join Date: 2003-11-13 Member: 22749Members, NS2 Developer
    I have the same problem, I have it almost totally solved, Will post answer once I ironed out all the drawbacks.
  • AlignAlign Remain Calm Join Date: 2002-11-02 Member: 5216Forum Moderators, Constellation
    edited August 2010
    It's easy enough when it's a circular hole in the ceiling...

    <img src="http://i28.tinypic.com/1247z47.jpg" border="0" class="linked-image" />
    ...but when you've got windows in the wall, you've got a a problem.


    <!--quoteo(post=1790282:date=Aug 1 2010, 08:05 AM:name=pSyk0mAn)--><div class='quotetop'>QUOTE (pSyk0mAn @ Aug 1 2010, 08:05 AM) <a href="index.php?act=findpost&pid=1790282"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->The problem is that a lot of props don't have backfaces to block lights from outside.<!--QuoteEnd--></div><!--QuoteEEnd-->
    It's not just props, though.

    <img src="http://i31.tinypic.com/zn1p4j.jpg" border="0" class="linked-image" />
    This doesn't work obviously, but the solution should be as easy as flipping the faces, right?


    <img src="http://i31.tinypic.com/nw075t.jpg" border="0" class="linked-image" />
    Unfortunately, no...


    <!--quoteo(post=1790324:date=Aug 1 2010, 01:03 PM:name=SgtBarlow)--><div class='quotetop'>QUOTE (SgtBarlow @ Aug 1 2010, 01:03 PM) <a href="index.php?act=findpost&pid=1790324"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I have the same problem, I have it almost totally solved, Will post answer once I ironed out all the drawbacks.<!--QuoteEnd--></div><!--QuoteEEnd-->
    Eagerly awaiting your solution.
  • ThaldarinThaldarin Alonzi&#33; Join Date: 2003-07-15 Member: 18173Members, Constellation
    Just put blank faces on the back of the props? Try and match a similar texture for if it's seen top-down?
  • pSyk0mAnpSyk0mAn Nerdish by Nature Germany Join Date: 2003-08-07 Member: 19166Members, NS2 Playtester, Squad Five Silver, NS2 Community Developer
    edited August 2010
    Why would you have the light_spots cover the whole room, when the light only comes through this two openings?
    Reduce range and change cone, move it closer to the opening and maybe use normal lights to highlight the frame of the opening properly since the light spot is barely hitting it.
    Of course this doesn't always help aswell, but putting a large spot somewhere and cover everything seems a bit lazy to me. I'm fine with being lazy though, when they fix/improve this someday, but for now you've got to be smart or wait.

    Check out that one map with the grate opening and that industrial background?!
  • Chris0132Chris0132 Join Date: 2009-07-25 Member: 68262Members
    Wait until they introduce a light_direct.
  • Eric_JediEric_Jedi Join Date: 2009-12-10 Member: 69567Members
    edited August 2010
    Align - Try welding all your faces. ( If they aren't of course ) .
  • Chris0132Chris0132 Join Date: 2009-07-25 Member: 68262Members
    <!--quoteo(post=1790357:date=Aug 1 2010, 03:52 PM:name=Eric_Jedi)--><div class='quotetop'>QUOTE (Eric_Jedi @ Aug 1 2010, 03:52 PM) <a href="index.php?act=findpost&pid=1790357"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Align - Try welding all your faces. ( If they aren't of course ) .<!--QuoteEnd--></div><!--QuoteEEnd-->

    You can't, there isn't a weld button yet, annoyingly.

    I think it's more that the lighting is a bit odd, shadows start a short distance after the object which casts them, so a marine standing on the floor will seem to be floating, I assume it will be fixed eventually.
  • pSyk0mAnpSyk0mAn Nerdish by Nature Germany Join Date: 2003-08-07 Member: 19166Members, NS2 Playtester, Squad Five Silver, NS2 Community Developer
    You can weld vertices, but you still have duplicate lines, which might not fix the problem!? In this case you have to build everything out of one "brush" in the first place, adding lines and faces.
  • Chris0132Chris0132 Join Date: 2009-07-25 Member: 68262Members
    edited August 2010
    <!--quoteo(post=1790361:date=Aug 1 2010, 04:05 PM:name=pSyk0mAn)--><div class='quotetop'>QUOTE (pSyk0mAn @ Aug 1 2010, 04:05 PM) <a href="index.php?act=findpost&pid=1790361"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->You can weld vertices, but you still have duplicate lines, which might not fix the problem!? In this case you have to build everything out of one "brush" in the first place, adding lines and faces.<!--QuoteEnd--></div><!--QuoteEEnd-->

    If you welded the vertices you can't have duplicate edges.

    What does welding vertices mean in spark? Because in 3ds max it means you pick one vertex and then click another vertex and it removes the first one, and connects all the vertices the first one used to connect to, to the second vertex.

    Essentially you collapse an edge, removing it entirely, so you can't have duplicate edges because you destroyed the duplicate ones to perform the weld.
  • ThaldarinThaldarin Alonzi&#33; Join Date: 2003-07-15 Member: 18173Members, Constellation
    I don't see why you'd ever weld vertices. Just keep your creation neat and tidy, periodically check "show edges" and remove unnecessary lines etc.

    Welding faces just seems a pointless waste of time to me and it removes author freedom.
  • pSyk0mAnpSyk0mAn Nerdish by Nature Germany Join Date: 2003-08-07 Member: 19166Members, NS2 Playtester, Squad Five Silver, NS2 Community Developer
    <!--quoteo(post=1790367:date=Aug 1 2010, 05:14 PM:name=Chris0132)--><div class='quotetop'>QUOTE (Chris0132 @ Aug 1 2010, 05:14 PM) <a href="index.php?act=findpost&pid=1790367"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->If you welded the vertices you can't have duplicate edges.<!--QuoteEnd--></div><!--QuoteEEnd-->
    Yes, you can, at least in spark and it might be fixed (or maybe was with the alpha?).
  • Killpo1Killpo1 Join Date: 2009-11-13 Member: 69373Members
    The real whole purpose was trying to create only one spot light sun for the whole map, make it bright enough and make it cover the right areas, it has the right effect and will simulate the sun, unlike if i use multiple spotlights for the sun, there could be some clear distinctions between a few rooms and somebody saying this doesn't look right the sun was at a completely different angle in that last room!


    But yeah before I came to the forum gods for a response from the almighty, i tried flipping faces and such, and messing with alot of different light setups, duplicating and flipping objects could work but I really think that's a bit much considering i may have 3 rooms lit up by the sun and having to place objects just to block out the sun would seem a bit much when a flipped wall should have done it.
  • ThaldarinThaldarin Alonzi&#33; Join Date: 2003-07-15 Member: 18173Members, Constellation
    Best thing to do is use separate spot lights to cater to your individual lighting needs. To make it more realistic you can light them all in a very similar function and all in the same direction around the map.

    There's currently no light_environment entity or such from what I can see.
  • SgtBarlowSgtBarlow Level Designer Join Date: 2003-11-13 Member: 22749Members, NS2 Developer
    edited August 2010
    Create a new layer called <b><u>CommanderInvisible</u></b> (CASE SENSITIVE! - It is not working for me, either its not implimented or there is another reason why.)

    Create a what I can only describe as a Light Shield and assign that geometry to the new layer so its hidden from commander view.


    <img src="http://www.unitedworlds.co.uk/ns2/lightshield.jpg" border="0" class="linked-image" />


    Like what was previously said, the Shadow offset bug is a problem but if thats fixed this should work best.
  • TquilaTquila Join Date: 2010-02-26 Member: 70738Members, NS2 Playtester
    Hmm havn't tried this. But pursuming you want the sun the ~same place I think I'd do it like this. Have a fixed axis of which your sun is. In theory the sun is infinitly large, so moving the lights on this 1 axis should achive the same thing, as long as the angle of projection is the same. The suns rays are equally infinite so moving it in the depth axis is also possible. So given the angle of projection is correct you can move your lights in the depth axis to achive the spotlight is close to the point of interest, but still in the correct orientation of where the sun is.

    It may be harder than on text as you can't lock an axis (would be awesome though) so moving the lights in the depth field could be tricky.
  • Killpo1Killpo1 Join Date: 2009-11-13 Member: 69373Members
    Alright here's one of the rooms I've tried with just using a really narrow spotlight, still need to create something bright for the sun possible just a circular object that ill just shove a really really bright light in


    <img src="http://i142.photobucket.com/albums/r93/fatboy987789/lighting5.png" border="0" class="linked-image" />
  • AlignAlign Remain Calm Join Date: 2002-11-02 Member: 5216Forum Moderators, Constellation
    <!--quoteo(post=1790401:date=Aug 1 2010, 07:38 PM:name=Killpo1)--><div class='quotetop'>QUOTE (Killpo1 @ Aug 1 2010, 07:38 PM) <a href="index.php?act=findpost&pid=1790401"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->The real whole purpose was trying to create only one spot light sun for the whole map, make it bright enough and make it cover the right areas, it has the right effect and will simulate the sun, unlike if i use multiple spotlights for the sun, there could be some clear distinctions between a few rooms and somebody saying this doesn't look right the sun was at a completely different angle in that last room!<!--QuoteEnd--></div><!--QuoteEEnd-->
    That won't work. Unless you have the light source insanely far away - and I hate to think what that'll do to the resources needed for the light - it's still going to be at slightly different angles in different rooms.
    Far simpler then to simply copy the same spotlight and use it at each sunlit opening (without changing it's angle or other settings, obviously). Just make sure to Group them so you select all of them at once, should you want to change the colour or what have you.
  • Killpo1Killpo1 Join Date: 2009-11-13 Member: 69373Members
    Alright, so i made a sun sprite and added a light to it to try and make it look somewhat like a sun and also here's another room using a closer spotlight then how far the the sun is actually away, however in order to light the sky box areas i also needed to create a sun like light that would end right before it hit the main part of the map, it creates what you see below, Opinions would be nice, also I rather not have my map destroy some ones computer and the one spotlight lighting up that rather large area may be rather demanding any thoughts?

    <img src="http://i142.photobucket.com/albums/r93/fatboy987789/sun1.png" border="0" class="linked-image" />


    <img src="http://i142.photobucket.com/albums/r93/fatboy987789/sun2.png" border="0" class="linked-image" />
  • SgtBarlowSgtBarlow Level Designer Join Date: 2003-11-13 Member: 22749Members, NS2 Developer
    Use the Ambient lights to add directional light to sky props, the Ambients are very cheap. Start Intensity of an Ambient at 200+
    You have lots of control as you have color options for, Front, back, left, right, up and down.
  • pSyk0mAnpSyk0mAn Nerdish by Nature Germany Join Date: 2003-08-07 Member: 19166Members, NS2 Playtester, Squad Five Silver, NS2 Community Developer
    Barlow, it's not a layer but a group.

    CommanderInvisible: All props and geometry placed in a group
    named CommanderInvisible will be invisible to players playing as
    commanders.
  • Killpo1Killpo1 Join Date: 2009-11-13 Member: 69373Members
    Don't worry about it to much any more guys i decided to scrap the heavy reliance on the sun for lighting, it there will be any sun it may just be one sun roof, where multiple angles do not matter.
  • Chris0132Chris0132 Join Date: 2009-07-25 Member: 68262Members
    <!--quoteo(post=1790368:date=Aug 1 2010, 04:17 PM:name=Thaldarin)--><div class='quotetop'>QUOTE (Thaldarin @ Aug 1 2010, 04:17 PM) <a href="index.php?act=findpost&pid=1790368"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I don't see why you'd ever weld vertices. Just keep your creation neat and tidy, periodically check "show edges" and remove unnecessary lines etc.

    Welding faces just seems a pointless waste of time to me and it removes author freedom.<!--QuoteEnd--></div><!--QuoteEEnd-->

    I use it all the time in max, it's often easier to build the object you want a bit roughly and then weld a few vertices later. It also makes it easier to play with later on if you weld all the vertices on an object together rather than having bits intersecting, and it can also be used to keep your surfaces nice and uniform and thus easier to work with, plus any vertices/faces you can eliminate improves performance.

    You don't have to do it, and in some cases it is both easier and more efficient to just intersect geometry, but I certainly like doing it, and it's a useful sculpting tool sometimes as well. It is also essential if you want to use technology like smoothing groups which are very important to create the illusion of smooth surfaces, and it can also be used to fix micro-gaps in geometry.

    I'd really like a max-like weld tool added, as well as a max-like weld selected button which welds any vertices you have selected and which are close to each other together.
Sign In or Register to comment.