Thread: [Tutorial] Advanced Lighting (info_textlights & light_surface & improved sky lights)

Results 1 to 16 of 16
  1. #1
    Administrator Hezus's Avatar  
    Manager
    Join Date
    Aug 2001
    Location
    The Netherlands
    Posts
    9,048

    [Tutorial] Advanced Lighting (info_textlights & light_surface & improved sky lights)

    Lot's of mappers probably start making lights by placing the 'light' (that bulb) entity into their maps. It works fine and you can do a lot of nice things with it, but for this tutorial I'd like to present you a different method.

    In this tutorial we'll explore the depths of texture lighting. As the name suggests, we're using the actual texture as a light source. So instead of putting a 'light' entity in front of your textures, we're going to let the light cast directly from the texture itself.

    Even if you used texture lighting before, please read the entire tutorial since there are some features you might not know about yet!


    1. Setting it up

    For this tutorial we're going to use the ZHLT.FGD file. Download it here. Go into the editor settings, find your game configuration and add the ZHLT.FGD file to your Game Data Files, next to svencoop.fgd. Make sure you use the compile tools provided in the package (or the ones that come with SC SDK).

    Note: Texture lighting was done before in seperate .rad files but those are no longer required with the use of the ZHLT features.


    2. Basic usage

    Find a nice light texture and place it somewhere on the face of a block, for instance: SUBWAY_LIGHTS.

    Create an 'info_texlights' entity. As you can see this one is empty. Hit the SMARTEDIT button and add a new entry. Use the name of the texture SUBLIGHT_LIGHTS as 'key' and use '255 255 212 2000' as value.
    The numbers represent RED, GREEN, BLUE, and BRIGHTNESS. The colours can have a value between 0 and 255 and the brightness can go up to whatever you need it to be.

    This will emit light from each face carrying the SUBWAY_LIGHTS texture. This will save you a lot of time, since you don't have to put 'light' entities everywhere. You can keep adding textures and values to the info_texlights.

    Sadly, this is the only thing the info_texlight does. All the nifty effects and toggling of the normal light entity arn't in there. Also, we still have to manually figure out the right colours. This isn't good enough, let's dig deeper!


    3. Advanced usage

    Place a 'light_surface' entity. This entity will cause light to be emitted from the texture you enter in the 'Texture Name' field. You can give it names to toggle it, set appareances such as 'flicker' and even make it behave like a light_spot by seting the inner and outer fading angle. Pretty much everything that's possible with the normal 'light' entity. This makes it superior to the info_texlights entity we've discussed before.

    But it get's even better! The light_surface entity doesn't require you to enter the colour of the light. It will detect the colour of the texture itself and use that to cast it's light. If your texture is mostly blue, a blue light will emit from it. In the 'Texture Brightness' field, only enter the Brightness value without the RGB values. Try setting it to just '2000'. If you're not happy with the colour the compiler chose for you, you can easily overide it with the 'color' field.

    You will need to set up a seperate 'light_surface' for each type of texture you're using.

    Regular light entity vs Light_surface
    Click image for larger version. 

Name:	20180215113815_1.jpg 
Views:	73 
Size:	140.9 KB 
ID:	18002 Click image for larger version. 

