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'
Thanks! I think the original title will bring in more views... TH-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 :-)
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!
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?
@@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 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.
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.
@@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.
@@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.
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.
@@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. 👍
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.
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'
Another great upload. But with all due respect, the title to this video tutorial should be Equirectangular Cubemapping!
Thanks! I think the original title will bring in more views... TH-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 :-)
Merry Christmas dude. 🎅🏾
Merry Christmas! 🎄
@@OGLDEV I wish you a great year. 🍀🥳
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!
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?
@@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.
Interesting, thanks.
@@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.
Probably just a false impression. Since we are going through a cubemap texture anyway.
Great video! Just subscribed!
Thanks! Welcome aboard!
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.
Reminds me that I wanted to try pl_mpeg
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.
@@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.
@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).
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.
@@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.
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.
@@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. 👍
Yes, your comment gave me the motivation. Good luck with the project!
OpenGL cubemap coordinate space is horrid -- thanks for spending the time to break it down
You're welcome 😊
Does it work differently in vulkan ? I guess I will have to want until the series finishes, because it is an advanced topic.
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.
may i ask where u from your accent sound really familiar
קרית חיים
@@OGLDEV טוב לדעת שיש לנו אנשים כמוך במדינה.
תודה רבה אחי על התוכן הנהדר 🙏
בכיף!