Live data from Hacker News

Bunnymark GL in Jai – 200k sprites at 200fps [video]

youtube.com

11–20 of 70 posts

Re: Bunnymark GL in Jai – 200k sprites at 200fps [video]

#11
post #5
post #3

This by the looks of it is in Jonathan Blow’s Jai language. How are you finding working with it? Have you done a similar thing in C++ to compare the results and the process of writing it? 200k at 200fps on an 8700k with a 1070 seems like a lot of rabbits. Are there similar benchmarks to compare against in other languages?

it's a lot of fun! jai is my intro to systems programming. so i haven't tried this in C++ (actually i have tried a few times over the past few years but never successuflly). this is just a test of opengl, C++ should be the same exact performance considering my cpu usage is only 7% while gpu usage is 80%. but the process of writing it is infinitely better than C++, since i never got C++ to compile a hardware accelerat…

I thought Jai wasn't released yet. Are you a beta user or did he release it already?

Re: Bunnymark GL in Jai – 200k sprites at 200fps [video]

#12
I assume each sprite is moved on the CPU and the position data is passed to the GPU for rendering.

Curious how you are passing the data to the GPU - are you having a single dynamic vertex buffer that is uploaded each frame?

Is the vertex data a single position and the GPU is generating the quad from this?

Re: Bunnymark GL in Jai – 200k sprites at 200fps [video]

#13
Neat. Isn't this akin to 400k triangles on a GPU? So as long as you do instancing it doesn't seem too difficult (performance wise) in itself. Even if there are many sprites, texture mapping should solve for the taking pixels to the screen part.

My guess is that the rendering is not the hardest part, although it's kinda cool.

Re: Bunnymark GL in Jai – 200k sprites at 200fps [video]

#14
post #10
post #6

Nice demo! We need more of this approach. You really can achieve amazing stuff with just plain e.g. OpenGL optimized for your rendering needs. With todays GPU acceleration capabilities we could have town-building games with huge map resolutions and millions of entities. Instead its mostly only used to make fancy graphics. Actually I am currently trying to build something like that [1]. A big big world with hundreds o…

> We need more of this approach. 1000% agree. I recently took it upon myself to see just how far I can push modern hardware with some very tight constraints. I've been playing around with a 100% custom 3D rasterizer which purely operates on the CPU. For reasonable scenes ( single thread. On a 5950x, I was able to support over 10 clients simultaneously without any issues. The GPU in my workstation is just moving the f…

Just to be clear - you're writing a "software-based" 3D renderer, right? This is the sort of thing I excelled at back in the late 80s, early 90s, before the first 3D accelerators turned up around 1995 I think.

What features does your renderer support in terms of shading and texturing? Are you writing this all in a high-level language, e.g. C, or assembler? If assembler, what CPUs and features are you targeting?

And of course, why?

Re: Bunnymark GL in Jai – 200k sprites at 200fps [video]

#15
post #13

Neat. Isn't this akin to 400k triangles on a GPU? So as long as you do instancing it doesn't seem too difficult (performance wise) in itself. Even if there are many sprites, texture mapping should solve for the taking pixels to the screen part. My guess is that the rendering is not the hardest part, although it's kinda cool.

[deleted]

Re: Bunnymark GL in Jai – 200k sprites at 200fps [video]

#16
post #6

Nice demo! We need more of this approach. You really can achieve amazing stuff with just plain e.g. OpenGL optimized for your rendering needs. With todays GPU acceleration capabilities we could have town-building games with huge map resolutions and millions of entities. Instead its mostly only used to make fancy graphics. Actually I am currently trying to build something like that [1]. A big big world with hundreds o…

Is this not done because of technical limitations, or is it just not done because a town building game with millions of entities would not be fun/manageable for the player?

Although, there's a few space 4x games that try this "everything is simulated" kind of approach and succeed. Allowing AI control of everything the player doesn't want to manage themselves is one nice way of dealing with it. See: https://store.steampowered.com/app/261470/Distant_Worlds_Uni...

Re: Bunnymark GL in Jai – 200k sprites at 200fps [video]

#18
post #12

I assume each sprite is moved on the CPU and the position data is passed to the GPU for rendering. Curious how you are passing the data to the GPU - are you having a single dynamic vertex buffer that is uploaded each frame? Is the vertex data a single position and the GPU is generating the quad from this?

You can do it in SO many ways! You can have one vertex buffer or double buffer it, or you can run the entire simulation on the GPU too. In general, uploading data to the GPU can be the slowest part. OpenGL, and more modern Graphics APIs have evolved in the direction of minimizing the communication between CPU and GPU since it is almost always a big bottle neck. Modern GPUs are designed to manage themselves with work queues, local data and sometimes even local storage to avoid the need to interact with the CPU.

Re: Bunnymark GL in Jai – 200k sprites at 200fps [video]

#19
post #10

Earlier quoted context omitted.

> We need more of this approach. 1000% agree. I recently took it upon myself to see just how far I can push modern hardware with some very tight constraints. I've been playing around with a 100% custom 3D rasterizer which purely operates on the CPU. For reasonable scenes ( single thread. On a 5950x, I was able to support over 10 clients simultaneously without any issues. The GPU in my workstation is just moving the f…

Just to be clear - you're writing a "software-based" 3D renderer, right? This is the sort of thing I excelled at back in the late 80s, early 90s, before the first 3D accelerators turned up around 1995 I think. What features does your renderer support in terms of shading and texturing? Are you writing this all in a high-level language, e.g. C, or assembler? If assembler, what CPUs and features are you targeting? And o…

Unrelated but wrt. modern rendering versus 90s rendering I'd imagine that a lot of the performance shims used in the 90s might not apply because the critical problem is different.

Performance based development these days isn't so much on maximizing usage of the cycles of the machine (I mean, ok fundamentally it's still about that, but-), rather it's about getting the microcode to do the right thing. E.g. LUTs being extremely bad for caching performance. Branch predictions being a much more important predictor of performance than anything else. Huge rams make a lot of old tips around ram size usage invalid. SIMD / vector based operations and threading are a boon but require a very different way of working

Re: Bunnymark GL in Jai – 200k sprites at 200fps [video]

#20
post #13

Neat. Isn't this akin to 400k triangles on a GPU? So as long as you do instancing it doesn't seem too difficult (performance wise) in itself. Even if there are many sprites, texture mapping should solve for the taking pixels to the screen part. My guess is that the rendering is not the hardest part, although it's kinda cool.

> Isn't this akin to 400k triangles on a GPU?

Is it faster to render two triangles with slightly less area, or one triangle with slightly more area, to draw the same sprite?

Post reply on HN