Hello Guest

"Rendering without vertices"

  • 3 Replies
  • 471 Views
*

Offline overlisted

  • *
  • 15
  • #MakeMinecraftOpenSource
"Rendering without vertices"
« on: March 08, 2020, 23:08:52 »
Hi, on websites like Shadertoy and GLSL Sandbox I see no geometry and vertex shaders, so I started to think that "rendering without vertices" is better. Is it?
Or should I use them in some special tasks? What tasks then?

(rendering without vertices is drawing a quad on whole screen and adding shapes only with a fragment shader)
« Last Edit: March 08, 2020, 23:22:35 by overlisted »

Re: "Rendering without vertices"
« Reply #1 on: March 10, 2020, 04:05:17 »
While rendering without vertexes is very possible, it is FAR from efficient.

The thing here is, that it boils down to writing very complicated and convoluted fragment shaders. This approach, while cool in theory, has massive drawbacks.
- It is hard to debug
- It is very inefficient as far as processing time goes.

Basically, you need to run a very complex algorithm for every single fragment on your screen to determine its color. As you can imagine, this means repeating your calculations hundreds of thousands of times, even for a 720p render. For each frame.

Furthermore, while I never studied this in-depth, I believe there are limitations to what exactly you can do with it. Many GPU's, especially on mobile, have a limit to how many instructions long they can be. And if you want to create something like an animated character, you have to basically emulate vertexes to at least some extent within your fragment shader, so you can keep track where his limbs are and his position on the screen. So you return to vertexes, only in the least efficient way.

That's what I think about it. I may be very wrong here. But I personally think that it's a cool exercise and nothing more. Essentially, it's a waste of time that has only bragging rights for benefits.
There is a reason why all modern rendering is vertex-based and texture-based and polygon-based. Because it greatly reduces the processing needed, and as such lets you do more MEANINGFUL calculations.

*

Offline overlisted

  • *
  • 15
  • #MakeMinecraftOpenSource
Re: "Rendering without vertices"
« Reply #2 on: March 13, 2020, 01:09:04 »
While rendering without vertexes is very possible, it is FAR from efficient.

The thing here is, that it boils down to writing very complicated and convoluted fragment shaders. This approach, while cool in theory, has massive drawbacks.
- It is hard to debug
- It is very inefficient as far as processing time goes.

Basically, you need to run a very complex algorithm for every single fragment on your screen to determine its color. As you can imagine, this means repeating your calculations hundreds of thousands of times, even for a 720p render. For each frame.

Furthermore, while I never studied this in-depth, I believe there are limitations to what exactly you can do with it. Many GPU's, especially on mobile, have a limit to how many instructions long they can be. And if you want to create something like an animated character, you have to basically emulate vertexes to at least some extent within your fragment shader, so you can keep track where his limbs are and his position on the screen. So you return to vertexes, only in the least efficient way.

That's what I think about it. I may be very wrong here. But I personally think that it's a cool exercise and nothing more. Essentially, it's a waste of time that has only bragging rights for benefits.
There is a reason why all modern rendering is vertex-based and texture-based and polygon-based. Because it greatly reduces the processing needed, and as such lets you do more MEANINGFUL calculations.

But why do Shadertoy and GLSL sandbox use that method of rendering?

Re: "Rendering without vertices"
« Reply #3 on: March 13, 2020, 03:46:28 »
Because it's cool?
Or because they have a specific task that doesn't really need vertexes?

I don't know. Why don't you ask them directly what are the benefits?

Shadertoy, for example, is a community dedicated to shaders and it stands to reason that they focus on pushing the boundaries of what can be done with them. Does it have any practical purpose other than learning? Not really. It's done just to show off and make something cool but useless.

Just because someone does something doesn't mean that it has some practical purpose. Often it's just for fun.

Again, can you render without vertexes? Yes. Not everything, but yes. Is it practical? No.
If it was practical, then there would be suits and API's that are focused on vertex-less engines. Big companies would adopt that paradigm, especially those that favor efficiency above else.

But it is NOT efficient. Both in computing time, and in the time it takes a developer to write something and make it work.

If you think I'm wrong - hey, I may be! But then you should take your question to those communities themselves and ask them what's the benefit.
« Last Edit: March 13, 2020, 03:53:23 by Aisaaax »