Skip to content
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

CPU Rendering is missing #118

Open
Diegovsky opened this issue Mar 20, 2023 · 8 comments
Open

CPU Rendering is missing #118

Diegovsky opened this issue Mar 20, 2023 · 8 comments

Comments

@Diegovsky
Copy link

I can't find any APIs for rendering using the CPU. Also, I can't find any API to render whatsoever.

I noitced you opened a pull request to include some abstruction for surfaces and stuff but it's missing on master. Is there any guide explaining how this crate is supposed to be used?

@Lokathor
Copy link
Owner

Do you mean you want to render on the CPU to a buffer within the CPU? For that you can just render into a vec of pixels and then put a quad on the screen using GL or VK. However, SDL doesn't really have anything that helps you do that.

I had considered adding code for SDL's built in "SDL Renderer" API, but didn't end up doing that in the current version. Since SDL is working on their 3.x series now, I decided to not really work on much SDL related stuff until that's out.

@Diegovsky
Copy link
Author

Yeah, I mean SDL Renderer (I think). Eagerly awaiting for sdl 3 then.

@Lokathor
Copy link
Owner

Lokathor commented Apr 3, 2023

I could probably get some of it working soon. Actually I finished up a release of imagine yesterday so this is good timing of you to ask.

@Diegovsky
Copy link
Author

That would be great. I don't like how the sdl crate does its abstractions.

@Lokathor
Copy link
Owner

Lokathor commented Apr 5, 2023

I started putting in some today. I got as far as being able to set the coloring of the rendering fns and thought to check with the SDL folks if the "set renderer color" value is supposed to be sRGB inputs or linear inputs. One person reported that the SDL renderer is only using sRGB, even during blending. Unfortunately, this means that their renderer will basically always produce wrong outputs any time a blend happens.

So I'm willing to fill in a few more of the essential functions and release it, but i would strongly suggest against using their blending support.

@Diegovsky
Copy link
Author

Diegovsky commented Apr 19, 2023

Wow, that sounds bad. I don't understand much about color blending but I know there are some quirks which can make colors show wrong

@Lokathor
Copy link
Owner

here's an article about it https://www.realtimerendering.com/blog/png-srgb-cutoutdecal-aa-problematic/

i got diverted from this lately but I'll try to remember to do a little more and get something out.

@Diegovsky
Copy link
Author

don't worry too much about it :)

For now, I'm using the sdl crate. I don't like its abstractions but it kind of works I guess. It's a side project so I haven't been able to work on it anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants