Spark Engine: Light Emmision

SgtBarlowSgtBarlow Level Designer Join Date: 2003-11-13 Member: 22749Members, NS2 Developer
<b>Is it not possible?</b>
to have the <b>models give light</b> by having an "exsisting object in" or "adding an invisible object to" or "Grouped Light Points in" the model?
Possibly more than one with identifiers, instead of pairing them up with (Single/Multiple) POINT LIGHT Sources that makes light from long flourecants (for example) look false.
Then have a codeup on the model entity settings in the editor:
IF light emission exsist in model :
{ show light settings in entity properties for model { loop object id's if more than one source of light exsists } }.

This way the model is carrying light info and the light emitted from the model is the same shape as say an oblong light fitting or that 360 wall mount tube...
It would be better than having everything looking like its being emitted from multiple POINT light sources, Light PLANE sources in the moddel with applyable settings would be better
Same as Textlights but without the text file...

Comments

  • Chris0132Chris0132 Join Date: 2009-07-25 Member: 68262Members
    edited November 2009
    You would use a prefab for this, normally.

    Once they add prefab or at least group support you should have no problem.

    Rendering area lights in realtime is really not practical, because you'd need to just put a million point lights in the volume, which is how they do it in pre rendererd systems.

    You can create perfectly good lighting from spots and omnis, every game ever has done this.
  • SgtBarlowSgtBarlow Level Designer Join Date: 2003-11-13 Member: 22749Members, NS2 Developer
    edited November 2009
    <!--quoteo--><div class='quotetop'>QUOTE</div><div class='quotemain'><!--quotec-->You can create perfectly good lighting from spots and omnis, every game ever has done this.<!--QuoteEnd--></div><!--QuoteEEnd-->

    indeed, it would be nice to break away from this, its been ok but when you use big tubed lighting in smaller areas
    you can clearly see the light is emitted from 2 or more points along the tube.
    I got round this in the HL1 and Source engine by createing a library of transparent textures with the textlights file for
    use on a square/shape I could drag out over the visual light source to achive my square light when it hits a sufrace as
    apposed to the bubble effect from mitiple spot lights. As you can imagine it aint that brilliant of a thing to do but it works.

    If UWE can embed the textlight concept into the models it would be very very nice indeed and very pretty. :)
  • doesephdoeseph Join Date: 2009-11-22 Member: 69467Members, NS2 Playtester, Subnautica Playtester
    Are you referring to self-illumination/glow maps? Omni and Point lights are the only two types of light sources you need really, it just takes some work to get what you want most of the time.
  • SgtBarlowSgtBarlow Level Designer Join Date: 2003-11-13 Member: 22749Members, NS2 Developer
    edited November 2009
    No, i mean instead of us placeing "point entitys" infront of models of lights, the light models have "brush entitys" already in them (so to say) and the model carry the light settings for that brush entity thats inside it. then we can edit it in Spark to change the color, distance, intesity when we select a model that has light info in it.

    This is not needed for spot lights thought in concept cause you might as well still use the spot light entity for those, I am just talking about BIG lights that dont look right when used with point entity sources.


    I am talking about light_spots on big square lights or flourescent lights looking bad.
  • EmooEmoo Ibasa Join Date: 2002-12-20 Member: 11198Members
    Texture lights (which would have to be implemented as area lights) are much much harder to render, it requires an integral of the lighting equation over each point on the surface lit as opposed to just a single light equation. The other way is to fake it by automaticly spawning lots of point/spot lights, but we can do that anyway and adjust the amount for performance.
  • SgtBarlowSgtBarlow Level Designer Join Date: 2003-11-13 Member: 22749Members, NS2 Developer
    edited November 2009
    Of course yes, but if they can find a cheap solution we should have it, I was thinking it might be possible when i think about the cones on light spots, is it that much harder to caulcualte a <b>square</b> cone if its given a 2d wireframe shape in the model to caculate from so its got its volumetric base shape to start from?. Then do what its told to do with the Inner, outer bright angles and falloff given by the mapper..
  • doesephdoeseph Join Date: 2009-11-22 Member: 69467Members, NS2 Playtester, Subnautica Playtester
    edited January 2011
  • MidoMido Join Date: 2004-04-05 Member: 27742Members
    edited November 2009
    <!--quoteo(post=1740738:date=Nov 27 2009, 02:34 AM:name=doeseph)--><div class='quotetop'>QUOTE(doeseph @ Nov 27 2009, 02:34 AM) <a href="index.php?act=findpost&pid=1740738"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->(although I'm not completely clear on it), but it also sounds like an idea that can wait until after NS2 is released.<!--QuoteEnd--></div><!--QuoteEEnd-->

    He's asking for textures and models to have properties about them that light up the level. Much like you could specify light textures in half life 1. The problem is that the lighting method isn't baked and the only way this idea would work reasonably well would to 1. bake it upon compile 2. spawn a billion little lights. Neither of which are possible/feasible. What Emoo was saying is that the lighting shader would have to have a whole new part added to look at the light properties of the textures (or another variable added into the basecode and passed to the shaders) for such lighting, and it's just a headache.
  • SgtBarlowSgtBarlow Level Designer Join Date: 2003-11-13 Member: 22749Members, NS2 Developer
    edited November 2009
    Is that much more of a ballache to do than achiveing dynamic shadows?
    I thought that this would not be much different from dynamic shadows in the game, what about a hack from that (so to say), opposite of casting a shadow, if they can get a square shadow to be cast then it must be feasable to cast a soft square light.


    What I have in mind might:

    1) If done right I belive it can improve performance and replace the situation where mappers are putting 2 - 3 point spot_light entities in a line for long lights because the more dynamic lights there are the more it costs in the scene.
    2) It would simply look more aspheticaly pleasing graphics wise.
    3) It would be a tiny tiny bit quiker for the mapper for placement and adjustment, say if you decide to change the intesity or color of that big light or its position, you goto grab those 2 entitys and edit them both, to move it you gotta grab all 3 parts as we dont have "Grouping/unGrouping" yet either in the editor.

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

    <img src="http://www.unitedworlds.co.uk/online-gaming/l2.jpg" border="0" class="linked-image" />
  • TurtleTurtle Join Date: 2002-10-18 Member: 1540Members
    You're using way too many spotlights. Spotlights are more situational, just use more point lights as needed. Those flourescent lamps would be casting light out in a more circular pattern anyway, they aren't spot lights. it's best to think of spot lights as just that, real-life spot lights, a highly directional light with very little scatter. Most lights are supposed to scatter light around.

    And yeah, area lights are way too render intensive to do in a fully real-time lighting engine.

    You can also play around with the outer and inner angles of spotlights to cut down on how well defined the ledges are for the spotlight.
  • doesephdoeseph Join Date: 2009-11-22 Member: 69467Members, NS2 Playtester, Subnautica Playtester
    edited November 2009
    Your last screenshot shows two lights for one mesh, the same effect could be achieved with one spot light if you utilized the inner/outer radius settings. Then all you'd need to do is place an omni to simulate bounce/reflect light.
  • EmooEmoo Ibasa Join Date: 2002-12-20 Member: 11198Members
    <!--QuoteBegin-"SgtBarlow"+--><div class='quotetop'>QUOTE("SgtBarlow")</div><div class='quotemain'><!--QuoteEBegin-->Of course yes, but if they can find a cheap solution we should have it<!--QuoteEnd--></div><!--QuoteEEnd-->
    There is no cheep solution for area lights, it pretty much has to be an integral which is expensive.
    <!--QuoteBegin-"SgtBarlow"+--><div class='quotetop'>QUOTE("SgtBarlow")</div><div class='quotemain'><!--QuoteEBegin-->is it that much harder to caulcualte a square cone if its given a 2d wireframe shape in the model to caculate from so its got its volumetric base shape<!--QuoteEnd--></div><!--QuoteEEnd-->
    Yes it really is, it would have to calculate the light eqn from every point on the square to every point being lit! Thats a massive amount more than calculating the eqn from one point to every point lit.

    Games havn't used texture lights since we stopped using pre-calculated lighting, it's too much work currently to do in real time. Just be an artist and use what you've been given to achive better effects. Most players won't really care if a straight light has a slightly circular lighting shape.
  • InsaneInsane Anomaly Join Date: 2002-05-13 Member: 605Members, Super Administrators, Forum Admins, NS1 Playtester, Forum Moderators, NS2 Developer, Constellation, NS2 Playtester, Squad Five Blue, NS2 Map Tester, Subnautica Developer, Pistachionauts, Future Perfect Developer
    <!--quoteo(post=1740776:date=Nov 27 2009, 09:47 AM:name=Turtle)--><div class='quotetop'>QUOTE(Turtle @ Nov 27 2009, 09:47 AM) <a href="index.php?act=findpost&pid=1740776"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->You're using way too many spotlights. Spotlights are more situational, just use more point lights as needed. Those flourescent lamps would be casting light out in a more circular pattern anyway, they aren't spot lights. it's best to think of spot lights as just that, real-life spot lights, a highly directional light with very little scatter. Most lights are supposed to scatter light around.<!--QuoteEnd--></div><!--QuoteEEnd-->

    That's quite subjective. Spotlights with a wide angle can do quite well at simulating various kinds of real-world lights, especially if a dim point light is used as well in order to simulate the bounce lighting. It's just a case of going with works best.
  • Chris0132Chris0132 Join Date: 2009-07-25 Member: 68262Members
    edited November 2009
    <!--quoteo(post=1740737:date=Nov 27 2009, 07:27 AM:name=SgtBarlow)--><div class='quotetop'>QUOTE(SgtBarlow @ Nov 27 2009, 07:27 AM) <a href="index.php?act=findpost&pid=1740737"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Of course yes, but if they can find a cheap solution we should have it, I was thinking it might be possible when i think about the cones on light spots, is it that much harder to caulcualte a <b>square</b> cone if its given a 2d wireframe shape in the model to caculate from so its got its volumetric base shape to start from?. Then do what its told to do with the Inner, outer bright angles and falloff given by the mapper..<!--QuoteEnd--></div><!--QuoteEEnd-->

    There is a cheap solution, it's using point and spot lights, which is why I said it in the first place.

    The examples you posted look fine, you don't have to perfectly simulate lights, the rule is how it looks, not how it is in reality. A lot of filming is about inserting lights which don't exist in the scene, cutting out shadows, ensuring character's faces are always visible etc. In a game you don't have to abide by the laws of physics and you honestly shouldn't. HL2 if you look at it has spotlights which don't make sense but you accept them because they look better than the alternative, realistic lighting.

    Once they add projection maps for lights so you can project light shining through a mesh without the mesh, or certain shapes, you'll be able to anything you could possibly need.
  • ArkArk Join Date: 2009-08-15 Member: 68489Members
    <!--quoteo(post=1740776:date=Nov 27 2009, 09:47 AM:name=Turtle)--><div class='quotetop'>QUOTE(Turtle @ Nov 27 2009, 09:47 AM) <a href="index.php?act=findpost&pid=1740776"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->You're using way too many spotlights. Spotlights are more situational, just use more point lights as needed. Those flourescent lamps would be casting light out in a more circular pattern anyway, they aren't spot lights. it's best to think of spot lights as just that, real-life spot lights, a highly directional light with very little scatter. Most lights are supposed to scatter light around.

    And yeah, area lights are way too render intensive to do in a fully real-time lighting engine.

    You can also play around with the outer and inner angles of spotlights to cut down on how well defined the ledges are for the spotlight.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Urm... I think it's quite the opposite, think of how many lights illuminate in all directions (point) compared directional lights (spots). Many people think household bulbs are omni directional but there not because of there fitting.

    Spots are better suited for lamps and stuff that as a focused beam, keep the point lights for ambients and such.
  • Chris0132Chris0132 Join Date: 2009-07-25 Member: 68262Members
    Use spots when you need to point light in a direction, use omni when you want to shine it in all areas.

    Which you use to achieve an effect is irrelevant.
  • monopolowamonopolowa Join Date: 2004-05-23 Member: 28839Members
    I tried making a bright spotlight above the level, and using a few brushes (also above the level) to shape the cone into a rectangle. It works but it also casts a shadow of the light prop. Maybe someone could make a few lighting props that would allow light to pass through

    I also made an oval spotlight by changing the angles of 2 spots...it's not perfect, but it might be tweaked to simulate a non-point source

    <a href="http://img20.imageshack.us/i/lights1.jpg/" target="_blank"><img src="http://img20.imageshack.us/img20/9625/lights1.th.jpg" border="0" class="linked-image" /></a> <a href="http://img301.imageshack.us/i/lights3.jpg/" target="_blank"><img src="http://img301.imageshack.us/img301/500/lights3.th.jpg" border="0" class="linked-image" /></a> <a href="http://img130.imageshack.us/i/lights2.jpg/" target="_blank"><img src="http://img130.imageshack.us/img130/9593/lights2.th.jpg" border="0" class="linked-image" /></a>
  • Chris0132Chris0132 Join Date: 2009-07-25 Member: 68262Members
    <!--quoteo(post=1740976:date=Nov 27 2009, 08:19 PM:name=monopolowa)--><div class='quotetop'>QUOTE(monopolowa @ Nov 27 2009, 08:19 PM) <a href="index.php?act=findpost&pid=1740976"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I tried making a bright spotlight above the level, and using a few brushes (also above the level) to shape the cone into a rectangle. It works but it also casts a shadow of the light prop. Maybe someone could make a few lighting props that would allow light to pass through

    I also made an oval spotlight by changing the angles of 2 spots...it's not perfect, but it might be tweaked to simulate a non-point source

    <a href="http://img20.imageshack.us/i/lights1.jpg/" target="_blank"><img src="http://img20.imageshack.us/img20/9625/lights1.th.jpg" border="0" class="linked-image" /></a> <a href="http://img301.imageshack.us/i/lights3.jpg/" target="_blank"><img src="http://img301.imageshack.us/img301/500/lights3.th.jpg" border="0" class="linked-image" /></a> <a href="http://img130.imageshack.us/i/lights2.jpg/" target="_blank"><img src="http://img130.imageshack.us/img130/9593/lights2.th.jpg" border="0" class="linked-image" /></a><!--QuoteEnd--></div><!--QuoteEEnd-->

    That's why you would use projection maps.

    It basically lets you project a shape by hooking a texture into a light, so you could make an oval spotlight if you wanted, or an oblong one. It's a basic thing and should be in the engine eventually, it was in doom 3.
  • TurtleTurtle Join Date: 2002-10-18 Member: 1540Members
    <!--quoteo(post=1740943:date=Nov 27 2009, 10:51 AM:name=Ark)--><div class='quotetop'>QUOTE(Ark @ Nov 27 2009, 10:51 AM) <a href="index.php?act=findpost&pid=1740943"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Urm... I think it's quite the opposite, think of how many lights illuminate in all directions (point) compared directional lights (spots). Many people think household bulbs are omni directional but there not because of there fitting.

    Spots are better suited for lamps and stuff that as a focused beam, keep the point lights for ambients and such.<!--QuoteEnd--></div><!--QuoteEEnd-->

    This is partially true, but realize we're not working with a high end renderer here, let alone any pre-rendering. With game lights, you need to fake a lot of stuff. By using a point light as opposed to a spot for those ceiling lights, you're not only replicating the light from the ceiling lamp, which really isn't as directional as people think since they're meant to light rooms, you're also mimicking the bounce light coming from that harsh spot and filling the room.

    To be frank, go to your office, school, or any other building. Those ceiling lights are the same or similar to the ones in the game. The light they cast are deliberately not as harsh as the spot lights you see him using, they're meant to fill rooms up with light, even if it seems at first that the lights would be directional. The reality is, these fixtures are area lights as the OP wanted, they wouldn't cast that hard of a shadow unless the objects where at a certain distance.

    There is a bit of artistic and stylistic choice to this though. I prefer to hold off on more of the hard edged shadows so that when I do finally put one in, it acts as a contrast and artistic accent rather than. It also does a better job of mimicking global illumination.
  • spellman23spellman23 NS1 Theorycraft Expert Join Date: 2007-05-17 Member: 60920Members
    <!--quoteo(post=1740736:date=Nov 27 2009, 01:23 AM:name=Emoo)--><div class='quotetop'>QUOTE(Emoo @ Nov 27 2009, 01:23 AM) <a href="index.php?act=findpost&pid=1740736"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Texture lights (which would have to be implemented as area lights) are much much harder to render, it requires an integral of the lighting equation over each point on the surface lit as opposed to just a single light equation. The other way is to fake it by automaticly spawning lots of point/spot lights, but we can do that anyway and adjust the amount for performance.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Yeah, was wondering where texture lighting went.


    While it makes life more difficult to render dynamically (look, light source at every point!), it was really useful in HL1 for smoother light maps and then you just re-use that texture to get lighting in your map.


    So, adding texture lighting sucks for dynamic rendering. However, we got away with it when we compiled the light maps. Also, if we have it, it looks a lot better in some cases and is easier to use in some cases.
  • TriggermanTriggerman Graphic Artist Join Date: 2004-11-10 Member: 32724Members, WC 2013 - Supporter
    Hardly a problem not having texture-lights. The game is not pre-rendering and that's really a good thing (as said, you would have to emit light from every point on the texture compared to the entity-lights that only have one).
    I've seen my friends who have worked with Hammer and the rendering process is not something you want to do in the long run.
    Would be interesting to shape the light being cast into oval or rectangular shapes but I think it's just wasted effort on the developers side to do this.
  • Chris0132Chris0132 Join Date: 2009-07-25 Member: 68262Members
    edited November 2009
    <!--quoteo(post=1741019:date=Nov 27 2009, 10:05 PM:name=Triggerman)--><div class='quotetop'>QUOTE(Triggerman @ Nov 27 2009, 10:05 PM) <a href="index.php?act=findpost&pid=1741019"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Hardly a problem not having texture-lights. The game is not pre-rendering and that's really a good thing (as said, you would have to emit light from every point on the texture compared to the entity-lights that only have one).
    I've seen my friends who have worked with Hammer and the rendering process is not something you want to do in the long run.
    Would be interesting to shape the light being cast into oval or rectangular shapes but I think it's just wasted effort on the developers side to do this.<!--QuoteEnd--></div><!--QuoteEEnd-->

    More like vital if you want the flashlight to have the flashlight look to it, it's the same technology that does that. Without it you can only have flat circles maybe with fading edges.

    Instead of projecting a simple flat colour you project a map, so it's basically like a decal with shadowing.

    It's also quite useful for optimisation, because if you make a texture like light shining through a grate, you can project that instead of having to enable shadows for that light and put it behind a grate. So it can cut out a lot of shadowing overhead while maintaining a varied light distribution.
  • spellman23spellman23 NS1 Theorycraft Expert Join Date: 2007-05-17 Member: 60920Members
    It's a tradeoff.

    Pre-compiled is awesome for faster rendering, more complex fixed shadowing/lighting, and texture lighting to have awesome effects. However, it takes about an hour on my gaming rig to calculate everything for my NS map.

    Dynamic lights can't deal with giant clusters of light sources (i.e. a texture lighting). However, you get nice dynamic shadowing for when say a crate moves or a grate opens or closes.


    NS2 has chosen dynamic lighting.


    There are hybrid systems, but I don't know what they're using for optimizations.

    One clever way around this would be to use like 3 light sources along the length. More for longer light sources. This will slow the rednering down a little, but help give the more oblong shaping.
  • MidoMido Join Date: 2004-04-05 Member: 27742Members
    <!--quoteo(post=1741107:date=Nov 27 2009, 10:28 PM:name=spellman23)--><div class='quotetop'>QUOTE(spellman23 @ Nov 27 2009, 10:28 PM) <a href="index.php?act=findpost&pid=1741107"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->There are hybrid systems, but I don't know what they're using for optimizations.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Unreal is a good example, it lets you do everything. You can do dynamic lighting, color vertex lighting (has a paint brush tool for this), light map lighting. Being good at unreal editing comes down to knowing what to use and how. NS2 cuts out a lot of the complication and just leaves it up to a good dynamic lighting system.
  • TerrTerr Arthritic Skulk Join Date: 2002-11-07 Member: 7486Members
    IMO NS is one of those games that could get by with a decent amount of ambient light and only a few dynamic sources in a room. If we were talking about massive <b>outdoor</b> areas, however...
  • TriggermanTriggerman Graphic Artist Join Date: 2004-11-10 Member: 32724Members, WC 2013 - Supporter
    <!--quoteo(post=1741075:date=Nov 27 2009, 07:13 PM:name=Chris0132)--><div class='quotetop'>QUOTE(Chris0132 @ Nov 27 2009, 07:13 PM) <a href="index.php?act=findpost&pid=1741075"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->More like vital if you want the flashlight to have the flashlight look to it, it's the same technology that does that. Without it you can only have flat circles maybe with fading edges.

    Instead of projecting a simple flat colour you project a map, so it's basically like a decal with shadowing.

    It's also quite useful for optimisation, because if you make a texture like light shining through a grate, you can project that instead of having to enable shadows for that light and put it behind a grate. So it can cut out a lot of shadowing overhead while maintaining a varied light distribution.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Ah, I was talking about when textures themselves emit light. Say you have a lamp in the roof and apply a texture to it, then that texture itself will be emitting light.
    Projected textures however is certainly something that could be used.
  • SgtBarlowSgtBarlow Level Designer Join Date: 2003-11-13 Member: 22749Members, NS2 Developer
    Can we not even have a spot_oval either? :D hehe

    <img src="http://www.unitedworlds.co.uk/online-gaming/spotsamp.jpg" border="0" class="linked-image" />
  • Chris0132Chris0132 Join Date: 2009-07-25 Member: 68262Members
    <!--quoteo(post=1741218:date=Nov 28 2009, 01:16 PM:name=SgtBarlow)--><div class='quotetop'>QUOTE(SgtBarlow @ Nov 28 2009, 01:16 PM) <a href="index.php?act=findpost&pid=1741218"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Can we not even have a spot_oval either? :D hehe

    <img src="http://www.unitedworlds.co.uk/online-gaming/spotsamp.jpg" border="0" class="linked-image" /><!--QuoteEnd--></div><!--QuoteEEnd-->

    For the third time, <i>that's what texture projection is for...</i>
Sign In or Register to comment.