Create your own Cubemap // Intermediate OpenGL Series

  Рет қаралды 1,540

OGLDEV

OGLDEV

Күн бұрын

Пікірлер: 16
@OGLDEV
@OGLDEV 10 күн бұрын
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 3 күн бұрын
Another great upload. But with all due respect, the title to this video tutorial should be Equirectangular Cubemapping!
@OGLDEV
@OGLDEV 2 күн бұрын
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 :-)
@aprile1710
@aprile1710 4 күн бұрын
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..
@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).
@OGLDEV
@OGLDEV 6 күн бұрын
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.. 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.
@OGLDEV
@OGLDEV 2 күн бұрын
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.. Күн бұрын
@@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 Күн бұрын
Yes, your comment gave me the motivation. Good luck with the project!
@stysner4580
@stysner4580 4 күн бұрын
Why wouldn't you just remap the coordinates and sample from the texture directly?
@OGLDEV
@OGLDEV 4 күн бұрын
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.
@stysner4580
@stysner4580 4 күн бұрын
@@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.
@OGLDEV
@OGLDEV 3 күн бұрын
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.
@stysner4580
@stysner4580 3 күн бұрын
@@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!
@OGLDEV
@OGLDEV 3 күн бұрын
Happy new year!
Normal Mapping Adventures // OpenGL Intermediate Series
18:42
Blender is Changing Animation Forever
11:11
Smeaf
Рет қаралды 211 М.
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
Coding Adventure: Rendering Text
1:10:54
Sebastian Lague
Рет қаралды 785 М.
The IMPOSSIBLE Laptop Fan...
14:19
Dave2D
Рет қаралды 1,1 МЛН
Introduction to Vulkan Compute Shaders
21:39
İlker
Рет қаралды 12 М.
Why Unreal Engine 5.5 is a BIG Deal
12:11
Unreal Sensei
Рет қаралды 1,6 МЛН
The Endless Grid
21:58
OGLDEV
Рет қаралды 4 М.
2 Years of C++ Programming
8:20
Zyger
Рет қаралды 192 М.
I made a horror game that's IMPOSSIBLE to SCREENSHOT!
3:52
Branta Games
Рет қаралды 2 МЛН
Devin just came to take your software job… will code for $8/hr
5:13
The OpenGL Software Ecosystem
13:51
OGLDEV
Рет қаралды 10 М.
I Took a Basic Todo App and Made It Cost $2000/Month
10:55
Coding with Lewis
Рет қаралды 73 М.
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН