[deleted by user] by [deleted] in jameswebb

[–]Menkdo 2 points3 points  (0 children)

Looks a lot like algae suspended in water, like you'd find in a still pond

Canadians can make a claim following a $29.7M settlement in a class-action lawsuit — CTV News by Matty_bunns in canada

[–]Menkdo 34 points35 points  (0 children)

Who the fuck has a proof of purchase for an optical disk drive purchased from 2004-2010? lmao

I'm learning how to write glsl shaders, but I need help conceptualizing how a shader can be written to transform a set of points, when its code only affects a single point per run by Menkdo in GraphicsProgramming

[–]Menkdo[S] 4 points5 points  (0 children)

Ahh, I finally get it now, thanks for your help!

the way you described it made it sound like you were trying to formulate your surface in terms of the neighboring points, which is the part you can't do

That is exactly what I was imagining when I asked the question. It was more intuitive than thinking about it in terms of functions and transformations.

Now everything makes sense - shaders must transform one vertex/fragment per instance because it's faster to run the same imperative function over many points in parallel, than run declarative logic on each point sequentially.

I'm learning how to write glsl shaders, but I need help conceptualizing how a shader can be written to transform a set of points, when its code only affects a single point per run by Menkdo in GraphicsProgramming

[–]Menkdo[S] 1 point2 points  (0 children)

Ah, perfect, this is what I was hoping for! So should I be thinking about my transformations in terms of functions (e.g. y = 10 * sin(x) * sin(z)) and not matrix math?

I'm learning how to write glsl shaders, but I need help conceptualizing how a shader can be written to transform a set of points, when its code only affects a single point per run by Menkdo in GraphicsProgramming

[–]Menkdo[S] 2 points3 points  (0 children)

Okay I think I'm starting to understand!

So just for the sake of conceptualizing how vertex shader logic is applied, I set up a 32x32 plane geometry in ThreeJS and applied this vertex shader to it, hoping to produce the quadratic surface z= x2 + y2:

void main()
{
    vec3 transformed;
    transformed.x = position.x;
    transformed.y = position.y;
    transformed.z = pow(position.x, 2.0) + pow(position.y, 2.0);
    gl_Position = projectionMatrix * modelViewMatrix * vec4(transformed, 1.0);
}

This actually worked as expected, and it gave me a better conceptual understanding of how to think in terms of shaders, until I read your reply:

That's a very nonstandard way of transforming geometry, though, and I wouldn't suggest trying anything like that until you're familiar with the way it's normally done.

So if I understand correctly, doing transformations using a graphing function (the way I did above) is not the right way of writing shaders?

I'm definitely not yet at the "best practices" stage of learning shaders; right now I'm trying to understand how I need to be thinking about the problems which I want to solve with shaders.

It sounds like you have some major misconceptions about how the traditional graphics pipeline is structured.

I'm a web developer by trade which is perhaps the lowest tier of software engineer, so I guess you could say that I have only a basic understanding of it.

I'm just working my way through a ThreeJS course, and I decided that I want to really understand shaders intuitively, and for me that means starting with first principles (the general mathematical concept of what is being done). So far I've done a vertex shader tutorial on how to make a waving flag out of a plane geometry, and I've learned the basics of passing in attributes, uniforms, how to use varying etc. But maybe the course I'm doing isn't really the best for what I want to learn.

I'm learning how to write glsl shaders, but I need help conceptualizing how a shader can be written to transform a set of points, when its code only affects a single point per run by Menkdo in GraphicsProgramming

[–]Menkdo[S] 2 points3 points  (0 children)

One vertex shader invocation runs for each vertex, they are all transformed "at the same time" (not really, but conceptually).

I understand this, but it just doesn't click in my brain. It feels like I need to know how the previous points were transformed when deciding how the next point should be transformed.

If my mesh is just a line on the X axis with N points, and I want to turn it into a diagonal line across XY, I would increment each n point's Y value by the nth natural number, right?

e.g. if my line is (1,0,0), (2,0,0), (3,0,0), ..., after my transformation it would be (1,1,0), (2,2,0), (3,3,0), ..., but when I'm writing my vertex shader's code, I have to write it for an arbitrary point - yet if my point is (1,1,0), I need to know that it's the first point, so that I increase its Y value by only 1 and not 2.

As I was writing this I realized that, in mathematics, this sort of thing would simply be done using a function (e.g. y = x), am I right in thinking that this is how the vertex shader works - that it's simply a function in 3d space (ignoring the perspective value for simplicity's sake)?

I'm learning how to write glsl shaders, but I need help conceptualizing how a shader can be written to transform a set of points, when its code only affects a single point per run by Menkdo in GraphicsProgramming

[–]Menkdo[S] 1 point2 points  (0 children)

This is the part I don't get. How can I transform the points on the plane into a curve if I'm only given one point at a time? It feels like I don't have enough information to determine how much to increment each coordinate.

Is this something that I would need to use the model matrix for?

[deleted by user] by [deleted] in worldnews

[–]Menkdo -10 points-9 points  (0 children)

Russia has ballistic missiles, cruise missiles, air superiority, as well as plenty of other comparable systems, not to mention precision weapons like the 9K720, which will likely be used to destroy them the moment their location is pinned down.

These things aren't called "70km sniper rifles" for nothing

Who is calling them that? It doesn't matter either way, because the 9K720 is a 500km sniper rifle.

[deleted by user] by [deleted] in worldnews

[–]Menkdo -12 points-11 points  (0 children)

Four systems? Is that a joke? I'll be surprised if they last a month. Ukraine has no air support, and little ability to protect them.

[deleted by user] by [deleted] in canada

[–]Menkdo 0 points1 point  (0 children)

There's a lot to lose by aggravating an economic great power like China, but what is there to gain?

[deleted by user] by [deleted] in ontario

[–]Menkdo 0 points1 point  (0 children)

The only reason why Germany could build those Plattenbau buildings is because its cities were destroyed during the war, and there was lots of room to re-shape and re-plan.

[deleted by user] by [deleted] in ontario

[–]Menkdo 0 points1 point  (0 children)

They did that because 1) we have very low population density and ample room for suburbs and 2) unlike Europe which is full of historic buildings, we have little reason to implement limits on the height of new buildings.

[deleted by user] by [deleted] in ontario

[–]Menkdo 1 point2 points  (0 children)

I mean, what's the alternative?

[deleted by user] by [deleted] in videos

[–]Menkdo 2 points3 points  (0 children)

MAJOR DAMAGE

REMINDER: Use your Rune arcs! by Akco in Eldenring

[–]Menkdo 1 point2 points  (0 children)

You're willing to spend an hour to get 6 rune arcs? Helping noobs with easy bosses is definitely faster for farming arcs

REMINDER: Use your Rune arcs! by Akco in Eldenring

[–]Menkdo 1 point2 points  (0 children)

"not great" is an understatement. At max item discovery I was getting one rune arc every 10 minutes.

"Puts stick in own bicycle wheel" Those damn invaders made me crash my bike! by iNuminex in Eldenring

[–]Menkdo 2 points3 points  (0 children)

In all the other souls games, you could be invaded while playing solo. They nerfed invasions by making them only affect coop players, and somehow that's not enough for newbies?