Tutorial 12 - Lighting in OpenGL

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024
  • This tutorial provides an introduction to lighting in OpenGL, including calculating diffuse, specular, ambient and emit components using a Blinn-Phong reflection model. It also gives an overview of directional, point, spot and area lights.

Комментарии • 25

  • @egodamonra
    @egodamonra 10 лет назад +33

    Very good. Worth every nano second.

    • @daddydangerous20
      @daddydangerous20 7 лет назад +2

      You missed the attoseconds!! critical info missed

  • @clarecd
    @clarecd 7 лет назад

    AWESOME TUTORIAL!!!! The best one on OPENGL!

  • @janezhang6339
    @janezhang6339 5 лет назад

    Thanks so much, learning openGL this is very clear and understandable

  • @CharIie83
    @CharIie83 8 лет назад +1

    what a great tutorial. thanks man =)

  • @atm7602001
    @atm7602001 5 лет назад +1

    clear and concise

  • @MarcusAseth
    @MarcusAseth 6 лет назад +3

    the light vector at 6:40 should be running the other direction otherwise you get the wrong dot product. dot(surfaceNormal, -lightDirection)

  • @J0hnPinkerton
    @J0hnPinkerton 5 лет назад

    Where do the d, s, a, and e properties come from with both the light and the object? Do you decide what they should be for that light and that object? And should they be within a certain value range? Maybe 0 to 255 like the rgb hex values are?

  • @drcvagos-iu
    @drcvagos-iu 8 лет назад

    awesome!

  • @MaxwellsWitch
    @MaxwellsWitch 7 лет назад +1

    should I do these computations on the cpu, or the gpu through some kind of opengl wizardry. I'm a noob at opengl, but the math is fine with me. I just want a general work flow to get these things on screen.

    • @jeffchastine
      @jeffchastine  7 лет назад +2

      Since much our current lighting techniques are done on a "per pixel" basis, you'd probably want to do it on the GPU.

  • @anirudhrao4829
    @anirudhrao4829 Год назад

    yeah but how do you code different types of light like spotlight ,pointlight etc

  • @lewisb8634
    @lewisb8634 8 лет назад

    I'm not sure I'm understanding the complete meaning of a 'normalized' vector. When you keep saying, "these vectors need to be normalised" I thought a normalised vector has the same magnitude - 1 - but they are all different lengths here. To normalize a vector you divide all the components (position x,y,z) by the magnitude right?

    • @jeffchastine
      @jeffchastine  8 лет назад +1

      Hi Lewis - it looks like you answered your question, but just to make sure, a normalized vector has a length of 1. You can imagine that the vector between the surface and light will be greater than 1, so you have to normalize it before using it in many linear algebra operations. I hope that helps!

    • @lewisb8634
      @lewisb8634 8 лет назад

      +Jeffrey Chastine Thank-you very much, makes sense now! It wouldn't be common to just coincidentally have the light source exactly 1 from the surface of a triangle, especially on a more complex 3D mesh. So normalizing the vector between them enables it to be involved in all the calculations. Thanks again, I've subbed :)

    • @lewisb8634
      @lewisb8634 8 лет назад

      +Jeffrey Chastine I really appreciate you uploading all that you have done by the way, these videos are extremely helpful!

  • @onlyroxxor
    @onlyroxxor 6 лет назад

    cd and ld are both normalized diffuse color VECTOR ?

    • @jeffchastine
      @jeffchastine  6 лет назад

      Well, you shouldn't have to normalize colors. However, if you want to do any mathematical operations on vectors (i.e. calculating angles between them), it's often required to normalize them before doing that operation. I hope that helps.

  • @izzyblackout1090
    @izzyblackout1090 5 лет назад

    How do I generate a laser beam using light in OpenGL?

  • @nadari9162
    @nadari9162 5 лет назад +1

    I just wanted some shadows behind my objects and now i feel like an idiot. Great Video though

  • @Byynx
    @Byynx Год назад

    This video shows how youtube algorithm is wrong.

  • @talesseed
    @talesseed 9 лет назад

    Are you a teacher ? Just wondering :)

    • @jeffchastine
      @jeffchastine  9 лет назад +3

      Talesseed Yep - I work at Kennesaw State University, close to Atlanta, Georgia. You should check us out :)

    • @talesseed
      @talesseed 9 лет назад

      Yes, I would definitely do it , but I live in France, so that quite far! Maybe I'll go study in America one time :)