algorithmic modeling for Rhino
Testing correctness and performance of several GH2 classes.
12 different gradients (see bottom left for explanation) are mapped onto bitmaps in 7 different ways (see bottom right for explanation).
Gradients are drawn by directly manipulating the RGB channels of a bitmap in memory using all available processors simultaneously (each processor is assigned all pixels in a single column, then moves on to the next empty column when ready).
Performance ranges from 1~2 milliseconds for the simplest gradients to 10~15 ms for the expression based ones.
To elaborate, I'm very interested in pixel shaders as post-effects for owner drawn controls. If we end up using something like that it'll probbaly have to be implemented per platform, and they won't all look/behave the same.
That is not an option for components that draw to bitmaps, that has to work exactly the same on all platforms. We might in fact not be able to make even that much work; anti-aliasing and text rendering always use different algorithms on different platforms, so there's bound to be some discrepancies, but I'll aim to keep them as insignificant as possible.
This is all within the cross platform Eto drawing framework. It'll be possible (probably) to use specific Direct2D methods, but that kind of code will make the project behave differently on different platforms. That's something I wish to post-pone for as long as possible (hopefully forever).
© 2023 Created by Scott Davidson. Powered by
You need to be a member of Grasshopper to add comments!