-
Notifications
You must be signed in to change notification settings - Fork 3
The simplest low-level CPU rasterization library #18
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
base: master
Are you sure you want to change the base?
Conversation
|
|
Splines should be mentioned. I don't think that these more complex lines can be flattened out without causing problems (cpu usage / lines instead of pixels) outside the pipeline. Also draw pixel too. One thing to note is that the plot function is meant to be hidden from the user. If its on the cpu you would probably give it a an ImageBuffer, if its on GPU you may expect it to return a texture id or something as far as my understanding is concerned. |
If we put splines there, we'll need to consider caps, joins, dashes, basically put the entire stroke renderer. Maybe it should be done, if an external impl outputs too many trapezoids. Pixel drawing is literally the plot function. Plot function is chosen by someone who knows the format of the surface and the brush type (gradient, pattern, etc.). |
Can we stop making claims that drawing graphics is not for the GPU? If you're mixing CPU and GPU rendering in runtime code, you'll absolutely tank mobile performance right now. Any code where the CPU is pushing pixels is not future-proof. CPU rendering should only be considered as one thing: a reference implementation. Rendering on hardware without GPU will likely require a specialised implementation of any API anyway. (You can probably see where my comments are going to go in the future on this topic...) |
As for a comment on the API, if this is going to be in D then it should be far more towards current D idioms. ie: Line( BeginPoint, EndPoint ).Plot!Basic; |
I'm saying that this particular lib renders on CPU, that's it.
I am not, this code is only for CPU backend.
And as a fallback, when no GPU is available.
My idea is that you pass some geometry to a function, and it invokes a callback. Caller should set pixels in this callback in a way he wants. Why do we need something over free functions in such low-level API? |
UPD: my implementation is here with some usage demo.