-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[core][texture][text][shapes] Software renderer for 2D #1370
Comments
For X11 I use For Win32 I use |
Id say it is an advantage not having any way of rendering it to the screen. If they want to display the image then they can bring there own method that fits the platform. |
I think this is a interesting idea. I agree with compiling raylib without requiring the gpu but I also feel some parts might be better made explicit instead. Here are a couple of examples:
|
I could not agree with this any less. People aren't going to want to stuff around trying to figure out how to get their output onto screen. There's no reason why you can't support both rendering to in-memory buffers and rendering to the screen, which is how it should be in my opinion, because it'll all use a common infrastructure under the hood anyway (I would think).
That's just a lazy implementation. raylib is a game development library, and people play games by looking at the screen. Almost everybody who uses raylib is going to want to display the output, and expecting them to just implement their own method to display the output is absolutely ridiculous. |
@mackron @Berni8k I think it depends on the kind of user that feature is intended to. Probably low-level embedded-devices coders would feel more confortable with just the pixels on memory, ready to be sent anywhere while the common raylib user (students, hobbyist, people that want to put something on screen quickly...) would prefer to just enable a software renderer and expect the same result as GPU-base rendering... what makes me think about a real use case... why a raylib user would enable the software rendering nowadays? In any case, both options are possible, the only difference is a @chrisdill About your questions:
|
waw a good fecer with the cpu textures |
Imho, if it still depends of OpenGL or a different API, which GLFW/SDL/X11 uses, it isnt really software rendering. |
@MikeHart66 as humble as your opinion is - its wrong, you can use these (image routines) without initialising a window (only then does it create a gl context) all the above (no gpu calls) can be used happily, there is no GLFW or X11 usage and it just works without the GPU - thankfully raylib as nothing to do with sdl..... no gpu image functions are super useful for tools you make to call from a makefile.... (where you really don't need the gpu involved!) and you might need to exactly these conversions functions not requiring the GPU are clearly marked in raylib.h // comment above a group of functions... |
Re @raysan5 Understandable. Tho what is the purpose of this no GPU mode then? Every modern PC/Mac/Android/iOS platform has support for OpenGL so what would be the motivation for someone to not use it? It does remove the dependency on OpenGL, but at the same time introduces a dependency on to some other platform specific API to create a window and pull inputs. The only thing i can see this being useful for is getting raylib to run on an old Win 98 machine that does not have proper hardware accelerated graphics support. Or perhaps raylib for MS-DOS with bitmap VGA graphics? |
I've already given one really good reason above! You can leverage
raylibs no GPU functions without the need of initialising a window
very useful for custom tools in your build processes...
…On 09/09/2020, Berni8k ***@***.***> wrote:
Re @raysan5 Understandable. Tho what is the purpose of this no GPU mode
then? Every modern PC/Mac/Android/iOS platform has support for OpenGL so
what would be the motivation for someone to not use it?
It does remove the dependency on OpenGL, but at the same time introduces a
dependency on to some other platform specific API to create a window and
pull inputs. The only thing i can see this being useful for is getting
raylib to run on an old Win 98 machine that does not have proper hardware
accelerated graphics support. Or perhaps raylib for MS-DOS with bitmap VGA
graphics?
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#1370 (comment)
--
blog bedroomcoders.co.uk <http://bedroomcoders.co.uk>
Disclaimer:
By sending an email to ANY of my addresses you are agreeing that:
1. I am by definition, "the intended recipient"
2. All information in the email is mine to do with as I see fit and
make such financial profit, political mileage, or good joke as it
lends itself to. In particular, I may quote it where I please.
3. I may take the contents as representing the views of your company.
4. This overrides any disclaimer or statement of confidentiality
that may be included on your message.
|
Would TinyGL be an option around this? It would keep the same GL calls, but render through the software-implementation subset of OpenGL. I haven't tested using GLFW with TinyGL, however. With SDL, you can use |
I'm closing this feature for the moment, supporting a software-renderer does not seem feasible for the moment. Users requiring it, can use the |
raylib includes a set of
ImageDraw*()
functions that rely only on CPU memory (no GPU required). Those functions can be used to implement a basic 2d software rendered. Actually, those functions have been improved a lot in performance lately.Here there are some notes about how it can be implemented, still under consideration:
USE_SOFTWARE_RENDERER
-> Some modules are not required any more:rlgl.h
,models.h
,camera.h
Texture2D
(GPU) should fallback toImage
(CPU)core.c
,textures.c
,text.c
andshapes.c
Here some design details:
There is one big issue and actually the main stopper for this implementation: How to do the screen buffer display of our
Image
framebuffer?Every platform would require a custom mechanism to push a bunch of pixels to the screen. GLFW has a long-time open issue where some mechanism was proposed: glfw/glfw#589
Two main concerns: how to integrate this in raylib (in a simple non-intrusive way) and how useful is this feature. Some answers:
USE_SOFTWARE_RENDERER
to completely separate default functions from software based ones. Ontextures.c
,text.c
andshapes.c
seems feasible butcore.c
would require some careful tweaking and probably some functions reorganization or internal preprocessing.In any case, I opened the issue for reference and comments. Please, do not send a PR, it's still a feature under consideration.
The text was updated successfully, but these errors were encountered: