1. Neat program.
I wonder if the slowness is due to iostreams or just the fact that it's a 22MB file.
Agree x 2 Artistic x 1 (list)

2. Do some tests and see which one is faster. Learning matrices is essential knowledge for 3D programming anyway so no harm would be done.

What you're doing seems to be replicating what the graphics card is already programmed to do, but in a higher level language. So I think it would be unlikely if what you were doing was faster.
Why are you assuming I don't know how a matrix works?

GPUs are designed to be very fast at transforming vertices using vector/matrix operations and that's how they should be used. The whole point of using matrix transformations is to make the vertex transformation process streamlined as a whole.
I've been assuming that sending data to the graphics card is a bottleneck, and relative to uploading 8 times as much per frame, a single extra vector addition per vertex is a piece of cake.

Even if it is slower, it won't be that much so. Not enough to accuse me of joking like I had said something insane.
Agree x 2 (list)

3. Why are you assuming I don't know how a matrix works?
Because sending a single matrix for scaling, translation, and rotation is much easier than sending a bunch of floats in its place. It seems really tedious for you to do that.

4. Because sending a single matrix for scaling, translation, and rotation is much easier than sending a bunch of floats in its place. It seems really tedious for you to do that.
No. You send one matrix (16 floats) that is constructed from the camera's position, rotation and perspective whenever any of the three change, which is at most once a frame.

Then, for each object, before you draw it you send a single vector with its position in the world.

In the shader, you just add this translation to each vertex's position before multiplying by the camera's matrix.

So for the scene you send 16 + 3n floats, and each vertex has one extra vertex addition, which for a complex shader is nothing compared to any other stuff going on.

This is assuming that all you need to worry about is objects moving, not rotating or scaling etc. In that case I would just resend the MVP matrix for each object.

Why what I am doing so terrible?

5. Just use a damn 'scene' UBO and be done with it.
Put everything you could possibly ever want in there:
view, projection, view-projection, inverse view, inverse projection, inverse view-projection, view coordinate, view rotation, inverse view rotation, frustum edge rays (view- and world-space), current time, frame duration, fog parameters, etc.

You update it once per frame and use it to draw everything. Practically no bandwidth overhead, no matter how many wacky parameters you can come up with.
Useful x 4 Winner x 1 Agree x 1 (list)

6. To clarify: before I was talking about uploading 1/8th as much data because in my situation objects are only translated on the X/Z plane, so I am sending a vector2.

7. No. You send one matrix (16 floats) that is constructed from the camera's position, rotation and perspective whenever any of the three change, which is at most once a frame.

Then, for each object, before you draw it you send a single vector with its position in the world.

In the shader, you just add this translation to each vertex's position before multiplying by the camera's matrix.

So for the scene you send 16 + 3n floats, and each vertex has one extra vertex addition, which for a complex shader is nothing compared to any other stuff going on.

This is assuming that all you need to worry about is objects moving, not rotating or scaling etc. In that case I would just resend the MVP matrix for each object.

Why what I am doing so terrible?
Uhm, you know those few matrices are nothing compared to the 8 GB/s bandwidth of PCI Express 2.0, right?
Agree x 2 (list)

8. Uhm, you know those few matrices are nothing compared to the 8 GB/s bandwidth of PCI Express 2.0, right?
You know those few vector additions are nothing compared to the two 4x4 matrix multiplications you have to do on your CPU (not GPU) to construct a new MVP matrix for each object right?

That's 96 additions and 128 multiplications in total if I recall correctly.
Agree x 1 (list)

9. Uhm, you know those few matrices are nothing compared to the 8 GB/s bandwidth of PCI Express 2.0, right?
8GB/s divided by 60 frames..

10. 8GB/s divided by 60 frames..
136mb/frame.

If you think sending a few floats instead of a single matrix for world positioning, imagine GPU skinning - Each frame, for each animated model, for each bone in the model, you upload a matrix. The GPU then multiplies this FOUR times per VERTEX (depending on the number of weights).

11. 8GB/s divided by 60 frames..
Yes, you only have a budget of 0.137 gigabytes per frame. I dunno how you'll ever fit everything you need in there.
Late x 1 (list)

12. Point is, for objects with a small vertex count it's going to be orders of magnitude faster.

13. Point is, for objects with a small vertex count it's going to be orders of magnitude faster.
Yes, but the speed difference there is negligible. There is no reason whatsoever to optimise this unless you're developing for an embedded platform.
Dumb x 3 (list)

14. Orders of magnitude faster in a situation where it doesn't even matter at all.

Like you can send just X/Y to an object if you're just moving it in the X/Y plane, that's perfectly fine, but performance is a moot point in this situation. Do whatever is easiest for you to work with.
Agree x 1 (list)

15. If there is barely a performance difference then why call me out on doing it. That is my whole gripe.

Edited:

I sincerely hope that this was a crude attempt at comedy. At least I laughed.
That's an odd way of saying "That could be negligibly slower in some situations, and negligibly faster in others"
Dumb x 1 (list)

