I may be interested, provided it works both on Mac and Windows, and both in 2D and 3D.
hi Claes,
window (ASUS i9) is slower than my old iMac and has the problem that the timer stops when you click / draw
and the display only takes place again when the mouse button is released
an old test on 3D example
https://www.dropbox.com/s/gxbs2s7in99kfi2/3D%20testwurfel2018API1.xojo_binary_project?dl=1
Hi Rudolf,
The file seems to miss a file called Malmann200 or something similar
I would be very interested! I need both a fast 2D canvas and the 3D model features, on Mac and Windows.
Just to help me clarify the 2D topic, is the general consensus that programmers are looking for a GPU-accelerated 2D control?
I am not familiar with Apples Metal coding, and code from Linux/Windows Vulkan does not seem to be the same for Apple’s Metal. Here is a discussion with programmers that discusses a little more about the similarities and differences between Metal and Vulkan: Programmers Discussion between Vulkan and Metal .
Some of the points that I can glean from the discussion are:
- Metal is a higher level language, Vulkan is a lower level language
- Valve tried to support Apple hardware, and Valve eventually pulled SteamVR support
- Many other discussions where MetalVK and Vulkan are not the same
It appears that Apple has their own GPU ecosystem (MetalVK), while the rest of the Operating Systems (Windows, Linux…etc) use Vulkan. It just means that GPU code for most Operating Systems seems to be Vulkan, and special code and porting is needed for the Apple ecosystem.
@Eugene_Dakin. You’ll want to take a look at this: GitHub - KhronosGroup/MoltenVK: MoltenVK is a Vulkan Portability implementation. It layers a subset of the high-performance, industry-standard Vulkan graphics and compute API over Apple's Metal graphics framework, enabling Vulkan applications to run on macOS, iOS and tvOS.
I have zero interest in 3D rendering. I just want the functionality of the regular Xojo canvas but GPU accelerated.
Is there a fb request for specifically this?
Apple has nothing todo with MetalVK.
The eternal problem, mediocre controls that dont attract “pro” users, not enought “pro” users to improve it…
But you will have to forget the other targets…
Maybe Vulkan is an overkill for Xojo… Some years ago, I did a Feature request for Xojo to use an external 2D Graphics Lib instead of having the xojo problem of less common compatibilities from OSes.
Cairo was free, multiplatform and it is suposed to have hardware acceleration, Xojo said NO but maybe could be an option for plug ins, this days are many other Cross-platform rendering library available
Or even something more aproachable than vulkan itself https://www.glfw.org/
The issue asking for a GPU-backed Canvas control is here:
When digging into cross-platform 3D drawing, it appears that Vulkan will be the way to go. Here are a few reasons that seem to agree with most 3D programmers (just opinions):
- OpenGL is still supported, and will be deprecated someday for Vulkan. I wouldn’t want to create a plugin for OpenGL just to find out that Vulkan is going to deprecate it.
- Vulkan is compatible with more Operating Systems. The 3D engine may be different on each Operating System, and the general method of programming graphics would be similar.
- Although Vulkan is harder to learn for the plugin-maker, there should be a relatively lower learning curve for Xojo users, especially if you have been using the OpenGL plugin. This would depend on how the Vulkan Plugin is setup.
- If a Xojo programmer has never 3D programmed, then I would recommend using the existing OpenGL control. This would help the Xojo programmer understand good principles and practices. Xojo, please don’t delete the OpenGL control
- Vulkan is popular in the gaming industry, and is not popular in non-game applications. From my experience, most businesses are still staying with OpenGL. It s a big deal to rewrite 15 years of OpenGL code just to say you switched to Vulkan.
- It is harder to find a Vulkan programmer than an OpenGL programmer.
- Vulkan is better suited for multi-threading programming, where OpenGL almost tolerates a small amount of multi-threaded use
- The only real alternative to Vulkan is DirectX 12 for Windows. MacOS uses MoltenVK as a Vulkan implementation overtop of Metal. My hope is that MacOS doesn’t change future support for MoltenVK and develop its own version.
- Ray tracing is the latest flavour of graphics programming to squeeze more performance out of graphics cards. OpenGL doesn’t support ray tracing, and Vulkan supports ray tracing.
- Since Xojo programs are generally single-core, Vulkan’s multi-core capability would have accelerated GPU rates that can’t be created by the CPU alone.
My opinion (thats all it is) in summary, Xojo should keep the OpenGL control for business and training purposes. The next graphic control would best be a Vulkan implementation, since it is cross platform, fast, the latest technology, and is being frequently updated.
Edit: Point 6 spelling mistake: Find, not Fund.
@Eugene_Dakin I think you got it your sum up is a good extraction of the actual situation…
For years my customers for my scientific application have requested I add a 3D graphing capability. I am finally doing that using OpenGL. My application is used by people on both Mac and Windows platforms and I have worked hard to keep the application symmetric on both platforms. The reason I started with Xojo more than 20 years ago is because it abstracts the platform, giving me this ability. Dropping OpenGL support would result in my having to scrap my 3D efforts. I am not a game developer, I use 3D for scientific graphics.
If I could have my dream implementation, it would be for a higher-level PHIGS library on both Mac and Windows, instead of OpenGL.
I’m not sure what methods, if any, are GPU accelerated as I’ve yet to see any inkling of GPU utilisation in Activity Monitor on my Mac. It would be nice if an engineer could weigh in on this.
Quartz under the hood uses GPU for some things and Graphics uses quartz.
Same with Direct2D on Windows. (Direct2D though is known to be very slow)
I think that is a bit of an understatement (-:
I actually got your OpenGL Book from XDevLibrary and it was great to get me going attempting to make a small app to help me design cuts on my CNC without having to fire a CAD app.
Using declares was quite painful because you need to wrap and convert so many things from C/C++, which are not fun things to do in Xojo. Working with frame buffers, object detection became a pain, at the point I gave up and started playing with XCode.
I would pay for an alternative drawing library, yet Vulkan API’s are (and to the same degree Metal/OpenGL) are quite low. A plugin would be awesome if it exposes the low level apis but would be quite more useful if it provided even higher abstractions and functionality like layers, zoom, object primitives a data structure similar to Object2D that you can retain and simplify mouse hit detection/modification, etc.
But I will suggest to look at other libraries that actually give you an abstraction to the underlying engine like @Ivan_Tellez suggests.
On the 2D side of the spectrum there are far more options, like Cairo and Skia. I played with Ski and was extremely easy to get started.