Comment by kragen

4 years ago

Yeah, they probably are, I didn't intend them as tutorials but as a better representation of the actual scutwork necessary to draw a triangle.

Object-oriented languages are not a good way to do 3-D rendering. If you want to write pixel shaders in JS you can totally do that but you will have to run them on the CPU; as it happens I wrote a program last week that works that way: http://canonical.org/~kragen/sw/dev3/trama. If you want to run them on the GPU you need a language that exposes the GPU's capabilities.

In essence your primary complaint is that the GPU instruction set is not object-oriented (and neither is your database). Well, you can design your own GPU, but I've got some bad news for you about Verilog, Chisel, and BlueSpec! And you may find out that the real problem is that solid-state physics isn't object-oriented, so your OO GPU will end up underperforming, like the Burroughs B5000 and the Symbolics 3600 (hopefully not as badly as the Intel iAPX432). You'll probably have more success writing an object-oriented database.

However, I do agree that WebGL is a bad API, because boilerplate is never acceptable.

> you may find out that the real problem is that solid-state physics isn't object-oriented

I am saving this quote for future use. Thank you :)

  • Funny, I would argue that the rock on my table is very definitely an object ;)

    • Examine it more closely; you will find that it is a dynamical system composed of sextillions of parts, constantly entering and leaving the rock, and that the boundaries between the rock, the table, and the air are very fuzzy indeed. It isn't even encapsulated, nor are its interactions with its environment mediated by messages to which it freely chooses a response; it is its environment.

      2 replies →

    • But even if we're arguing physics, that's debatable. The shape and toughness of the rock are actually an effect of forces between the atoms composing the rock, and the weight of the rock is actually the interaction between the mass of the rock and the earth. The color of the rock is the effect of the interaction between the molecules in the rock and photons (which are themselves wave-like) and then the interaction between that light and the cells in your eyes.

      Objects are a convenient day-to-day model in real life and software, but there are more "functional" models that comprise the object model.