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'
@CodeParticles3 күн бұрын
Another great upload. But with all due respect, the title to this video tutorial should be Equirectangular Cubemapping!
@OGLDEV2 күн бұрын
Thanks! I think the original title will bring in more views... KZbin 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 :-)
@aprile17104 күн бұрын
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.
@coreC..6 күн бұрын
@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).
@OGLDEV6 күн бұрын
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..5 күн бұрын
@@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.
@OGLDEV2 күн бұрын
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..Күн бұрын
@@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Күн бұрын
Yes, your comment gave me the motivation. Good luck with the project!
@stysner45804 күн бұрын
Why wouldn't you just remap the coordinates and sample from the texture directly?
@OGLDEV4 күн бұрын
During runtime? This means repeating the same calculations all over again on each pixel. Better do it once at startup (or even offline - you can make a tool from it) and have the cubemap ready for direct sampling.
@stysner45804 күн бұрын
@@OGLDEV But if you just bind the spherical map, calculate a direction vector and calculate UVs from it mapping onto spherical coordinates, you're there. The only thing left to do would be fixing potential seams, but for good spherical maps you shouldn't have to, just tile the texture, they should be seamless. I've implemented this years back in Unity because I didn't want to author cubemaps.
@OGLDEV3 күн бұрын
I guess it's a matter of personal preference. I just don't see the advantage of doing something in real time which can be done offline. It's always good to have multiple solutions for the same problem and then apply the best one according to the circumstances.
@stysner45803 күн бұрын
@@OGLDEV But you're not doing anything during runtime, the only thing is converting a direction vector to a spherical coordinate in a fragment shader...? There's nothing wrong with implementing something cool like you've done, I just questioned the reasoning, that's all! Happy Holidays!