Lighting Issues

Lighting Issues

Re: Lighting Issues Posted by CLs on Wed Jan 18th 2006 at 11:52pm
CLs
66 posts
Posted 2006-01-18 11:52pm
CLs
member
66 posts 7 snarkmarks Registered: Mar 17th 2005 Occupation: Student Location: Canada
When trying get the lighting to look right in my map i came across a problem when trying to achive the following effect.

User posted image

I want to have the light looking like its coming out of the lampshade and spreading out as shown in green, but the light cast appears squareish in game and scattered, I tried playin around with several settings include inner and outer bright angles, but to no avail... :sad:

CLs
Re: Lighting Issues Posted by BlisTer on Thu Jan 19th 2006 at 12:29pm
BlisTer
801 posts
Posted 2006-01-19 12:29pm
BlisTer
member
801 posts 1304 snarkmarks Registered: Jun 10th 2004 Location: Belgium
maybe there's other solutions that im not thinking of right now, but i'm just saying the first thing that comes through my mind:

if you really want to confine your lightspot between the green lines, with a hard contrast between light and shadow (i.e.: not slowly fading on the edges), try the following:

make 2 brushes and place them in such a way that they block the light that you dont want, but do not block the light that you do want, i.e. place them around the opening of you lampsocket, but not in the opening. now cover all sides of the brushes with the "blocklight" texture. do not make them into entities, keep them world brushes. Have the lightspots have a wide enough angle, such that enough light slips between the brushes, but not too wide to surpass your brushes.

ingame, you wont see the brushes, but they will confine the light within the green lines! if you're not sure on how to place them, give me a yell and i'll draw you
These words are my diaries screaming out loud
Re: Lighting Issues Posted by Naklajat on Thu Jan 19th 2006 at 12:47pm
Naklajat
1137 posts
Posted 2006-01-19 12:47pm
Naklajat
member
1137 posts 384 snarkmarks Registered: Nov 15th 2004 Occupation: Baron Location: Austin, Texas
<span style="color: white;">BlisTer's solution is by far the easiest I can think of. One thing though: don't cover all sides with toolsblocklight, use toolsskip (I think) on the others. toolsblocklight on all of the faces would cast a shadow from all directions/other light sources. If I understand toolsskip correctly it's just skipped by BSP, but I'm not sure if it has to be used in conjunction with toolshint.

Other than that you could make a decal to look like light on the wall, check out how they did it in cs_office (I think).
</span>

o

Re: Lighting Issues Posted by Dark_Kilauea on Fri Jan 20th 2006 at 4:22am
Dark_Kilauea
629 posts
Posted 2006-01-20 4:22am
629 posts 123 snarkmarks Registered: Apr 15th 2005 Occupation: Fast Food Location: USA
Try setting the constant to 20000 or so.
Dark_Kilauea
DVS Administration
http://www.dvstudio-production.com/
Re: Lighting Issues Posted by Naklajat on Fri Jan 20th 2006 at 7:05am
Naklajat
1137 posts
Posted 2006-01-20 7:05am
Naklajat
member
1137 posts 384 snarkmarks Registered: Nov 15th 2004 Occupation: Baron Location: Austin, Texas
<span style="color: white;">What exactly does constant do?</span>

o

Re: Lighting Issues Posted by wil5on on Fri Jan 20th 2006 at 9:10am
wil5on
1733 posts
Posted 2006-01-20 9:10am
wil5on
member
1733 posts 570 snarkmarks Registered: Dec 12th 2003 Occupation: Mapper Location: Adelaide
This is just what I think, mainly from guesses, but it's probably not too far from reality:

The lighting model for Source uses an inverse quadratic model for intensity falloff. So I = 1/P(r), where I is the intensity of the light at a given point, r is the distance from the light, and P is a quadratic. P(r) = a*r<sup>2</sup> + b*r + c, where a is the quadratic property of the light, b is the linear, and c is the constant. The constant affects what value the light starts at (at r=0), if you have a graphing calculator/software, you can use that and play with a,b,c values to see how they affect I.
"If you talk at all during this lesson, you have detention. Do you understand?"
  • My yr11 Economics teacher
Re: Lighting Issues Posted by DrGlass on Fri Jan 20th 2006 at 1:06pm
DrGlass
1825 posts
Posted 2006-01-20 1:06pm
DrGlass
member
1825 posts 632 snarkmarks Registered: Dec 12th 2004 Occupation: 2D/3D digital artist Location: USA
omfg my brain.

Wilson I would love you if you could some how make a tutorial that a
high school drop out, artist could understand (well now that I look at
it, it makes a little more sence) but maybe some talented member could
make a calculator that will show how the light shines on a wall?
Seems like that would be a simple program to make.
Re: Lighting Issues Posted by wil5on on Fri Jan 20th 2006 at 11:29pm
wil5on
1733 posts
Posted 2006-01-20 11:29pm
wil5on
member
1733 posts 570 snarkmarks Registered: Dec 12th 2003 Occupation: Mapper Location: Adelaide
To write a renderer, and tweak it to approximate the lighting in Source would be pretty damn difficult actually. I should probably write that tutorial though, something along the lines of "maths for mappers". Good idea :wink:
"If you talk at all during this lesson, you have detention. Do you understand?"
  • My yr11 Economics teacher
Re: Lighting Issues Posted by ReNo on Sat Jan 21st 2006 at 1:28am
ReNo
5457 posts
Posted 2006-01-21 1:28am
ReNo
member
5457 posts 1991 snarkmarks Registered: Aug 22nd 2001 Occupation: Level Designer Location: Scotland
Totally man, go for it. Another thing you should mention if you do is
how to work out what texture rotation value to use on a face using the
horizontal/vertical change.
[img]http://card.mygamercard.net/sig/Default/reno84.png[/img]
Designer @ Haiku Interactive | ReNo-vation.net
Re: Lighting Issues Posted by DrGlass on Sat Jan 21st 2006 at 6:38am
DrGlass
1825 posts
Posted 2006-01-21 6:38am
DrGlass
member
1825 posts 632 snarkmarks Registered: Dec 12th 2004 Occupation: 2D/3D digital artist Location: USA
I mean just a simple 2D picture showing what the light would look like,
maybe some other lines to show fall off... or just a tut :razz:
Re: Lighting Issues Posted by wil5on on Sat Jan 21st 2006 at 7:22am
wil5on
1733 posts
Posted 2006-01-21 7:22am
wil5on
member
1733 posts 570 snarkmarks Registered: Dec 12th 2003 Occupation: Mapper Location: Adelaide
To get a 2D picture of what the light would look like, you still have to position the light in 3D space and do some fancy geometry. It also wouldnt take bounces into account.

Reno, I'm about as lost as the next person when it comes to that, but I'll play around with it at some point.
"If you talk at all during this lesson, you have detention. Do you understand?"
  • My yr11 Economics teacher
Re: Lighting Issues Posted by Orpheus on Sat Jan 21st 2006 at 1:00pm
Orpheus
13860 posts
Posted 2006-01-21 1:00pm
Orpheus
member
13860 posts 2024 snarkmarks Registered: Aug 26th 2001 Occupation: Long Haul Trucking Location: Long Oklahoma - USA
DrGlass said:
omfg my brain.
At least you retain enough to recognize that your brain hurts. Mine flatlines more often than I care to publicly acknowledge.

You're the man Glass.

/me bows

The best things in life, aren't things.
Re: Lighting Issues Posted by BlisTer on Sat Jan 21st 2006 at 4:02pm
BlisTer
801 posts
Posted 2006-01-21 4:02pm
BlisTer
member
801 posts 1304 snarkmarks Registered: Jun 10th 2004 Location: Belgium
<DIV class=quote>
<DIV class=quotetitle>? quoting wil5on</DIV>
<DIV class=quotetext>To get a 2D picture of what the light would look like, you still have to position the light in 3D space and do some fancy geometry. It also wouldnt take bounces into account.

</DIV></DIV>
if they need it as in the case of CLs, then it wouldn't be that hard, it would just be the equation in 2D. The equation you stated might be correct for lights, but it would need to be expanded for light_spots (my guess is with an angular component superimposed). i might be able to help you out on the maths if you want. not good a coder though, only Matlab. It would actually not be too hard in Matlab i think. Still i wonder if it's worth the trouble, since the in-hammer renderer pictures the outlines of the lightspot already, and with a few trial and errors you could have a pretty good estimation on the intensity
These words are my diaries screaming out loud
Re: Lighting Issues Posted by DrGlass on Sat Jan 21st 2006 at 9:09pm
DrGlass
1825 posts
Posted 2006-01-21 9:09pm
DrGlass
member
1825 posts 632 snarkmarks Registered: Dec 12th 2004 Occupation: 2D/3D digital artist Location: USA
I was thinking it would be simple to show a 2D cross section of a spot
light. I mean wouldn't you just have 2 sets of lines for the
inner and outer brightness then have some kind of dipiction of the fall
off level? I'd think it would be a matter of getting the equation
and inputing the numbers in the right place.

