Spark Engine: Light Emmision
SgtBarlow
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...
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
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.
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. :)
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.
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.
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" />
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.
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.
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.
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.
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.
Which you use to achieve an effect is irrelevant.
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>
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.
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.
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.
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.
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.
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.
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.
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.
<img src="http://www.unitedworlds.co.uk/online-gaming/spotsamp.jpg" border="0" class="linked-image" />
<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>