Lighting - a little ranting and a little tutoring.

  • Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Drevlin

FNG / Fresh Meat
Oct 17, 2006
177
0
0
Rich, doesnt matter ;)
You go more indepth on the technical aspects and thats interesting for people that dont know about it. Good writing!
 

Nestor Makhno

FNG / Fresh Meat
Feb 25, 2006
5,758
1,118
0
57
Penryn, Cornwall
LOL - well you both beat me to this one but, as I spent a time getting it ready in PS, I'll be damned if I DON'T post it.

This is an extreme example with lights close to a very narrow structure, in this case the railing, causing a shadow on the floor. In a case like this the first setting, 64, is no good at all.

16 is hardly noticeable either due to the extremity of the situation though, for many set-ups, 16 is great.

The next, 4, is pretty clear and 1 isn't actually very much different.

In fact, for just about any situation a lightmap of 1 or 2 is no benefit for the extra memory required for the lightmap.

lightmaps.jpg
 
Last edited:

Shurek

FNG / Fresh Meat
May 21, 2006
857
13
0
www.darkesthourgame.com
Could you guys post something on how to use Unlit vs. Lit in Display properties, as well as how to use the Special Lit option correctly?

I'm still confused on what type of lights affect what parts of a map. For example, does a sunlight actor only affect BSP and meshes, and not terrain, or vice versa?

And...I notice if I turn off ambient lighting (=0) in the ZoneInfo actor for a skyzone that the entire sky will go black. How should the skydome be treated in terms of lighting?

Lots of questions, guys! Keep the good stuff coming! :D
 

[=KAS=]doomed

FNG / Fresh Meat
Sep 21, 2006
471
0
0
Skybox - This should be lit like you would light any room. Just plonk down some lights and adjust them to your taste.

Ambient lighting - err, I never use this, because it can produce fake looking lighting.

Sunlight Actor - Affects everything, AFAIK.

Unlit vs. Lit - Set certain things to unlit if you don't want them to be affected by their environment in terms of lighting. I often have to do this because the hay static meshes cast odd shadows on themselves.
 

Nestor Makhno

FNG / Fresh Meat
Feb 25, 2006
5,758
1,118
0
57
Penryn, Cornwall
I'm afraid I'm pretty sure at least some of that is wrong, doomed, but I'm a bit too tired to pick it apart right now. tomorrow I'll put in a few bits, unless any other kind soul beats me to it :)
 

DeV

FNG / Fresh Meat
Nov 21, 2005
636
2
0
35
Netherlands
*Kind soul to the rescue*

I never light my skybox with lights, unless I want to achieve a certain color effect or something similar. I normally just set it to unlit or crank up its AmbientGlow. Also ambient lighting isnt necessarily bad, you just need to control yourself. Don't crank it up insanely high. A value < 10 can do wonders if you use it good.
 

Drevlin

FNG / Fresh Meat
Oct 17, 2006
177
0
0
Sunlight actor effects everything.

Ambient lighting isnt all evil, you just gotta find a good value (as in <10)
Of course the skyzone will go all black if your only lightsource is the ambient lighting and you set it to 0 :)

I cant help myself but to once again use Zavod as an example.
The actual skydome in Zavod is unlit because all the lighting i wanted in it is in the handpainted texture.
I do have a light in the skybox/backdrop to simulate moonlight on the terrain in the backdrop but thats the only light i have and the terrain is the only thing in the backdrop thats not set to unlit.
But tbh it all comes down toto how you make the backdrop/skybox.

Special lit is like a secondary lightmap, or rather a "new" lightmap that takes priority over the old one. It can be used on selected actors and surfaces.
Its useful if you got a surface that just wont lit up right using normal lights (i have yet to use that in Unreal Engine 2 tho. Used it plenty in Unrealengine 1)
Guess it can be useful for lighting static meshes seeing as they got ubercrappy lighting in ue2.
Thinking on the top of my head here, Using one light to lit up the BSPenviorment and then special lit the mesh to get correct highlights and shadows (again, just tossing out ideas on the top of my head here ;))

In surface properties/actor properties tag special lit. Add a light actor and set it to special lit aswell (think its under "lighting" tab in the lightactor properties). That light will now only effect actors and surfaces with surfaces/actors that has special lit tagged.
 

spraduke

FNG / Fresh Meat
Nov 21, 2005
1,522
4
0
36
wiltshire
www.spraduke.co.uk
i found on tula to save fps (and looks) setting all my trees to the same ambient light level as my sunlight actors made them look acceptable whilst not lightining funky (static meshes are a bit crazy that way)

And thank you very much for the light map info guys its another bit of knowledge to add to my mapping arsenal that i wasn't aware of before ;)
 

spraduke

FNG / Fresh Meat
Nov 21, 2005
1,522
4
0
36
wiltshire
www.spraduke.co.uk
In surface properties/actor properties tag special lit. Add a light actor and set it to special lit aswell (think its under "lighting" tab in the lightactor properties). That light will now only effect actors and surfaces with surfaces/actors that has special lit tagged.

I wondered why settin special lit seemed to do nothing for me :p
 

Shurek

FNG / Fresh Meat
May 21, 2006
857
13
0
www.darkesthourgame.com
Gentlemen, thanks for all your answers! Drevlin you confirmed the suspicions I had about 'lit' vs 'special lit'.

I've been doing some experimentation with the skyboxes (trying to place effects inside the sky box to see if they'll be projected into the level) and this info will definitely help. Thanks!
:)

