Hard Light Productions Forums
Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Vertigo 7 on August 14, 2008, 01:54:50 pm
-
Is it possible to use a glow point as a light source? like say I wanted to illuminate a name plate by positioning a glow point right above the texture.
-
no.
what you do is add lighting in a 3d app or gimp or photo shop or whatever and bake the lighting to a glow map.
-
How hard would it be from a coding perspective to make glow points actually emit a source of light? And thrusters?
(I'm assuming someone's going to say "impossibly hard", but it was worth asking)
-
it'd prolly be extremely hard unless the glow point file itself can reference to light intensity... if not PCS would need to be reworked to support it as well as fred/fs
-
I'd have thought it would be possible, so that it uses a similar system to the way weapons fire casts light. But I'm no coder so I have no idea how it would be done, I'm just throwing around ideas.
I should stick to FREDding...
-
That would make texturing easier :P
-
Also I believe Opengl only allows 9? light sources and they are rather process consuming.
-
It's more a question of processing time, each light source adds another layer of computation for texture rendering. OpenGL supports something like 8 active hardware lightsources at one time iirc, which is enough for things like weapons, explosions etc, which are short-lived effects, but would soon run out if glowpoints were light sources.
That's why programs like Unreal Tournament pre-render most of the lighting effects on the levels.
Edit: As Scooby also says :)
-
Ok... So would it be possible to overlay a lighter texture over an existing hull texture, thus creating the illusion of a light source without actually doing it? Wait... That's a glowmap. D'oh.
-
what is needed is a system to toggle on and off light sources based on their visibility to the player. so only the most visible 8 sources are used with hardware lighting. then you combine that with a faster, lower quality lighting effects for things like weapons and whatnot, to fill in the background. so every time you get ready to do lighting computation, a list of sources is sorted by distance from the camera * size higher numbers taking the hardwre lights, and lower numbers either using the software lighting or no lighting at all. the idea is if you fill up the foreground, your eyes are distracted from the lack of lighting in the background.
-
You can fake it with a glow map, have your area with a illuminated spot and put your light source around it at the right angle you want to pretend it's casting it... That's what I did with irfranview, but then again I have no skills... :)
-
jees, ok here's how FS handles lights, only the max number of supported hardware lights can be used at a time the max number of lights is not MORE than 8. when more than this number of lights needs to be drawn what it does is it switches to additive alpha after a pass with the first test and does consecutive sets after that untill all lights are drawn.
strictly speaking adding lights is not too hard and it could be done with justs a few lines of code, but a better way of doing this is to have all the static lights precalculated on a texture (which allows as great of lighting calculation precision as you could ever ask for) and apply this on the first lighting pass. this is what glow maps are.