16. Made a portfolio prototype with Löve

(It's better in motion)

Then ported it to html5 canvas (let's not start a discussion here; I picked canvas at random to be honest)
http://guegan.de/
Needs lotsa optimizing.
man i bet that looks great with javascript disabled, too
Zing x 2 Dumb x 2 Useful x 1 (list)

17. man i bet that looks great with javascript disabled, too
Doesn't look like anything tbh, it just doesn't show up.
Programming King x 1 Dumb x 1 (list)

18. Programming competition?
Agree x 4 Disagree x 1 (list)

19. I made an ulam spiral in Löve

here it is with 100000 numbers(9592 primes):

Winner x 2 Artistic x 1 (list)

20. Programming competition?
Yes, (I would have voted agree but any time I click on any of the ratings it just sends me to the home page)
Dumb x 5 Informative x 1 (list)

21. We should do an application programming competition for a change.

I.E. make the best media player, file manager, etc.

Edited:

Yes, (I would have voted agree but any time I click on any of the ratings it just sends me to the home page)
enable javascript
Agree x 9 Zing x 2 (list)

22. Disabling javascript is so 2005.
Agree x 15 (list)

23. I.E. make the best media player
I vote for this.
Agree x 2 (list)

24. We should do an application programming competition for a change.

I.E. make the best media player, file manager, etc.

Edited:

enable javascript
This is a good idea, but instead of doing a media player or file manager instead do an application that people could actually end up using, I can't imagine someone using a media player written here over any of the current best ones (maybe I am being cynical). Instead do something like a podcast manager/player or something else were everything out there at the moment is lacking in some big way.

edit: But seriously I just want someone to make a good standalone podcast manager/player that saves my location when I stop listening half way through a podcast.
Agree x 3 (list)

25. Doesn't look like anything tbh, it just doesn't show up.
I apologize my sarcasm wasn't accurately portrayed by way of a typical Facepunch-styled snarky comment with all of the trimmings: lack of capital letters, ignoring punctuation, and brevity.

My point is that it's a bad approach, and evokes the taste of a slightly more modern and compliant rendition to that of a Flash production.
Agree x 2 (list)

26. I apologize my sarcasm wasn't accurately portrayed by way of a typical Facepunch-styled snarky comment with all of the trimmings: lack of capital letters, ignoring punctuation, and brevity.

My point is that it's a bad approach, and evokes the taste of a slightly more modern and compliant rendition to that of a Flash production.
Here's why you're wrong.

Javascript works on basically every platform other than extremely old cellphones, and works like a 'native' page. On Android for instance flash feels shoddy for ANYTHING but watching videos, but Javascript works mostly as it's supposed to.

Javascript is a lot less hoggy, slow, and generally shitty than flash. Again, it feels like a 'native' page.

Javascript is standardized.

Need I go on really?
Disagree x 2 Agree x 1 (list)

27. Here's why you're wrong.

Javascript works on basically every platform other than extremely old cellphones, and works like a 'native' page. On Android for instance flash feels shoddy for ANYTHING but watching videos, but Javascript works mostly as it's supposed to.
If by "works mostly as it's supposed to" you mean "is as slow as the rest of the browser" then I agree.
disclaimer: I have a 600mhz armv6 Android phone, it's not a rocket.

He should really try and use as much CSS3 as possible for pages, since CSS works even if javascript is disabled.
Agree x 2 (list)

28. Here's why you're wrong.

Javascript works on basically every platform other than extremely old cellphones, and works like a 'native' page. On Android for instance flash feels shoddy for ANYTHING but watching videos, but Javascript works mostly as it's supposed to.

Javascript is a lot less hoggy, slow, and generally shitty than flash. Again, it feels like a 'native' page.

Javascript is standardized.

Need I go on really?
You can't be wrong about opinions. However, my standpoint is backed by the fact that a site which relies on JavaScript for things like transitional aesthetics is still much more functional than a site which relies entirely on JavaScript and completely ignores the idea of unobtrusive JavaScript, and takes gracefulness out of graceful degradation.

This type of conversion is appropriate for games. For portfolios, it's rather unnecessary and keeps robots of various types from knowing what is actually on your site.

JavaScript isn't all of web development. You're implying having it take full precedence is on-par with everything else standardized on the web for their respective appropriate reasons, like semantic objectives, performance concerns, or to alleviate any general cross-browser differences.

Images are also a standard part of the HTML spec, it doesn't mean people go around making their entire site a giant image with image mapping.
Agree x 1 (list)

29. disclaimer: I have a 600mhz armv6 Android phone, it's not a rocket
FYI rockets usually use slow rad-hardened processors. Think 100-200MHz tops (ARM equivalent). Space Shuttle CPU was running at an equivalent of 1MHz. Didn't stop the shuttle from being actually useful.
Funny x 11 Agree x 5 Informative x 2 Zing x 1 (list)

30. FYI rockets usually use slow rad-hardened processors. Think 100-200MHz tops (ARM equivalent). Space Shuttle CPU was running at an equivalent of 1MHz. Didn't stop the shuttle from being actually useful.
luckily nasa wasn't using js at the time
Funny x 31 Zing x 1 (list)

31. Javascript is a lot less hoggy, slow, and generally shitty than flash. Again, it feels like a 'native' page.
Actually, if you use it right, Flash is speedy.

Example: Flash's Molehill API vs WebGL
Agree x 2 (list)

32. Decided to try my hand at writing a small kernel again, here what I got after working on it for 2-3 days. Write now all it can do is load the GDT/IDT, enable software / hardware interrupts, and open/use a ram disk with a basic file system I wrote for it. Was in a rush to test it out with real hardware though, so I forgot to put the disk on the USB with the kernel. Here's what I have so far.

By the way, would anyone else who has written a kernel give me some points on writing a keyboard driver? I tried it and I got as far as the 8042 controller sending back a "success byte" but after that non of the PS/2 keyboards answer back.
Programming King x 2 (list)

33. If by "works mostly as it's supposed to" you mean "is as slow as the rest of the browser" then I agree.
disclaimer: I have a 600mhz armv6 Android phone, it's not a rocket.

He should really try and use as much CSS3 as possible for pages, since CSS works even if javascript is disabled.
Most Javascript works fine on my SGSII, but that is a fairly high-end phone.
Disagree x 1 (list)

34. If there is barely a performance difference then why call me out on doing it. That is my whole gripe.

Edited:

That's an odd way of saying "That could be negligibly slower in some situations, and negligibly faster in others"
Sorry, I know the argument is over but if you send the vector to the GPU which then has to construct a matrix from it, wouldn't that happen every frame FOR EVERY VERTEX?

Or are you not using matrices for translation at all?

35. So. Podcast manager programming competition. Someone make it.

I would but as you all know I'm not very good at organizing.

36. For portfolios, it's rather unnecessary and keeps robots of various types from knowing what is actually on your site.
Isn't that what meta tags are for, telling robots and search engines what a page is for and providing alternative pages under special circumstances? Flash would also entirely disable robots from collecting such data.

Luckily Flash is fast becoming obsolete thanks to HTML5 and Javascript. With modern browsers, there is no reason to disable javascript nowadays.
Agree x 2 Disagree x 1 (list)

37. Decided to try my hand at writing a small kernel again, here what I got after working on it for 2-3 days. Write now all it can do is load the GDT/IDT, enable software / hardware interrupts, and open/use a ram disk with a basic file system I wrote for it. Was in a rush to test it out with real hardware though, so I forgot to put the disk on the USB with the kernel. Here's what I have so far.

By the way, would anyone else who has written a kernel give me some points on writing a keyboard driver? I tried it and I got as far as the 8042 controller sending back a "success byte" but after that non of the PS/2 keyboards answer back.
you'll want to remap the IRQs away from their usual interrupts because the processor uses the low interrupts for exceptions. Here's the code I always use:

```static void remap_irqs()
{
// remap IRQ table
outb(0x20, 0x11);
outb(0xA0, 0x11);
outb(0x21, 0x20);
outb(0xA1, 0x28);
outb(0x21, 0x04);
outb(0xA1, 0x02);
outb(0x21, 0x01);
outb(0xA1, 0x01);
outb(0x21, 0x0);
outb(0xA1, 0x0);
}
```

I have no idea how it works but basically it remaps the IRQs so they start at interrupt 32 rather than interrupt 0.

You'll then want to attach a handler to interrupt 33 (since the keyboard uses IRQ 1, add 32 to get the interrupt number)

When the keyboard fires an IRQ, read a byte from port 0x60.

Remember to write 0x20 to port 0x20 when you're done servicing that IRQ
Friendly x 1 (list)

38. Isn't that what meta tags are for, telling robots and search engines what a page is for and providing alternative pages under special circumstances? Flash would also entirely disable robots from collecting such data.

Luckily Flash is fast becoming obsolete thanks to HTML5 and Javascript. With modern browsers, there is no reason to disable javascript nowadays.
There's also no reason to ignore good practice in web design. What you're both proposing is contradictory to what people would consider forward movement in solidifying web standards; it's not just a set of standards, it's a means of practicing techniques that utilize these new technologies in their intended ways.

For example, we don't have standards created and utilized to allow people to design better intro pages, because competent developers don't create flash-driven intro pages from the 90's anymore. Because metatags exist doesn't mean you should bastardize their usage; you don't see widespread usage of "View Canvas Site" & "View HTML Site" nowadays, and that's not something designers want either.

Edited:

This is too much of a webdev discussion, let's move it there.

39. enable javascript
It is, it just started happening randomly 2-3 days ago, anything rating related stopped working
Dumb x 2 Disagree x 1 (list)

40. It is, it just started happening randomly 2-3 days ago, anything rating related stopped working
This is true, I don't know why it happens, but it's a little rare and only seems to occur shortly after or around downtime for FP; I don't think he's pulling your leg. Could be cache related.
Agree x 1 (list)