Name:	20180215113040_1.jpg 
Views:	86 
Size:	98.6 KB 
ID:	18003

    4. Misc.
    - If light 'bleeds' from the edges of the brush, you can set a 'gap':


    - If a bunch of lights use the same texture, but you want one of them to flicker, you must copy that texture from the WAD and rename it SUBWAY_LIGHTS_FLICKER and add it to your custom WAD. Now you can use that texture on the light you want to give a different appearance.

    - Light_surface also supports Custom Appearance. More on that here.


    5. Conclusion
    Texture lighting is emited right from the texture and thus often seems more natural than the spherical light entity you could place in front of it. Also, now the light_surface entity also has the properties of the normal light entity, you can use it's full potentional.

    Next to it looking better, it also saves you a lot of time managing each seperate light entity. You can easily change a certain type of light within one entity across the entire map.

    Lastly, it saves up a lot of entities (there are limits to those, you know).

    In conclusion, three clear reasons to ditch regular light entities and give light_surface a try!

    Appendix
    For even better results use the following parameters while compiling RAD:
    Code:
    -extra -bounce 8 -blur 1
    Last edited by Hezus; 15-02-2018 at 05:56 AM.

  2. #2
    Just another co-op player Maestro Fénix's Avatar
    Join Date
    Dec 2012
    Location
    Spain
    Posts
    362

    Re: [Tutorial] Advanced Lighting (info_textlights & light_surface)

    Also don't forget to tell HLRAD compile on -extra for those extra backed lights. You can also set how many times the light rays must be bounced. More info here.


    Here we go again

  3. #3
    Administrator Hezus's Avatar  
    Manager
    Join Date
    Aug 2001
    Location
    The Netherlands
    Posts
    9,048

    Re: [Tutorial] Advanced Lighting (info_textlights & light_surface)

    Good addition Fenix!

    My suggestions for RAD options are:

    -extra -bounce 8 -blur 1

  4. #4
    warrior spy-warrior's Avatar  
    Contributor
    Join Date
    Nov 2006
    Location
    Europe, France, Paris
    Posts
    2,961

    Re: [Tutorial] Advanced Lighting (info_textlights & light_surface)

    Please,

    We can delete the entity info_texlights in the old maps?
    Nous pouvons supprimer l'entité info_texlights dans les anciens maps ?

    Code:
    ERROR: Cannot instantiate entity: Entity 'info_texlights' does not exist!
    Thanks
    Patience is a virtue greatly needed by those who attempt great things.
    La patience est une vertu fort nécessaire à ceux qui tentent de réaliser de grandes choses.

    Server SvenCoop
    I love the mods svencoop
    World time zone & Look clocks

  5. #5
    snarks snarks snarks snarks snarks snarks snarks snarks Green Astronauts's Avatar
    Join Date
    Mar 2013
    Location
    Nijmegen, the Netherlands
    Posts
    210

    Re: [Tutorial] Advanced Lighting (info_textlights & light_surface)

    ...might as well rebuild every map ever made if you're going to replace old mapping conventions/tricks with new, improved ones.

    I'm not sure what happens if you remove an info_texlights entity. I guess nothing would happen since lights are 'baked' into the map during compiling, but I don't know. Give it a shot with RipEnt or something.

    Good luck doing that with every map though. Seems like a horrendous waste of time. I've seen that your desire to have zero errors in your server logs (even if they are harmless errors) borders on the fetishistic but this is rediculous.

  6. #6
    Administrator Hezus's Avatar  
    Manager
    Join Date
    Aug 2001
    Location
    The Netherlands
    Posts
    9,048

    Re: [Tutorial] Advanced Lighting (info_textlights & light_surface)

    Removing the info_texlights from your BSP would indeed not do any harm, since light is already generated in the RAD compile process.

    You could free up 1 spot on the entity list this way, but since SC has become a standalone engine many limits have been increased, so you'll be more likely to hit a different limit before hitting the entity limit. As Green Astronauts mentions: not worth all the effort.

    Also, I estimate the amount of maps made with info_texlights to be very small. Prior to the info_texlights, most mappers used .rad files for their texture lights and before that regular lights. Now that light_surface is far superior, I expect info_texlight to fade into obscurity pretty soon.

  7. #7
    warrior spy-warrior's Avatar  
    Contributor
    Join Date
    Nov 2006
    Location
    Europe, France, Paris
    Posts
    2,961

    Re: [Tutorial] Advanced Lighting (info_textlights & light_surface)

    Quote Originally Posted by Green Astronauts View Post
    ... Good luck doing that with every map though. Seems like a horrendous waste of time. I've seen that your desire to have zero errors in your server logs (even if they are harmless errors) borders on the fetishistic but this is rediculous.
    Quote Originally Posted by Hezus View Post
    Removing the info_texlights from your BSP would indeed not do any harm, since light is already generated in the RAD compile process.
    Very easy with the software BSPEdit.exe

    I restrict disk access and add unnecessary logs.
    Je restreindre l'accès disque et ajouter des journaux inutiles.

    Ok, Thanks
    Patience is a virtue greatly needed by those who attempt great things.
    La patience est une vertu fort nécessaire à ceux qui tentent de réaliser de grandes choses.

    Server SvenCoop
    I love the mods svencoop
    World time zone & Look clocks

  8. #8
    Advanced Leveldesigner SourceSkyBoxer's Avatar
    Join Date
    Apr 2011
    Location
    Germany
    Posts
    803

    Re: [Tutorial] Advanced Lighting (info_textlights & light_surface)

    Sorry for old thread will re-open again.

    @Hezus, your super hero! Thank you very much to explanation about light_surface if I have same light-texture than I try that. Wow!

    But models no just hidden brush with WHITE makes 2. brush as yellow.
    Hello guys, Svencoop. I am sorry Please respect me! I am deaf. Thanks, Sven-Coop Forum!

    Please do not share to shit dropbox! Please share only Mega.nz!
    Muhahaha, Facebook crashed!

  9. #9
    Administrator Hezus's Avatar  
    Manager
    Join Date
    Aug 2001
    Location
    The Netherlands
    Posts
    9,048

    Re: [Tutorial] Advanced Lighting (info_textlights & light_surface)

    @SSB: Glad you liked this tutorial!

    What do you mean by this?
    But models no just hidden brush with WHITE makes 2. brush as yellow.

  10. #10
    Advanced Leveldesigner SourceSkyBoxer's Avatar
    Join Date
    Apr 2011
    Location
    Germany
    Posts
    803

    Re: [Tutorial] Advanced Lighting (info_textlights & light_surface)

    Sorry my best Hezus,

    1 white from right is WHITE texture with info_texlight
    2 yellow from left is WHITE with light_surface. Sorry for forgetting resolve.

    // EDIT Now I give example map if you understand me. It is not same to my screenshot. Just it is small example.
    Last edited by SourceSkyBoxer; 15-02-2018 at 11:06 PM.
    Hello guys, Svencoop. I am sorry Please respect me! I am deaf. Thanks, Sven-Coop Forum!

    Please do not share to shit dropbox! Please share only Mega.nz!
    Muhahaha, Facebook crashed!

  11. #11
    Administrator Hezus's Avatar  
    Manager
    Join Date
    Aug 2001
    Location
    The Netherlands
    Posts
    9,048

    Re: [Tutorial] Advanced Lighting (info_textlights & light_surface)

    Here's some more usage of the light_surface to improve your lighting.

    For reference you can see the difference between a regular light entity and a light_surface here:

    Regular light entity vs Light_surface
    Click image for larger version. 

