OpenGL Tutorial 28 - Parallax Occlusion Mapping

Поделиться
HTML-код
  • Опубликовано: 24 дек 2024

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

  • @jasonwhitworth117
    @jasonwhitworth117 3 года назад +31

    Was scrolling through reddit and saw this thumbnail and thought "no way can they explain that in under 5 minutes"....I was wrong...O_O. You're awesome!!!

    • @VictorGordan
      @VictorGordan  3 года назад +3

      Hehe :d
      Thank you, glad u liked the explanation! :)

  • @NdMoreSpd1.0
    @NdMoreSpd1.0 Год назад +7

    Well done, appreciate your ability to bring it down to a crayon level for those of us still chewing on the box!

  • @RGBguy
    @RGBguy 3 года назад +7

    Simple, Precise, Easy to understand. What else does a tutorial need!? Please keep going. Huge thank you.

  • @5daydreams
    @5daydreams 10 месяцев назад +2

    at 4:01 - is the vector (0,0,1) within the dot product (third argument of mix) not going to restrict the occlusion to one specific direction? Wouldn't it be more suitable to dot against the normal for that fragment?

    • @walidyider7766
      @walidyider7766 8 месяцев назад +1

      true , you can use the fragment normal instead of (0,0,1) , he did this only because the brick wall was facing the direction of (0,0,1) as an example for the video

  • @dontbealoneru
    @dontbealoneru 3 года назад +6

    water with reflection and refraction, it's pretty interesting topics, to look at

    • @VictorGordan
      @VictorGordan  3 года назад +4

      I will most probably do that either in the procedural generation series, or a standalone shader video :)

  • @brumm3653
    @brumm3653 3 года назад +14

    Imagine people in the future laughing at such hacks and just throwing in thousands and millions of vertices... (this has already happened to a number of techniques in 3D graphics world).

    • @VictorGordan
      @VictorGordan  3 года назад +8

      The Nanites technology in Unreal Engine 5 basically haha

    • @Sorvetedchocolat
      @Sorvetedchocolat 2 года назад +3

      @@VictorGordan At least these techniques will still be useful for applications in low-end devices and smartphones

  • @silvertakana3932
    @silvertakana3932 3 года назад +3

    You’re a wizard Victor

  • @alhdlakhfdqw
    @alhdlakhfdqw 2 года назад +1

    great informative video! keep it up victor! subbed :)

  • @Pjty1
    @Pjty1 2 года назад +1

    This is very helpful and well explained. Sadly, this doesn't work with a procedural generated height map, does it? Or at least not, without recalculating the (in my case, expensive) height map calculation for each layer.

    • @VictorGordan
      @VictorGordan  2 года назад +1

      Should work just fine. But keep in mind the use cases for it. You would not use this to render terrain for example. More like a miniature map or something like that.
      Also, you can just render the heightmap to a texture and give that to the shader, should work just fine without any significant impact on performance ;)

    • @Pjty1
      @Pjty1 2 года назад +1

      ​@@VictorGordan Thank you for your quick reply :D I got your shader up and running perfectly well, using a 2D texture as heightmap. But im having a hard time replacing the texture with my procedual heightmap, since we sample the texture with "different" UVs for each loop (because we do UVs -= deltaUVs within the loop). To sample my heightmap, i would also have to include the entire heigtmap calculation to the loop. You don't happen to know a need little trick to avoid that problem, do you? :D

    • @VictorGordan
      @VictorGordan  2 года назад +1

      I'm not quite sure what the problem is... if you write your heightmap into a texture, then when the shader will read that texture just as any other texture. It's ok if the UVs are different. Nothing is getting recalculated in the texture.
      If you are generating a dynamic heightmap each frame on the GPU, then just make that a separate shader from the parallex shader and save the result as a texture.
      Perhaps I'm misunderstanding something? 🤔

    • @Pjty1
      @Pjty1 2 года назад +1

      @@VictorGordan I should have mentioned that we intended to use this effect on runtime random generated buildings with huge surfaces. We are covering texture repetition with noise based damages on the wall, making up the heightmap. We would have to draw thousends of textures, each with a very high resolution, to cover a whole city. Im arfraid writing the heigtmap into a texture is not an option :/ But you can't imagine how much i apprecciate your help anyways :D thank you a lot sir

    • @VictorGordan
      @VictorGordan  2 года назад +2

      Ah ok, I see the problem now. Yeah that's more complicated, I can't give you a solution for that without knowing many more details... good luck tho! ;)

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

    Dude thank you so much :)

  • @dreamdrunk539
    @dreamdrunk539 2 года назад

    You are amazing bro!

  • @abdousekhi4933
    @abdousekhi4933 3 года назад +5

    your videos are very nice, please do one about sketal animation

    • @VictorGordan
      @VictorGordan  3 года назад +2

      Thank you! :)
      I will have a small mini-series on animation in the next couple of months ;)

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

    I am curious whether it'd be possible to gradually change into this starting with an actual displacement map and then towards a normal map.
    That might be a pretty effective gradual LOD system.

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

      I'm pretty sure that is possible and I think it is done in modern games, though it's not always that smooth. If you just put an if statement you can just change between the two at a certain distance. If you want to do a smooth transition you would have to calculate both of them and then interpolate. But it shouldn't be a problem since even with the displacement you are still likely to use the normal map anyway

  • @giusepperana6354
    @giusepperana6354 8 месяцев назад

    Your code here is different from the one on the website. float beforeDepth here is 1.0f - at the start, but on the website the 1.0f- is missing.

  • @houstonhelicoptertours1006
    @houstonhelicoptertours1006 2 года назад +1

    What's the proven way to solve (mostly convex) edge artifacts that come with this technique?

    • @VictorGordan
      @VictorGordan  2 года назад

      Generally speaking you mainly just don't want to allow the viewer to get at a small angle camera with the plane. So you would normally use this for the ground, or walls that have pillars in the corners for example.
      I don't know of any specific fixes off the top of my head. But if you google some I'm sure you'll find papers on this subject which might have some optimizations ;)
      Good luck!

  • @shinystick241
    @shinystick241 3 года назад +1

    Awesome tutorial!

  • @starklosch
    @starklosch 3 года назад +5

    I can't do magic but at least I'll be able to say I do it with OpenGL or even a God of my own world.

    • @VictorGordan
      @VictorGordan  3 года назад +3

      You're a wizard Starklosch! 🧙‍♂️

  • @akriminsoe5527
    @akriminsoe5527 3 года назад +1

    But how to load 3D parallax models?. Is it hard?

    • @VictorGordan
      @VictorGordan  3 года назад

      There is no such thing as a parallax model. It's also in the texture, not the model. I suggest rewatching the theory part of the video to make sure you understand what's actually happening behind the scenes

    • @akriminsoe5527
      @akriminsoe5527 3 года назад

      I mean how to combine loaded model and parallax texture?

    • @VictorGordan
      @VictorGordan  3 года назад +2

      There is no such thing as a parallax texture. You use the heightmap to create a parallax effect. The effect doesn't work that great on models though, so I suggest keeping it to flat surfaces ;)

    • @akriminsoe5527
      @akriminsoe5527 3 года назад

      Thanks Victor.

  • @mitchellkelly241
    @mitchellkelly241 3 года назад

    Juicy Stuff! 😋

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

    Wayyy over my head