1. Forums
  2. Discord
  3. About Mapcore
  4. Patreon Supporters
  • Login
  • Register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Articles
  • Pages
  • Forum
  • More Options
  1. Mapcore
  2. Discussions
  3. Level Design

How vertexlighting works

  • hessi
  • May 25, 2006 at 6:29 PM
  • hessi
    • May 25, 2006 at 6:29 PM
    • #1

    because i was asked on how to light out a prop static in hl2 i made an image on how the lighting works. so take a look on this first

    [Blocked Image: http://www.thomashess.net/how_vertexlights_work.jpg]

    1. image this sphere is a vertex OR a lightingorigin which you may place as an info_lighting in hammer (and link it to a prop_static)

    there are 2 lights in the scene. one comes from the upper left and the other one from the lower right. the camera direction has no light. due to that there is a dark line on the sphere in the middle

    2. i stuck a cube with harden edges in my sphere. as you can see it is lighted like the parts of the sphere you can still see. that's a result of the vertexnormals you have on every polygon mesh.

    3. here you see those vertexnormals. each polygon has them on its vertices. the result: a vertex can have n>=1 vertexnormals (math N means integers bigger than 0; N = [1, 2, 3,...] while n is an element of N)

    take a look on the upper polygon. its really bright yellow. all vertexnormals are orientied to the upside yellow sunlight. so they say "ok polygon as to be yellow at my side. -> yellow gradient on this polygon

    same is valid for all other polygons and vertices. imagine that each vertex is this sphere i showed in the first image. place the vertexnormal on the spehere and place the lighting of this point in the sphere on your polygons vertex.

    talkin unprofessional: the sphere is a projection to all vertices telling the polygons vertexnormal how to be lighted.

    4. interesting: if you soften edges (or work with smoothing groups) your vertexnormals get merged. so they are not like the facenormals. due to that the edge i softened has a vertexnormal pointing away from all lights in my scene. result: we got a yellow lighting at the top polygon that fades to a black lighting (no lighting) and fades to a blue lighting at the bottom.

    knowing these basics you should understand why prop statics are dangerous to use in outdoor scenes. example:

    take a look on de_train. there train railings at the bottom have an extrem bright lighting that hardly cuts to a dark one.

    that is the result of the fact that there are 2 models using 2 different lighting reference points (info_lighting) the one is in the sun the other one is in the dark area. alle vertices of the prop static are referenced to this lighting point.

    so take care of how you work with statics and props. there might be ugly bright or dark models in versa lighting situations because this info_lighting is in a different room or position your vertices are.

    greets

    hessi

    edit: here is an addition that might help to understand my crappy english

    [Blocked Image: http://www.thomashess.net/how_vertexlights_work2.jpg]

  • General Vivi
    • May 25, 2006 at 8:21 PM
    • #2

    very nice tutorial hessi . do you have it in pdf format?

  • hessi
    • May 25, 2006 at 11:09 PM
    • #3

    you may download it as a PDF file too:

    http://www.thomashess.net/exchange/tuto ... ghting.pdf

  • General Vivi
    • May 25, 2006 at 11:23 PM
    • #4

    thans hessi ^^

  • ⌐■_■
    • May 29, 2006 at 1:27 PM
    • #5

    wow Hessi, great stuff!

  • Acumen
    • May 29, 2006 at 2:14 PM
    • #6

    to be really honest, i don't really understand that tutorial

    so much technical expressions and only 2 different color shades on various simple object examples. would've helped me more personally if you'd used real ingame examples of vertex lighting e.g. the train railings you mentioned on de_train.

    not to annoy you or anything, just sayin that a more practical use concentrated tutorial would have helped me better at understand what you're trying to submit to the tutorial readers :/

  • Zacker
    • May 29, 2006 at 3:10 PM
    • #7

    It is great of you to do this work for the community, but I must admit that your tutorial tends to be more confusing than informative. I know how vertexlighting works already, but even then this tutorial seems a little confusing.

  • hessi
    • May 29, 2006 at 3:34 PM
    • #8

    just saying "i did not understand" isnt helpfull at all. mabye you could say WHAT yout did not understand.

    @ acumen:

    in the pdf file i posted you see some screenshots of de_train. there you see how the vertexlighting creates disgusting graphics like full bright steel under a waggon or you can see how light lits a cylinder shape waggon.

    i intended to show you how the technique of vertexlighting works and what you have to care about while working with prop_statics (which are always vertexlit). for example not making a model too big or placing it in extrem light contrast situations so that one side is bright even though the environment is completly dark. thats what turtle rock worked around on de_train at the railings on the ground i made an screenshot from in my PDF file.

    anyway: if you do not understand some parts please tell me which ones or give me a hint where to add screenshots.

  • Schmung
    • June 1, 2006 at 6:51 PM
    • #9

    Fairly sure I get that, but is there a way to get around it without having your smoothing look ass?

    For instace, with square railings is there a way to project the lighting from a 'soft' version onto a model that has 'hard' edges so you get a smoother light gradient? Hope that makes sense. I'd provided images, but for some fucking reason mapcore doesn't work for me at home.

  • hessi
    • June 1, 2006 at 8:48 PM
    • #10

    those vertexlight gradients are always linear gradients. if you want a "softer" version of this gradient you have to tessalate your surface. there is no exponential gradient in the source engines vertexlighting. (i even dont know any engine that works that way).

    if i understood you correctly you compare a completly smoothed cubes vertexlighting with the vtxlighting of a smoothed 64 subdivisions sphere?!

    the only tweak that could help you getting a better result in that case would be anormalmap to directly influence the shading of each textelnormal (that's why you shouldnt call normalmapping a heightmanipulating shading effect. it's changing normals! parallel polys have the same normals. result would be a completly 1 colored normalmap)

    you can mail me a screenshot of your problem too (maybe i missunderstood you)

  • Schmung
    • June 2, 2006 at 5:04 PM
    • #11

    np, it was just a theorectical thing anyway, hammer doesn't work for me at present. Thanks for explianing though, that normalmapping thing might be useful.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!

Register Yourself Login
Discord

The Mapcore Discord is our lively IRC channel of the 2000s reborn. Chat about level design, gaming, and more.

Latest Posts

  1. Custom Gamemodes Contest

    Angel
    July 20, 2026 at 11:46 AM
  2. FAQ

    Angel
    July 20, 2026 at 10:14 AM
  3. Tangerine

    Harry Poster
    July 18, 2026 at 11:10 AM
  4. Any of the old guard still around? D:

    Warby
    July 12, 2026 at 8:23 PM
  5. About our archived forums

    Thrik
    June 30, 2026 at 2:12 PM
  6. Mapcore Discord

    mason_fan123
    June 24, 2026 at 8:52 PM
  7. [CS2] Valley

    Serialmapper
    June 22, 2026 at 11:56 AM
  8. Free Music / SFX Resource - Over 2500 Tracks

    Eric Matyas
    June 18, 2026 at 12:32 PM
  9. Pango [WIP]

    Elowen
    June 11, 2026 at 10:13 AM
  10. [CS2] Dvina

    Jeremy Rivera
    June 11, 2026 at 10:03 AM
  1. Privacy Policy
  2. Contact
Powered by WoltLab Suite™