Spraduke...can you explain why lighting would affect fps? I've never heard that one before...except as mentioned above in terms of the lightmaps.
 

[=KAS=]doomed

FNG / Fresh Meat
Sep 21, 2006
471
0
0
*Kind soul to the rescue*

I never light my skybox with lights, unless I want to achieve a certain color effect or something similar. I normally just set it to unlit or crank up its AmbientGlow. Also ambient lighting isnt necessarily bad, you just need to control yourself. Don't crank it up insanely high. A value < 10 can do wonders if you use it good.
I use the default static mesh skyboxes (noob, I know :p) and in order to create certain effects I will often place (for example) a reddish light near the sun to simulate a sunset. It's much more in-depth than that, but you get the idea. I guess this is the lazy man's way to doing a different looking slybox :D.
 

[=KAS=]doomed

FNG / Fresh Meat
Sep 21, 2006
471
0
0
Next question. As seen here, I have a very WIP shed. I like the light caster, but I don't like how obvious it is. Is it possible to tone down the opacity of it somewhere within the static mesh properties, or do I have to create an all new texture?


Untitled-1-1.jpg
 

Drevlin

FNG / Fresh Meat
Oct 17, 2006
177
0
0
if by "comepleatly new texture" you mean open it up in photoshop, selecting the alphachannel and redoing the gradient then yes. you have to make a new texture ;)
It aint hard. Lemme know if you dunno how to do it and ill write up how to. It's a really quick fix, easy to import and so easy to tweak too.

Neato looking shed btw.
 

[=KAS=]doomed

FNG / Fresh Meat
Sep 21, 2006
471
0
0
if by "comepleatly new texture" you mean open it up in photoshop, selecting the alphachannel and redoing the gradient then yes. you have to make a new texture ;)
It aint hard. Lemme know if you dunno how to do it and ill write up how to. It's a really quick fix, easy to import and so easy to tweak too.

Well, I looked at the properties for the lightcaster dealie, and there were about 9,821 options, so I thought it best to not tinker too much.

A write-up would be awesome.

Neato looking shed btw.

Thanks. 30 minutes of work, hehe.
 

Drevlin

FNG / Fresh Meat
Oct 17, 2006
177
0
0
select the texture used for the lightbeam in the texture browser and export it. Open it up in Photoshop, select the alphachannel and deselect all the other channels so you see what you're working with. (see picture below and look at the red markings in the channel tab)

Now it should look something like in the picture below (with the exception that your gradiant would be going from top-to-bottom and not be mirrored like the one in the pic.)
Select the gradiant tool, the tool in the toolbox marked with red in the picture below. As you want it to be less obvious i suggest lowering whats at the moment a persumably rather bright shade of gray to a much darker shade of gray. The moonbeams in zavod has 11 as the most visible part, so you can go really really low.

alpha.jpg


Make sure you got the alphachannel selected, hold shift (in order for you to be able to draw a straight line) and draw a line, top to bottom or bottom to top (depends on which colour you has as your primary)



Once you're happy with the results save it as a TGA with "Alpha channel" box ticked. Import it into unrealed and, again, tick the Alphachannel box (i suggest using mylevel>fx or something).
Select the mesh, go into its properties>display>skin and press add and then "use". with your newly imported texture selected in the texture browser.

I'll make a more advanced tutorial later. You can have the lightbeams simulate dust going trough them with a fairly simple panning shader. It looks amazing, adds more life to the enviorment and isnt all that hard to get your head around but for now i hope this one suffices :)
 

Drevlin

FNG / Fresh Meat
Oct 17, 2006
177
0
0
Heres the dust-trough-lightbeam tutorial, as promised:
(Using imageshack for this one, so images may be a bit slower than usual)

Stuff to do in photoshop:
Open your lightbeam texture in Photoshop (see previous entry about lightbeams for a "how to make lightbeam" tutorial).

Select a slightly brighter/stronger color (with the same hue) than your lightbeam is at this moment in either primary or secondary color. On the other one (primary/secondary color) pick a darker/weaker color (with the same hue) as your lightbeam color.

Select background layer (or create a new, doesnt matter) and go to Filter>Render>Clouds and your should get something that looks like this.
doneinphotoshophq1.jpg


Save as TGA with alphachannel box ticked.

Stuff to do in Unrealed:
Import the file you just made in photoshop and tick the Alphachannel box. In the texture browser, select file>new and you get the window you see below, with the exception that where it says "class.engine.texpanner" for me it says "class.engine.shader" for you.

ued1oy1.jpg


Mypackage: Mylevel
Group: Light (or whatever)
Name: Your moms maiden name

Click the arrow to the right of where it says "class.engine.shader" and scroll down "class.engine.texpanner".
Press "new" button.

Right, so now a new window pops up. Looks like this:
newtextpannerur7.jpg


Plenty of options in there but the only one we need for this tutorial is the "Material" tab at the very bottom and the "panrate" tab.
Select the texture you created and imported earlier, and press "use" in the material tab ("use" pops up if you select the tab). You should see the texture you created imported before pan across the left window.

Adjust how fast it pans, or in this case "blows", by adjusting the "panrate" tab untill you have a result you're happy with. When you're done just close the window by pressing X at the topright of the window.

Then just have the new texpan shader selected in the texture browser and press "use" in the static mesh properties>display>skin tab

Boom! Done!

As with everything you can get awesome results if you handpaint the texture rather than randomly generate clouds but this is a quick way to add ambience and life to your enviorment.