Live data from Hacker News

rlsw – Raylib software OpenGL renderer in less than 5k LOC

github.com

81–90 of 100 posts

Re: rlsw – Raylib software OpenGL renderer in less than 5k LOC

#81
post #29

Earlier quoted context omitted.

Edit: I missed this was software rendered. I’m one gen-iteration ahead. Prob would still be possible to render my game cpu side provided I use the most efficient sprite depth ordering algorithm possible (my game is isometric pixel art like rollercoaster tycoon) Ha! That’s what I’m stuck with for Metropolis 1998. I have to use the ancient OpenGL fixed function pipeline (thankfully I discovered an AB extension function…

> I have to use the ancient OpenGL fixed function pipeline Why do you have to and do you also use parts of the old immediate-mode API?

It's what SFML uses. Im unable to create my own framework for the time being. Im not using immediate-mode

Re: rlsw – Raylib software OpenGL renderer in less than 5k LOC

#82
post #38

Earlier quoted context omitted.

The mantra for the library is "raylib is a simple and easy-to-use library to enjoy videogames programming." It's for hobbyist, learners, tinkerers, or just those that want to enjoy minimalistic graphics programming without having to deal with interfacing with modern machines yourself. The default Windows installer bundles the compiler and a text editor to make poking at C to get graphics on the screen (accelerated or…

I never ever bothered to compile SDL/SFML from source, what is so hard dumping the binaries into a folder, set the include paths for the compiler and linker? Although I may imagine newbies may face some challenges dealing with compiler flags.

Not much to a developer. To a novice (potentially very young) user there's confusion why there are 3 versions for e.g. Windows, which to pick from and why, how to set the compiler/linker flags for the build tuple, and then confusion about how to make it work on the alternative targets for their friends (e.g. the web target or the Linux ARM Pi target for class) and why that has to be different steps. None of that is particularly complicated once you go through it all, but it is a bit of a barrier to the "see something on the screen" magic happening to drive interest. Instead, raylib is just a header file include, like a text based "hello world", regardless of platform - even if you don't want to use the pre-made bundle.

Or, more simply, it makes the process "easy as a scripting language" rather than "pretty easy".

Re: rlsw – Raylib software OpenGL renderer in less than 5k LOC

#83
post #71

Earlier quoted context omitted.

Still, if you post a link to a roughly 5k line raw source file, rather than like, some post about it, roughly nobody is gonna read much of the file before commenting. edit: I stand corrected by the downmods!

This is kind of a systemic problem with HN: all the early comments on anything substantial are necessarily themselves insubstantial because the posters have not had time to read it.

I know. I hold myself to a rule that I never comment if I didn't read the article.

I made an exception with this, because the "article" is simply a 5kloc header file. I only read some of it.

I don't have a problem with the submission but I don't know why you would expect someone to read enough of the header to realize that the opening line in the header saying "OpenGL 1.1-style" is underselling it and it's actually a "pretty decent OpenGL 1.1 software implementation".

Re: rlsw – Raylib software OpenGL renderer in less than 5k LOC

#84
post #29
post #28

What's cool about this is that computers are so fast that you could probably make a decent 2D game using only this software-rendered OpenGL 1.1 library.

Edit: I missed this was software rendered. I’m one gen-iteration ahead. Prob would still be possible to render my game cpu side provided I use the most efficient sprite depth ordering algorithm possible (my game is isometric pixel art like rollercoaster tycoon) Ha! That’s what I’m stuck with for Metropolis 1998. I have to use the ancient OpenGL fixed function pipeline (thankfully I discovered an AB extension function…

Oh, man! This is really cool. Do you maintain a blog or a patreon that allows people to follow the progress on the project?

Any way I can buy you a beer?

Re: rlsw – Raylib software OpenGL renderer in less than 5k LOC

#85
post #70

Earlier quoted context omitted.

Now make it fixed point

Shout out to King's Crook [1], a cool project using a custom C software renderer only using integers [1] https://kingscrook.itch.io/kings-crook

Hey that's my project! Thanks for the shout out c:

Re: rlsw – Raylib software OpenGL renderer in less than 5k LOC

#86
post #16

Raylib's author was very happy to announce that you can compile an entire raylib program with no dependencies other than, say, being a win32 app https://x.com/raysan5/status/1980322289527976202

but ... why?

As someone working on a game engine with a multithreaded SSE/NEON implementation of ~GL 1.3 under the hood, this is rad for many reasons other than portability or compatibility. You get full access to every pixel and vertex on the screen at any point in the rendering pipeline. This allows for any number of cool (also likely multithreaded) postprocessing effects that you don't have to shoehorn through a brittle, possibly single-platform shading language and API.

Re: rlsw – Raylib software OpenGL renderer in less than 5k LOC

#87

Earlier quoted context omitted.

Because GPU APIs are a nightmare clustertruck.

1000x less performance is a bigger clusterfuck

It's slower indeed, but it's easier to write and debug, more portable, and gives you total control over the render pipeline. It's good for experimentation and learning, and would still be trivial to compile and run 20 or 50 years from now. And with how obscenely fast modern CPUs are, it might even be fast-enough for a simple 3D game.

Re: rlsw – Raylib software OpenGL renderer in less than 5k LOC

#88
post #71

Earlier quoted context omitted.

This is kind of a systemic problem with HN: all the early comments on anything substantial are necessarily themselves insubstantial because the posters have not had time to read it.

I know. I hold myself to a rule that I never comment if I didn't read the article. I made an exception with this, because the "article" is simply a 5kloc header file. I only read some of it. I don't have a problem with the submission but I don't know why you would expect someone to read enough of the header to realize that the opening line in the header saying "OpenGL 1.1-style" is underselling it and it's actually a…

That's great, but structurally, the recency bias of HN tends to bury comments by people who follow rules like yours.

Re: rlsw – Raylib software OpenGL renderer in less than 5k LOC

#89
post #67
post #58

Earlier quoted context omitted.

We had software rendered unreal tournament decades ago. Full 3d. It runs like a champ in 2023: https://youtu.be/MGZQAH5J1OQ

Imagine what it could do with modern SIMD and many cores. Won't come close to dGPU, but still...

Currently attempting to do that with original q1: https://github.com/klaussilveira/exp-quake/commit/c9b7cab515...

Re: rlsw – Raylib software OpenGL renderer in less than 5k LOC

#90
post #29

Earlier quoted context omitted.

Edit: I missed this was software rendered. I’m one gen-iteration ahead. Prob would still be possible to render my game cpu side provided I use the most efficient sprite depth ordering algorithm possible (my game is isometric pixel art like rollercoaster tycoon) Ha! That’s what I’m stuck with for Metropolis 1998. I have to use the ancient OpenGL fixed function pipeline (thankfully I discovered an AB extension function…

Oh, man! This is really cool. Do you maintain a blog or a patreon that allows people to follow the progress on the project? Any way I can buy you a beer?

Thanks! No blog or patreon. I use twitter, bluesky, and reddit to post updates [0]

It is possible to "pay what you'd like" on itch though :) [1]

The demo up there is in pre-alpha, but I push out a big update every 4-6 months.

[0] https://linktr.ee/yesboxstudios

[1] https://yesbox.itch.io/metropolis1998

Post reply on HN