come to think of it... isn't that what the light_spot DOES in the 3d
view of hammer?! maybe someone can explain how that works?
Re: Lighting Issues Posted by wil5on on Sun Jan 22nd 2006 at 2:32am
wil5on
1733 posts
Posted 2006-01-22 2:32am
wil5on
member
1733 posts 570 snarkmarks Registered: Dec 12th 2003 Occupation: Mapper Location: Adelaide
In the Hammer window, light_spot just draws the outline of the light cone. What youre suggesting is something that renders the projected light itself. Without access to Source's lighting engine code, it would be tricky to get even a rough approximation,
"If you talk at all during this lesson, you have detention. Do you understand?"
  • My yr11 Economics teacher
Re: Lighting Issues Posted by fishy on Sun Jan 22nd 2006 at 6:14am
fishy
2623 posts
Posted 2006-01-22 6:14am
fishy
member
2623 posts 1476 snarkmarks Registered: Sep 7th 2003 Location: glasgow
just a thought, but wouldn't increasing the lightmap scale of the wall that the light is shining on address the original problem?
i eat paint
Re: Lighting Issues Posted by wil5on on Sun Jan 22nd 2006 at 7:47am
wil5on
1733 posts
Posted 2006-01-22 7:47am
wil5on
member
1733 posts 570 snarkmarks Registered: Dec 12th 2003 Occupation: Mapper Location: Adelaide
No, since that would just alter the resolution of the lightmap, and the amount of detail in the light.
"If you talk at all during this lesson, you have detention. Do you understand?"
  • My yr11 Economics teacher
Re: Lighting Issues Posted by DrGlass on Sun Jan 22nd 2006 at 10:54am
DrGlass
1825 posts
Posted 2006-01-22 10:54am
DrGlass
member
1825 posts 632 snarkmarks Registered: Dec 12th 2004 Occupation: 2D/3D digital artist Location: USA
right, I have the same problem in my map and my lightmaps are set to
8. but thats for a single player map, I dont think any one would
want a bunch of walls with 4 or 2 scale light maps.
Re: Lighting Issues Posted by CLs on Mon Jan 23rd 2006 at 1:29am
CLs
66 posts
Posted 2006-01-23 1:29am
CLs
member
66 posts 7 snarkmarks Registered: Mar 17th 2005 Occupation: Student Location: Canada
Using the Block Light to seems to have no visable effect in game and I tried several times; covering the whole brush in Block Light or just one face with the rest Skip. Both times got no results :sad:

User posted image

As for seting the constant to 20,000 that got rid of the light all togeather.

Anything I'am missing anything... :confused:

P.S Creating a program to quickly calculate how ur light is going to turn out would be a blessing...Good Luck

CLs
Re: Lighting Issues Posted by BlisTer on Mon Jan 23rd 2006 at 6:51pm
BlisTer
801 posts
Posted 2006-01-23 6:51pm
BlisTer
member
801 posts 1304 snarkmarks Registered: Jun 10th 2004 Location: Belgium
Some images in this post have been automatically down-sized, click on them to view the full sized versions:

Some images in this post have been automatically down-sized, click on them to view the full sized versions:

User posted image

(as you can see the shape of the blocklight brush doesnt really matter, but the placement does) additional things i did: tilted the lightspot slightly towards the wall (without touching it), set the outer light angle equal to the inner angle, and , as Fishy noted, played with the lightscale of the wall texture a bit. you can do this via the texture application tool. having it at 16 gives jacked edges because of the necessary tilts/skew of the brushes. my lightscale is at 4. you can test what you like best. also i dunno how you like the effect at the base (rounded here), but you 'll be able to make that to your liking.

EDIT:

bah, nevermind that. just set your outer angle equal to your inner angle, play with the lightscale, and set your lightspot as in the pic:

User posted image
These words are my diaries screaming out loud
Re: Lighting Issues Posted by CLs on Tue Jan 24th 2006 at 1:38am
CLs
66 posts
Posted 2006-01-24 1:38am
CLs
member
66 posts 7 snarkmarks Registered: Mar 17th 2005 Occupation: Student Location: Canada
Thanks for da tips and the pics, I tweaked it out as shown in the pictures and got the results I was looking for... User posted image

CLs