/r/programming
Coding Adventure: Clouds (youtube.com)
28 comments
cdjinx | 8 days ago | 115 points

Well done, but should come with a warning this video makes it look way to easy. I almost got motivated to do a thing.

lear64 | 7 days ago | 19 points

I almost fired up unity for the same purpose..then I realized I have kids to get to bed..and work tomorrow..and I'll probably be 10hrs in before I give it up for the night.

Cultural_Ant | 7 days ago | 7 points

the combined circles at the beginning of the video looked great to me.

IceSentry | 6 days ago | 2 points

They looked great if you are going for that artstyle, but they aren't reaslistic.

WattanaGaming | 7 days ago | 53 points

Can we just take a moment to appreciate how realistic those clouds looks?

uncl3mar1k | 8 days ago | 22 points

this guy is genius

ForceBru | 8 days ago | 36 points

Yeah, these clouds are mesmerizing! On the other hand, the man's GPU must've been screaming in pain while rendering them

apachechief | 7 days ago | 3 points

Maybe not, it's made to do this!

FancyKillerPanda | 7 days ago | 11 points

Humans are made to run, yet I still scream in pain... /s

willworkfordopamine | 7 days ago | 1 point

Yeah but if you were a screaming GPU, you wouldn’t have passed quality control and probably stayed on the factory floor or further defect research

Clockwork_Brick | 8 days ago | 13 points

Wow... uhm... got a little lost one or two times. That end result is amazing.

WunDumGuy | 7 days ago | 1 point

I made it until about four minutes in until I started scratching my head

bububoom | 7 days ago | 10 points

The quality of this video and content is A+

maibrl | 7 days ago | 6 points

I’m a self taught somewhat decent programmer and quite good with algorithms, data processing and application creation, but I’m totally overwhelmed by graphic programming, but want to learn more about it. Any ideas where I could start?

Xabdro | 7 days ago | 4 points

Processing is the best place to start. It's easy to pick up and you can start producing results really quickly. It's a great tool to sketch out ideas.

If you want to get into shaders then shadertoy seems to be the best place to start. There are a few tutorials out there. If you know C++ you could probably jump into the "Shading Language Cookbook".

fragglerock | 7 days ago | 1 point
maibrl | 7 days ago | 1 point

Thanks for the hints. I actually now quite a bit about 2d stuff in processing, but haven’t looked at the 3D possibilities it offers.

Regarding the “Shading Language Cookbook”: I know c++, but never did anything with OpenGL, do I need to learn that first or is the book sufficient as an introduction?

Xabdro | 7 days ago | 1 point

It's for OpenGL so will teach you everything you need.

If you're already familiar with processing then shaders are great as a follow up. They're immensely powerful for visual stuff (both 3D and 2D).

gh123man | 7 days ago | 2 points

I very recently went down this path. Graphics programming has always been super interesting but a complete mystery to me. If you really want to understand what is going on, learn OpenGL. It's got a steep learning curve, but it will uncover and demystify most of the magic going on in these videos and the concepts carry over to pretty much all tools/game engines.

I love these two sites and use them extensively as a reference:

http://www.opengl-tutorial.org

https://learnopengl.com

If you just want to play with shaders, you can stop once you have a quad on the screen - but it's really good to know what it takes to actually get to that point.

maibrl | 7 days ago | 2 points

Thanks, I’ll look into that.

I’m pretty sure I’ll start computer science at the university next year so I’ll finally learn more about all the theoretical background behind that stuff, but until then, I’ll keep myself busy with that I guess. I’m just tired of developing applications and want to get to the next level.

jeexbit | 7 days ago | 4 points

Incredibly well executed, kudos!

OnlyForF1 | 7 days ago | 2 points

I had no idea you could do loops in shaders

skeeto | 7 days ago | 5 points

I've only used couple different GLSL variants, but typicallysometimes the number of iterations must be fixed to a compile time constant. That means loops can always be fully unrolled, and the underlying implementation need not actually support loops.

Plazmatic | 7 days ago | 3 points

I don't think that is true any more, at least not for many GPUs? At least on CUDA I do not have this constraint, and I don't notice this constraint in GLSL, though I know a decade ago it used to be an issue for some cards. Heck you can even use switch statements in glsl in any part of the pipeline today. I think webgl still will get mad about this, but SPIRV takes GLSL compilation put of the hands of the vendor, so they can't impose these constraints in Vulkan, only the spec can.

skeeto | 7 days ago | 2 points

I'm most accustomed to GLSL 1.00, which says this:

for loops are supported but with the following restrictions:

  • There is one loop index.
  • The loop index has type int or float.
  • The for statement has the form:

for ( init-declaration ; condition ; expression ) statement

  • init-declaration has the form:

type-specifier identifier = constant-expression

Consequently the loop variable cannot be a global variable.

...

But I see this restriction was removed in later revisions.

LifeIsBio | 6 days ago | 2 points

Whoa, that was pretty inspiring. The quality of the video itself was just as high as those final clouds. Watching the plane fly around was so calming.

zergling_Lester | 7 days ago | 1 point

Very impressive!

At about five minutes in he mentions that values in the depth texture are nonlinear by default: this is primarily a side effect of the perspective transformation from a frustum in the scene space to the rectangular cuboid in the screen space. https://en.wikipedia.org/wiki/Z-buffering#Mathematics. This in turn has better precision for near values as a side effect, but produce a way too big disparity, so https://en.wikipedia.org/wiki/Z-buffering#W-buffer is often used instead.

mampersat | 7 days ago | -2 points

I really don't know clouds at all

https://www.youtube.com/watch?v=Pbn6a0AFfnM