BeRo1985 / pasvulkan

Vulkan header generator, OOP-style API wrapper, framework and prospective Vulkan-based game engine for Object Pascal
zlib License
191 stars 30 forks source link

rtx use example #32

Open tigrazone opened 11 months ago

tigrazone commented 11 months ago

I have 2 questions.

  1. did you can publish example with use of rtx raytracing?
  2. why you use sdl? thank you!
BeRo1985 commented 11 months ago

Thanks for asking about ray tracing capabilities in PasVulkan. I am still actively working on integrating this feature. It's a complex task that requires careful implementation to meet the performance and functionality standards I've set for PasVulkan.

And I appreciate your question on why SDL is utilized in specific contexts within PasVulkan. Allow me to outline the reasoning behind its selective integration based on the operating system:

The integration of SDL is highly contingent on the operating system:

  1. Linux: SDL is invaluable in this environment due to the complex and varied nature of the available APIs for different system functionalities, ranging from UI/visuals (X11, Wayland, Raw-Framebuffer) to audio (ALSA, OSS, JACK, PulseAudio, PipeWire, and so on) and input devices (jsapi, xinput, evdev, among others). The abstraction provided by SDL simplifies the process by managing this diversity. This is especially helpful considering that Linux does not always maintain backward compatibility with its APIs, which are subject to frequent changes and trends (e.g., systemd and the like). SDL, therefore, relieves developers of the considerable task of maintaining API wrappers by deferring this responsibility to the SDL and Linux distribution maintainers.

  2. Windows: Contrary to Linux, PasVulkan does not use SDL on Windows. The consistent backward compatibility of Windows APIs allows for a more streamlined and stable native development process, making the need for the SDL layer unnecessary. As a result, PasVulkan runs smoothly and reliably on Windows without the need for SDL, utilizing the Windows native APIs for its operations in a direct way.

  3. Android: SDL's role in PasVulkan for Android falls somewhere between its usage in Linux and Windows. While direct native API usage is generally smoother for certain tasks, such as handling display modes, SDL still provides a layer of abstraction that can be beneficial in managing the diversity of Android's system functions, since Android is also introducing new APIs and breaking old APIs often. It's a balancing act of leveraging SDL for its strengths while also recognizing scenarios where native APIs offer better performance or control.

Overall, SDL is integrated into PasVulkan where it offers significant advantages, which is mainly in the Linux environment. But for Windows, PasVulkan takes advantage of the robust native OS APIs, and on Android, it strikes a balance between SDL and native APIs based on what offers the best outcome for performance and control.

I hope this clarifies why SDL is used selectively in PasVulkan as cross-OS-API-wrapper, at least for Linux and Android.

Should you have further questions, feel free to ask.

tigrazone commented 11 months ago

Is no equivalents like ImGUI for Pascal for glfw/vulkan, no SDL? I see in c++ world ImGUI now is standard

BeRo1985 commented 11 months ago

At least, PasVulkan has its own quite feature-complete GUI framework, but it's a retained-mode GUI and not an immediate-mode GUI, because I personally don't like the idea behind ImGUIs.

In my opinion, retained-mode GUIs (RmGUIs) offer a superior approach to user interface design, particularly due to their robust handling of state and event management. The upfront layout and automatic state retention simplify the development process, making it far more convenient to handle user interactions and dynamic changes within the UI. This built-in efficiency is a significant advantage, enabling the creation of complex, responsive interfaces with less manual overhead.

Admittedly, immediate-mode GUIs (ImGUIs) can facilitate quicker development and more straightforward iteration of GUIs, often in a single pass, which can be particularly beneficial during prototyping or for simpler interfaces. However, it's important to weigh these advantages against the potential downsides, such as less efficient rendering and more complex state management, to determine if it's the best approach for a given project.

But tastes are different, after all. I myself favor RmGUIs. :-)

Screenshot_20231104_200514

tigrazone commented 11 months ago

I want to see as soon as possible your rtx approach with RmGUI. When it can be possible? It can be first rtx project on pascal. One more question. Is in RmGUI can be changed font and font size?

Coldzer0 commented 10 months ago

Is no equivalents like ImGUI for Pascal for glfw/vulkan, no SDL? I see in C++ world ImGUI now is standard

I've been working on a binding for ImGui in Pascal ^_^ https://github.com/Coldzer0/ImGui-Pascal

You may find it interesting.

tigrazone commented 10 months ago

Is no equivalents like ImGUI for Pascal for glfw/vulkan, no SDL? I see in C++ world ImGUI now is standard

I've been working on a binding for ImGui in Pascal ^_^ https://github.com/Coldzer0/ImGui-Pascal

You may find it interesting.

did you use OpenGL3 or SDL?

Coldzer0 commented 10 months ago

Is no equivalents like ImGUI for Pascal for glfw/vulkan, no SDL? I see in C++ world ImGUI now is standard

I've been working on a binding for ImGui in Pascal ^_^ https://github.com/Coldzer0/ImGui-Pascal You may find it interesting.

did you use OpenGL3 or SDL?

SDL2 is for window creation, and OpenGL3 is a renderer. But you can change the backend to anything you want I'm currently working on implementing more of the ImGui backends in pure Pascal.

tigrazone commented 10 months ago

I wish not use SDL. Like in c++ version of ImGUI ;-)

Coldzer0 commented 10 months ago

I wish not use SDL. Like in c++ version of ImGUI ;-)

ImGui has a lot of backends, and SDL is one of them; you can use any of them. What operation system are you targeting?

tigrazone commented 10 months ago

And I think If you want talk more about it we may use something like Discord my handle is coldzer0

I dont use Discord. Preffered os for me is Windows and Linux. I like to use backends OpenGL/GLFW without SDL, maybe Vulkan