Lighting Issues
Post Reply
Quote
Re: Lighting Issues
Posted by CLs on Wed Jan 18th at 11:52pm 2006


When trying get the lighting to look right in my map i came across a problem when trying to achive the following effect.

thumbnail

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...

_CLs_





Quote
Re: Lighting Issues
Posted by BlisTer on Thu Jan 19th at 12:29pm 2006


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



Quote
Re: Lighting Issues
Posted by Naklajat on Thu Jan 19th at 12:47pm 2006


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).




=o



Quote
Re: Lighting Issues
Posted by Dark_Kilauea on Fri Jan 20th at 4:22am 2006


Try setting the constant to 20000 or so.


Dark_Kilauea
DVS Administration
http://www.dvstudio-production.com/



Quote
Re: Lighting Issues
Posted by Naklajat on Fri Jan 20th at 7:05am 2006


What exactly does constant do?



=o



Quote
Re: Lighting Issues
Posted by wil5on on Fri Jan 20th at 9:10am 2006


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*r2 + 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



Quote
Re: Lighting Issues
Posted by DrGlass on Fri Jan 20th at 1:06pm 2006


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.




Quote
Re: Lighting Issues
Posted by wil5on on Fri Jan 20th at 11:29pm 2006


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 <img src=" SRC="images/smiles/icon_wink.gif">


&quot;If you talk at all during this lesson, you have detention. Do you understand?&quot;
- My yr11 Economics teacher



Quote
Re: Lighting Issues
Posted by ReNo on Sat Jan 21st at 1:28am 2006


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.






Quote
Re: Lighting Issues
Posted by DrGlass on Sat Jan 21st at 6:38am 2006


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 :P




Quote
Re: Lighting Issues
Posted by wil5on on Sat Jan 21st at 7:22am 2006


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.




&quot;If you talk at all during this lesson, you have detention. Do you understand?&quot;
- My yr11 Economics teacher



Quote
Re: Lighting Issues
Posted by Orpheus on Sat Jan 21st at 1:00pm 2006


? quoting DrGlass
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.



Quote
Re: Lighting Issues
Posted by BlisTer on Sat Jan 21st at 4:02pm 2006


? quoting wil5on
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.

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



Quote
Re: Lighting Issues
Posted by DrGlass on Sat Jan 21st at 9:09pm 2006


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?




Quote
Re: Lighting Issues
Posted by wil5on on Sun Jan 22nd at 2:32am 2006


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,


&quot;If you talk at all during this lesson, you have detention. Do you understand?&quot;
- My yr11 Economics teacher



Quote
Re: Lighting Issues
Posted by fishy on Sun Jan 22nd at 6:14am 2006


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



Quote
Re: Lighting Issues
Posted by wil5on on Sun Jan 22nd at 7:47am 2006


No, since that would just alter the resolution of the lightmap, and the amount of detail in the light.




&quot;If you talk at all during this lesson, you have detention. Do you understand?&quot;
- My yr11 Economics teacher



Quote
Re: Lighting Issues
Posted by DrGlass on Sun Jan 22nd at 10:54am 2006


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.




Quote
Re: Lighting Issues
Posted by CLs on Mon Jan 23rd at 1:29am 2006


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

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

Anything I'am missing anything...

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

_CLs_





Quote
Re: Lighting Issues
Posted by BlisTer on Mon Jan 23rd at 6:51pm 2006


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:

(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:




These words are my diaries screaming out loud




Post Reply