6 ms·
rlsw – Raylib software OpenGL renderer in less than 5k LOC
- mouse_ 1y agoThis will be perfect for Nintendo 3DS!
- JoeyJoJoJr 1y agoInteresting. Does this mean it could be used for creating games for NES, SNES, Genesis, etc?
- enricotrudu 1y agoNo, no, no, it depends.
- nnevatie 1y ago*OpenGL-style.
- Pannoniae 1y agoCongrats for only reading the header ;) It's actually a pretty decent OpenGL 1.1 software implementation, obviously not complete and spec-correct though. It's more like those MiniGL drivers back in the day, implementing just enough of the spec so the game can run ;) In a similar way, this implements just enough so Raylib's OpenGL backend can run! It was done so you can use the library without external graphics dependencies if you really want to.
- furyofantares 1y agoThat's an extremely snarky reply given the post is just a direct link to the header.
- Pannoniae 1y agoNo, the doc-header of the header! Apologies if I wasn't clear. I just thought the GP zoomed in on the word "-style" in the first line without reading more (it's probably since it's not a full 1.1 implementation, just something which can do enough to shim a good chunk of 1.1 functions so the RL GL1.1 backend can run)
- furyofantares 1y agoStill, 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!
- kragen 1y agoThis 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.
- mkl 1y agoOnly if it's brand new. Otherwise some people on HN are probably already familiar with it.
- kragen 1y agoYes, that's arguably somewhat true of items like these: Go Subtleties You May Not Know (harrisoncramer.me) 66 points by darccio 5 hours ago | flag | hide | 28 comments Evaluating Argon2 Adoption and Effectiveness in Real-World Software (arxiv.org) 14 points by pregnenolone 3 hours ago | flag | hide | 1 comment The Gypsy Life of Robert Louis Stevenson (hudsonreview.com) 37 points by Caiero 5 hours ago | flag | hide | 5 comments That is, you might already be familiar with Robert Louis Stevenson's life story, Argon2, or the subtleties of Golang. Even if so, though, you probably won't be familiar with the book review in the current issue of the Hudson Review (of a book that came out last month), Cramer's particular take on those subtleties (which he posted two weeks ago), or even the Argon2 evaluation in the paper (which was posted in April). I would argue that people posting comments in these threads consisting of only their pre-existing general knowledge of Stevenson and Argon2 are still failing to make substantial contributions to the conversation, because they will tend to repeat pre-existing errors whose correction is the largest contribution of the linked writings, or simply repost the predictable opinions they share with many other people. It's the opposite of the spirit of curious inquiry the site ostensibly seeks to foster. And the majority of frontpage posts are about things that are in fact brand new: Greenland Ditches Starlink for French Satellite Service (dagens.com) 323 points by saubeidl 4 hours ago | flag | hide | 189 comments (news reporting from two days ago) Knocker, a knock based access control system for your homelab (github.com/fariszr) 21 points by xlmnxp 2 hours ago | flag | hide | 29 comments (new software project last month) Evaluating the Infinity Cache in AMD Strix Halo (chipsandcheese.com) 90 points by zdw 6 hours ago | flag | hide | 33 comments (news reporting from today on performance evaluations using an ASUS sample motherboard not available to the general public) Show HN: Cadence – A Guitar Theory App (cadenceguitar.com) 55 points by apizon 5 hours ago | flag | hide | 8 comments ("Hello HN, I just released this music theory and ear training mobile app" a few weeks ago, with a trademarked name that will certainly have to be changed after a cease & desist) MinIO (apparently) becomes source-only (github.com/minio) 144 points by LexSiga 5 hours ago | flag | hide | 107 comments (a new release process change in this project from four days ago) rlsw – Raylib software OpenGL renderer in less than 5k LOC (github.com/raysan5) 204 points by fschuett 14 hours ago | unvote | flag | hide | 69 comments (a new software renderer committed on September 29) LLMs can get "brain rot" (llm-brain-rot.github.io) 395 points by tamnd 20 hours ago | flag | hide | 245 comments (a new paper published one week ago) There is nothing substantial that anyone could say about any of these things without reading the article or bug thread or trying the software.
- deleted 1y ago[deleted]
- ciroduran 1y agoRaylib'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 https://x.com/raysan5/status/1980322289527976202
- smlacy 1y agobut ... why?
- foota 1y agoAs someone who was once a child trying to figure out how to compile and link things to use SDL, I think there's some educational value in letting people make games without having to dive deep into how to use C++ toolchains.
- SJC_Hacker 1y agoIf you want to do that, skip C++ entirely and just use Javascript or Python. You can get shiny things really quickly.
- irilesscent 1y agoI think there's still value in learning the C++ language and making a game or a demo is quite rewarding although raylib does have bindings for basically every conceivable language.
- pjmlp 1y agoAgreed, especially since it is the main language in the games industry, however that doesn't mean it should be the very first experience.
- HelloNurse 1y agoI'd make the opposite argument about educational value. If you learn to compile libraries and programs you have, so to speak, passed an exam: you are ready to "make games" with confidence because you know what you are doing well enough to have no fear of tool complications. What should be minimized is the accidental complication of compiling libraries and programs, for example convoluted build systems and C++ modules.
- Archit3ch 1y ago> OpenGL 1.1-style implementation on software How many lines to implement OpenGL 2.0 (non ES) ?
- Pannoniae 1y agoAn order of magnitude more ;) You need to implement user-programmable shaders, both ARB assembly and GLSL. That needs a GLSL parser, a shader interpreter (talking about compiling it to machine code would add another magnitude of complexity). You also need to implement multitexturing (probably the easy part) but also all the texture combiner stuff too. This one is not hard but also a good chunk of code... All in all, at least 40K if you ask me, but that's a very lowball estimate. Of course if you don't care about implementing the full spec, you can get away with a lot less.
- 0x0203 1y agoNot sure what the line count is, but PortableGL is a software renderer for 3.x(ish): https://github.com/rswinkle/PortableGL https://github.com/rswinkle/PortableGL Cool project, and fun to play with.
- rswinkle 1y agoIt currently clocks it at 12.5K but that includes stuff that could easily be stripped out. I suspect, even if I had it "finished" with everything I would ever want in it, it wouldn't be more than 15-20k. PGL saves a lot by not bothering with GLSL at all. Glad you found it fun to play with, that's what it's for. Hoping to have a new release in the next week or so, and there have been some serious/breaking changes since the last so hopefully it goes well. And on the topic of this thread, PGL is overkill for raylib's software rendering backend since they don't need arbitrary shader support, but I would still love to try making PGL a raylib backend someday because it would be cool and running the entire set of Raylib examples would be a great stress test. Plus then I could use raylib to make a game with PGL, win-win.
- eska 1y agoI implemented the OpenGL API for fixed function hardware once, and chose the cut off at 1.5 with some extensions like framebuffer objects. 1.x has a lot of cruft that nobody should use, but is still easy to implement. 2.x has a lot of stuff like shaders that are a lot more work to implement in software.
- bsder 1y agoFabrice Bellard also wrote an OpenGL thing: https://bellard.org/TinyGL/ https://bellard.org/TinyGL/
- bigfishrunning 1y agoWhat an aspirational figure, that guy does it all!
- WanderPanda 1y agoAmazing: (Mar 5 2022) TinyGL 0.4.1 is out (Changelog) (Mar 17 2002) TinyGL 0.4 is out (Changelog) "our plans are measured in centuries"
- ricardobeat 1y agoAnd first written in 1997.
- momocowcow 1y agoI saw a few of these things in the 90s and they definetly were not cool. They were slow, clunky or produced artifacts. You needed close integration between the game and renderer for perf. Funny how history turns out.
- throwaway2046 1y agoSee also the fork by C-Chads: https://github.com/C-Chads/tinygl https://github.com/C-Chads/tinygl It seems to have more features and limited support for multithreading, with more recent updates compared to the original project. Sadly it was archived in late 2023.
- brcmthrowaway 1y agoDoes this support CUDA?
- Pannoniae 1y agoNo, this is CPU rendering only! Not even SIMD, just straightforward integer (and float) code.
- brcmthrowaway 1y agoNow make it fixed point
- avadodin 1y agoFixed point would be hell trying to keep track of the ranges. Maybe Posits or LNSs.
- mvx64 1y agoShout 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 https://kingscrook.itch.io/kings-crook
- lmp88959 1y agoHey that's my project! Thanks for the shout out c:
- SJC_Hacker 1y agoIf its OpenGL why is it CPU only ?
- bitwize 1y agoOpenGL is an API. Software renderers for it—like the one that originally came with Windows NT, or even early versions of Mesa—have been out for a long time.
- pbohun 1y agoWhat'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.
- YesBox 1y agoEdit: 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 in the gl.h file that allows addition fields to be passed to the GPU). I’m using SFML for the graphics framework which I think is OpenGL 1.x Game to show what’s possible: https://store.steampowered.com/app/2287430/Metropolis_1998/ https://store.steampowered.com/app/2287430/Metropolis_1998/
- dandersch 1y ago> 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?
- YesBox 1y agoIt's what SFML uses. Im unable to create my own framework for the time being. Im not using immediate-mode
- MrGilbert 1y agoSidenote: Can't wait for the release!
- YesBox 1y ago:) Thanks
- klaussilveira 1y ago
- az09mugen 1y agoCurious to hear the take Tsoding has on that news.
- JoeDohn 1y agohe gonna drop it, since it's a main stream thing now and it did hit hn :D.
- deleted 1y ago[deleted]
- atan2 1y agoi'm so happy i could understand most of the code. props to pikuma.com for showing us the beauty of software renderers!