Godot 4! Shading The Raymarched Shapes Based on Lights!

Sdílet
Vložit
  • čas přidán 12. 09. 2024

Komentáře • 5

  • @arthurprediger4054
    @arthurprediger4054 Před 2 měsíci

    From what I know the fourth component of a homogeneous vector should be zero if it is a direction vector (such as a normal vector) and one if it is a vector that represents a postion. If I am not mistaken, the one in the fourth element of a vector makes the matrix transformation to apply translation to the vector and for directional vectors you only want the rotation part.

    • @arthurprediger4054
      @arthurprediger4054 Před 2 měsíci

      Your vector transformation with the 4x4 matrices was right, it actually does make sense. And you gave the answer right after, by using the matrices in the 3x3 form you are ignoring translation which exactly what the zero in the fourth element of the homogeneous vector does as well.

    • @iDigvijaysinhG
      @iDigvijaysinhG  Před 2 měsíci

      Hey Arthur, thanks for amazing explanation. My main confusion was like "MODELVIEW_MATRIX" does not include any translation data so why the result actually differs when passing 0 and 1.
      So for everyone, at 8:43 I was so wrong. MODELVIEW_MATRIX does in fact have translation data mainly to transform vertex position (positional vectors). And our normals are just directional only so as Arthur said we can ignore the translation, either by creating a 3x3 matrix or even passing 0 as the w component of our vector.
      I highly recommend to check the amazing answer from Theraot on game dev stack exchange for much in depth explanation here gamedev.stackexchange.com/a/178645/107339

  • @0logichere
    @0logichere Před 2 měsíci +2

    I can’t tell you how much these videos have helped me understand ray marching. Thank you so much 🙏🙏🙏

    • @iDigvijaysinhG
      @iDigvijaysinhG  Před 2 měsíci +2

      That's so great to hear, I am really glad that it helped you.