Name:	20180215113815_1.jpg 
Views:	73 
Size:	140.9 KB 
ID:	18002 Click image for larger version. 

Name:	20180215113040_1.jpg 
Views:	86 
Size:	98.6 KB 
ID:	18003


    As you can see the light surface lights up the texture itself and also emits light in a far more natural way. The reason it does this is the built-in spot light. And you can use this to make the light even more dramatic. Just change the inner and outer fade to your liking. As you can see light is more focussed on the floor below the source and creates more shadows in the far corners of the room.

    Outer 75 / inner 60 vs Outer 60 / Inner 45
    Click image for larger version. 

Name:	20180215113225_1.jpg 
Views:	39 
Size:	96.8 KB 
ID:	18004 Click image for larger version. 

Name:	20180215113256_1.jpg 
Views:	36 
Size:	91.5 KB 
ID:	18005

    The last example would be too much for this room, but if you have low hanging lights (for instance a scary warehouse map) this would be really cool. If you want to bring down the light even further you can use the gap option as described in the first post.
    Last edited by Hezus; 15-02-2018 at 05:54 AM.

  12. #12
    Administrator Hezus's Avatar  
    Manager
    Join Date
    Aug 2001
    Location
    The Netherlands
    Posts
    9,048

    Re: [Tutorial] Advanced Lighting (info_textlights & light_surface & improved sky ligh

    For outside areas you can greatly increase your lighting effects by the right usage of light direction.

    light_environment default vs directed light
    Click image for larger version. 

Name:	20180215115938_1.jpg 
Views:	45 
Size:	135.4 KB 
ID:	18006 Click image for larger version. 

Name:	20180215120348_1.jpg 
Views:	43 
Size:	154.8 KB 
ID:	18007

    As you can see, light_environment on default will cast light straight down from the SKY texture and will hardly cast any shadows at all, causing the scene to look bland. You can make it more interesting by setting the right angle (135) and pitch (-75). The pitch is the height angle of the sun. -75 is a summer sun around noon. If you want dusk or dawn effects you'd need to put it lower (-35). This is where the functionality of the light_environment ends though.

    Alternativly you can use a light_spot entity! Set "Is Sky" to "Yes" and it will function as a SKY light. This gives you some more options such as toggling it on and off and setting apperances. Especially with the Custom Apperance field you can give the light a gentle pulse to simulate heat effects or clouds passing by.
    Last edited by Hezus; 15-02-2018 at 07:17 AM.

  13. #13
    snarks snarks snarks snarks snarks snarks snarks snarks Green Astronauts's Avatar
    Join Date
    Mar 2013
    Location
    Nijmegen, the Netherlands
    Posts
    210

    Re: [Tutorial] Advanced Lighting (info_textlights & light_surface & improved sky ligh

    Can't you also just use light_environment with modified pitch/yaw settings though?

  14. #14
    Administrator Hezus's Avatar  
    Manager
    Join Date
    Aug 2001
    Location
    The Netherlands
    Posts
    9,048

    Re: [Tutorial] Advanced Lighting (info_textlights & light_surface & improved sky ligh

    Quote Originally Posted by Green Astronauts View Post
    Can't you also just use light_environment with modified pitch/yaw settings though?
    Yes, you can, but the spot_entity has more options. You could can toggle it, change values and set appearances, which you can't for the light_environment. I'll add this to the tutorial so it's more clear!

  15. #15
    Registered User
    Join Date
    Jul 2010
    Posts
    52

    Re: [Tutorial] Advanced Lighting (info_textlights & light_surface & improved sky ligh

    Quote Originally Posted by Hezus View Post
    Alternativly you can use a light_spot entity! Set "Is Sky" to "Yes" and it will function as a SKY light. This gives you some more options such as toggling it on and off and setting apperances. Especially with the Custom Apperance field you can give the light a gentle pulse to simulate heat effects or clouds passing by.
    Never knew that. Thanks!

  16. #16
    Advanced Leveldesigner SourceSkyBoxer's Avatar
    Join Date
    Apr 2011
    Location
    Germany
    Posts
    803

    Re: [Tutorial] Advanced Lighting (info_textlights & light_surface & improved sky ligh

    Last edited by SourceSkyBoxer; 04-08-2018 at 05:02 AM.
    Hello guys, Svencoop. I am sorry Please respect me! I am deaf. Thanks, Sven-Coop Forum!

    Please do not share to shit dropbox! Please share only Mega.nz!
    Muhahaha, Facebook crashed!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •