Ads keep us online. Without them, we wouldn't exist. We don't have paywalls or sell mods - we never will. But every month we have large bills and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3

How to add sunlight

A Tutorial for Counter-Strike: Source

Welcome to another one of my tutorials. In this tutorial I will teach you how to use the entity env_sun in your map so you can achieve a cool sunlight effect like I used in this map:



Let's Get Started
  1. First, open up your map and place the following entities:
  2. Env_sun
    Light_environment

    info_target

  3. Now, move the Env_sun and the light_environment near the skybox where you want the Sun to shine from. Make sure that both entities are as close as possible.



  4. Now select info_target that you placed, and move it to where you want the env_sun to point at. In this map, I placed the info_target inside the barn, so that the env_sun would shine through the hole in the roof.



  5. Open up the info_target properties box, and give the entity a name. I called mine sun_target.



  6. Now go back to the Env_sun and open up its properties window. Set the Viewer Entity to the name of the info_target.



  7. Now all you have to do is try to set the light_environment to point the same direction as the env_sun.

  8. Double click on the light_environment entity and press the Point at button.



  9. Once you do that, you should notice that your cursor has turned into a crosshair. Go to where you placed the info_target and click it with your cursor.

  10. Once you do that, you should notice that the numbers in the Pitch Yaw Roll(YZX) field have changed. That means that the light_environment is now pointing at the entity you clicked on.



  11. Now, you can edit the color and brightness of the Env_sun and the light_environment. Here are the settings I used for my map Fy_barnyard

  12. Light_environment

    Brightness: 235 155 71 999
    Ambient: 105 142 165 120
    Brightness HDR: -1 -1 -1 1
    AmbientHDR: -1 -1 -1 1

    Env_sun

    Use Angles: No
    Pitch: 0
    Sun Color(R G B): 176 88 0
    Overlay Color: 0 0 0
    Size: 20
    Overlay Size: -1
    Material Name: sprites/light_glow02_add_noz
    Overlay Material Name: sprites/light_glow02_add_noz
    HDR Color Scale: 1.0

  13. The last thing to do is Compile your map and test it out, then adjust the settings to your liking.
Thank you for reading my tutorial, if you have any questions, please do not hesitate to PM me or leave a comment.

Half Life Storm

-SGT_kick_ur_ass

Comments

Sign up to access this!
1-10 of 40
1
Pages
Go to page:
  • Impossible9 avatar
    Impossible9 Joined 11y ago
    Offline
    1,161 points Ranked 23175th
    9 medals 1 rare
    • 6 years a member Medal icon
    • Reached 1,000 Points Medal icon
    • 1 post awarded Exemplary Feedback Medal icon
    • 5 posts awarded Exemplary Feedback Medal icon
    • One month a member Medal icon
    • 6 months a member Medal icon
    access_time 10y
    Great tutorial, is there any chance you could list what sprites display correctly with env_sun, if there are any apart from the default ones?
    Junior Mapper avatar
    Mantra
    Junior Mapper
    URL to post:
  • unoimkll avatar
    unoimkll Joined 11y ago
    Offline
    access_time 10y
    This is an excellent tutorial and i appreciate your effort in making it. I have a problem however. For you env_sun entity you have the following options: Use Angles: No Pitch: 0 Sun Color(R G B): 176 88 0 Overlay Color: 0 0 0 Size: 20 Overlay Size: -1 Material Name: sprites/light_glow02_add_noz Overlay Material Name: sprites/light_glow02_add_noz HDR Color Scale: 1.0 I dont have most of these including overlay colour, overlay size, material name, overlay material name sprites, HDR colour scale. Ive looked around but i cant seem to find out why i dont have these options in my env_sun entity. None-the-less i did everything without those options and it turned out ok. I was just wandering whether you might know how i can get those options to make my sun look better. Also, i was wandering whether you could tell me whih skybox texture you used for fy_barnyard. I would really appreciate it. Again, thank you for this excellent tutorial.
    Life's a bitch, be its pimp avatar
    Mantra
    Life's a bitch, be its pimp
    URL to post:
  • not kopimi avatar
    not kopimi Joined 11y ago
    Offline
    289 points Ranked 51140th
    access_time 11y
    Seems like the thing for me and thanks for making it but ive got an issue D: its almost as if the sunlight decided to look everywhere BUT where the locator is at. the sunlight itself looks great, but its lighting completly misses my area D: also, the sun turns out green even though i selected yellow as the sun color and orange as the light_env color? any ideas sgt>?
    I love _____. avatar
    Mantra
    I love _____.
    URL to post:
  • CR4ZYM0F0 avatar
    CR4ZYM0F0 Joined 11y ago
    Offline
    access_time 11y
    My map is always Light, i cant make it dark, its driving me crazy.
    Bananite
    URL to post:
  • albser avatar
    albser Joined 11y ago
    Offline
    access_time 11y
    Pros: simple and easy to get Cons: none Improvements: none Notes: none
    Bananite
    URL to post:
  • Runaway of CSF avatar
    Runaway of CSF Joined 12y ago
    Offline
    336 points Ranked 49424th
    access_time 11y
    Pros: Great. Easy on the eyes, simple to understand. Cons: Nothing Improvements: Nothing Notes: Maybe more than a sunset light setting. Basic afternoon/morning etc for future tuts.
    God is great, so great. Just a
    URL to post:
  • Demonio avatar
    Demonio Joined 13y ago
    Offline
    8,217 points Ranked 748th
    access_time 11y
    This tutorial taught me how to us lighting properly. I read it a while back, but assessing now. I love it.
    URL to post:
  • travnasty avatar
    travnasty Joined 11y ago
    Offline
    access_time 11y
    Posted by seancool161 My maps comes out all dark... no light i can see the sun, and all but no light... =\
    If you add any light to your map you have to light the rest of it as well.
    BYAH!
    URL to post:
  • Edgar avatar
    Edgar Joined 12y ago
    Offline
    9,196 points Ranked 639th
    access_time 12y
    My maps comes out all dark... no light i can see the sun, and all but no light... =\
    Titties-N-Beer!|C|Striker avatar
    Mantra
    Titties-N-Beer!|C|Striker
    URL to post:
  • Mikeyspike avatar
    Mikeyspike Joined 13y ago
    Offline
    14,785 points Ranked 380th
    11 medals 1 legendary 1 rare
    • 10 years a member Medal icon
    • 6 years a member Medal icon
    • Reached 1,000 Points Medal icon
    • Reached 2,500 Points Medal icon
    • Reached 7,500 Points Medal icon
    • 1 post awarded Exemplary Feedback Medal icon
    access_time 12y
    Pros: Great tutorial, Easy to read and .. well just nice and simply put Cons: none Improvements: none Notes: Your work is just amazing. Keep making these sort of tuts please! there great! :D
    Love Lockdown. avatar
    Mantra
    Love Lockdown.
    URL to post:

Embed

menu
Share banner
Image URL
HTML embed code
BB embed code
Markdown embed code

Studio

Sign up to access this!

Credits

Key Authors
SGT_kick_ur_ass
Unknown

Submitter

SGT_kick_ur_ass avatar
SGT_kick_ur_ass Joined 14y ago
Offline
5,112 points Ranked 1300th
4 medals 1 legendary 1 rare
  • Submitted 30 Tutorials Medal icon
  • Submitted 15 Tutorials Medal icon
  • Reached 10 subscribers Medal icon
  • Submitted 5 Tutorials Medal icon
SGT_kick_ur_ass
Creator
Sign up to access this!
Sign up to access this!
Sign up to access this!

Game

Sign up to access this!

Category

Details

Difficulty Level
Intermediate

Attributes

Miscellaneous
Genre
Mapping

Share

  • Share on Reddit
  • Share on Twitter
  • Share on Facebook
  • favorite 20
  • remove_red_eye 36.0k
  • mode_comment 44
  • access_time 13y
  • access_time 10y

More from Submitter

menu

WiPs by Submitter

menu

More from Studio

WiPs by Studio

More Mapping Tutorials