Create your own Cubemap // Intermediate OpenGL Series

Поділитися
Вставка
  • Опубліковано 17 січ 2025

КОМЕНТАРІ • 32

  • @OGLDEV
    @OGLDEV  Місяць тому +1

    To try everything Brilliant has to offer-free-for a full 30 days, visit brilliant.org/OGLDEV/ . You’ll also get 20% off an annual premium subscription.
    ******************************************************************************************
    Clone the sources:
    git clone --recurse-submodules github.com/emeiri/ogldev.git
    If you want to get the same version that was used in the video you can checkout the tag 'TUT_56_CUBEMAPS'.
    Build on Windows:
    Open the Visual Studio solution: ogldev\Windows\ogldev_vs_2022\ogldev_vs_2022.sln
    Build the project 'OpenGL\Tutorials\Tutorial56_Cubemaps'

    • @CodeParticles
      @CodeParticles 27 днів тому

      Another great upload. But with all due respect, the title to this video tutorial should be Equirectangular Cubemapping!

    • @OGLDEV
      @OGLDEV  26 днів тому

      Thanks! I think the original title will bring in more views... UA-cam now allows you to experiment with multiple thumbnails and see which works best but you are still limited to a single title at a time. Maybe in the future I'll try a different title and see if it works better :-)

  • @dantheplanner
    @dantheplanner 23 дні тому

    Merry Christmas dude. 🎅🏾

    • @OGLDEV
      @OGLDEV  23 дні тому +1

      Merry Christmas! 🎄

    • @dantheplanner
      @dantheplanner 16 днів тому

      @@OGLDEV I wish you a great year. 🍀🥳

  • @typewriteraudio
    @typewriteraudio 9 днів тому

    Great video! Just subscribed!

    • @OGLDEV
      @OGLDEV  9 днів тому

      Thanks! Welcome aboard!

  • @CodeParticles
    @CodeParticles 21 день тому

    Another fun upload! Something neat of a rough benchmark test I found out that the 8k toned jpg file @ 6mg loaded about 2 seconds in equirectangular projection. I then took the same jpg file and cubemapped it into 6 separate files which blew up from 58mb to 73mb each to match the resolution and took 6 and a half seconds to load in cubemapping layout!

    • @OGLDEV
      @OGLDEV  20 днів тому

      Thanks! So are you saying that it is actually better to run the algorithm in real time instead of using it as an offline tool to create a cubemap texture?

    • @CodeParticles
      @CodeParticles 19 днів тому

      @@OGLDEV In the case of the 8k file yes! However, if the jpg file is 4k and lower the outcome may be different. Which I should've tested in advance I apologize.

    • @OGLDEV
      @OGLDEV  19 днів тому

      Interesting, thanks.

    • @CodeParticles
      @CodeParticles 18 днів тому

      @@OGLDEV another odd thing is I feel like the single jpg algorithm 'looks' better when looking up and down as opposed to the 6 file cubemap. However it could be all in my head.

    • @OGLDEV
      @OGLDEV  18 днів тому

      Probably just a false impression. Since we are going through a cubemap texture anyway.

  • @aprile1710
    @aprile1710 27 днів тому +3

    Something I would like to do is playback a video using hardware decoding. If you could do a video on using FFMPEG to decode video frames into textures on the GPU using OpenGL that would be amazing.

    • @theevilcottonball
      @theevilcottonball 16 днів тому

      Reminds me that I wanted to try pl_mpeg

    • @OGLDEV
      @OGLDEV  7 днів тому +1

      I've added this to the todo list. I have to admit that I'm not familiar with this so will require some research to implement.

    • @aprile1710
      @aprile1710 7 днів тому

      @@OGLDEV I understand. Unfortunately ffmpeg examples are pretty rare and most of them do not decode to video memory but rather to system memory and then copy back to the GPU which is very inefficient but simpler I guess. Thanks for looking into it.

  • @coreC..
    @coreC.. 29 днів тому

    @11:51 Maybe it's this? R = sqrt(x^2+y^2+z^2). But the documentation takes the arctan from something other than R. It uses only sqrt(x^2+y^2).

    • @OGLDEV
      @OGLDEV  29 днів тому

      Perhaps the usage of 'R' is a bad naming choice because it confuses with the Greek rho. The docs indeed do the square root without Z.

    • @coreC..
      @coreC.. 28 днів тому

      @@OGLDEV You're just picking the wrong lengths/ratios of the right-sided triangle when calculating the tangent of the angle.
      Tangent = opposite side / adjacent side. But you did hypotenuse / adjacent..
      *And we all thought that the part @**9:42** was the confusing part.* 🙂 fun..
      It really _is_ confusing with all the axis swapping and/or negating. It all looks the same, and it makes you simple. I had to do it too in a project, and i used a matrix to convert the values (looks cleaner?). But it didn't work the first time 😄 because of confusion(s) => mistakes.

    • @OGLDEV
      @OGLDEV  26 днів тому

      sqrt(x^2+y^2) is the length of the projection of line on the XY plane. What I did is Z/sqrt(x^2+y^2) which is the arctan of (90-theta) instead of theta as it appears in the diagram. But I guess it makes sense because we get theta=0 on the XY plane (when Z is zero) and then v=0.5. When z=1 and sqrt(x^2+y^2)=0 we get theta=PI/2 and then v=0. When z=-1 and sqrt(x^2+y^2)=0 we get theta=-PI/2 and then v=1. So I was confused by then wikipedia diagram /equations which demonstrates the formal picture but for the cubemap case we should actually draw theta "below" the line rather than above it.

    • @coreC..
      @coreC.. 24 дні тому

      @@OGLDEV You debugged it afterall. ;-)
      In any case, this video is of good help for me. I am writing a little program to make a flat Earth.
      A friend wants to decorate a wall with a map of our planet, but without any distortion of distances (so, not using any of the usual map projections).
      Now i don't have to think so much anymore about how to tackle that problem in the calculations. 👍

    • @OGLDEV
      @OGLDEV  24 дні тому +1

      Yes, your comment gave me the motivation. Good luck with the project!

  • @oreostastegoods
    @oreostastegoods 23 дні тому

    OpenGL cubemap coordinate space is horrid -- thanks for spending the time to break it down

    • @OGLDEV
      @OGLDEV  23 дні тому

      You're welcome 😊

  • @TinyLittleEnormous
    @TinyLittleEnormous 9 днів тому

    Does it work differently in vulkan ? I guess I will have to want until the series finishes, because it is an advanced topic.

    • @OGLDEV
      @OGLDEV  8 днів тому

      It's actually not that advanced. I'm using the "3D Graphics Rendering Cookbook" as a guide for this series and this topic comes after textures and a few renderer restructuring.

  • @ortassa1096
    @ortassa1096 22 дні тому +1

    may i ask where u from your accent sound really familiar

    • @OGLDEV
      @OGLDEV  22 дні тому

      קרית חיים

    • @ortassa1096
      @ortassa1096 16 днів тому

      @@OGLDEV טוב לדעת שיש לנו אנשים כמוך במדינה.
      תודה רבה אחי על התוכן הנהדר 🙏

    • @OGLDEV
      @OGLDEV  16 днів тому

      בכיף!