Nuklear icon indicating copy to clipboard operation
Nuklear copied to clipboard

Backend: Renderer

Open dumblob opened this issue 4 years ago • 8 comments

Anyone here using https://github.com/zauonlok/renderer ? Do you think such backend would make sense for Nuklear?

dumblob avatar Mar 09 '20 09:03 dumblob

SDL2 software renderer probably makes more sense as more people are using it, and it works everywhere, but this one is impressive as a software renderer

saidm00 avatar Apr 10 '20 04:04 saidm00

I had a pull request on a non-OpenGL SDL2 backend on the old repo. I've been meaning to resubmit it after the string API change and after getting my other one in. It's just a conversion of the old SDL1.2 backend that was removed. It requires SDL2-gfx as well and uses that library's built in 8x8 pixel ASCII only font. Long term I'd want to remove that limitation.

"Software rendering" is kind of ambiguous these days. Most people use it to mean 3D rendering done on the CPU like that project. However we're also referring to an SDL2 "software renderer" when even using plain SDL2 (whether the end result is 2D or 3D) the default renderers are "accelerated" which unless I'm very much mistaken usually means using the GPU; just not its 3D capabilities.

Nuklear doesn't actually use/take advantage of any 3D features right? Otherwise it wouldn't look the same on the non-3D API backends. So while that project is an impressive achievement, I don't really see the benefit to Nuklear. I can't actually think of a use-case for a different 3D backend. Putting aside the fact that pretty much anything you can possibly run 3D graphics on has some kind of GPU with OpenGL support on it already, you could always just use the software renderer(s) in Mesa3D with the OpenGL backends if you wanted/had to.

rswinkle avatar Apr 20 '20 08:04 rswinkle

Hm, my idea was quite different - someone wants to (for whatever reason) use the linked 3D renderer might also want some UI. If Nuklear had an existing backend, it'd make things a bit easier to start with :wink:. That's why I also asked if anybody is using that 3D renderer and whether it would make sense.

dumblob avatar Apr 20 '20 09:04 dumblob

Hmm. Couldn't they already use the x11 backend with that project since it also uses x11 for Linux? And maybe that would work for GDI and windows too (I don't know windows API's but I associate GDI with win32/HWND type code which I see in their windows platform; maybe they're not exactly the same).

Wouldn't it be about as complicated as using OpenGL based Nuklear in an app that was also doing OpenGL 3D rendering? Other than worrying about not preserving/restoring conflicting state between UI and your graphics code, it works.

rswinkle avatar Apr 20 '20 18:04 rswinkle

@rswinkle That makes sense to me, or you could use OpenGL to render the CPU drawn frames and UI overlayed on top. I do see the advantage of doing an SDL2 software renderer though, GDI and x11 obviously aren't portable and that's an issue for those who want to keep their project 100% using CPU.

saidm00 avatar Apr 27 '20 07:04 saidm00

I actually at some point even wanted it myself, but I got discouraged, I wanted to write a software ray tracer, and have a UI for it, and I was gonna write a Nuklear renderer in SDL2, but never really got the time or drive to do it.

saidm00 avatar Apr 27 '20 07:04 saidm00

Thanks for the comments. I'll leave this open for some time yet to allow some more discussion (and new contributors), but currently it seems to me as we shouldn't push this idea much.

dumblob avatar Apr 27 '20 08:04 dumblob

Feel free to experiment with creating a backend for Renderer. Looks like a really cool platform!

RobLoach avatar Dec 22 '21 18:12 RobLoach