Delphi 3D Programming Overview

introduction to 3d programming in delphi n.w
1 / 23
Embed
Share

Learn about 3D programming in Delphi from Yuriy Kotsarenko, covering topics such as the basics of 3D programming, using Direct3D and OpenGL, different libraries, advanced concepts, and future trends. Delve into spatial representation, industrial processes, visualizing data, realism, and harnessing GPU power. Understand 3D vectors, matrices, transformations, and the importance of order in combining multiple transformations. Explore world, view, and projection matrices, as well as vertices and indices. Discover tips on choosing the right library, focusing on writing games rather than engines. Gain insights into using Direct3D in Delphi, taking advantage of Windows standards and Delphi's RTL support for 3D vectors.

  • Delphi
  • 3D programming
  • Direct3D
  • OpenGL
  • Game development

Uploaded on | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Introduction to 3D programming in Delphi

  2. Yuriy Kotsarenko R&D Consulting ykot@afterwarp.io http://afterwarp.io Developer of Asphyre / Platform eXtended Library: http://asphyre.net http://asphyre.net

  3. Agenda Why 3D? The basics of 3D programming Using Direct3D and OpenGL directly Using FireMonkey Other libraries Advanced 3D concepts The future

  4. So why going 3D? Natural spatial representation Model industrial processes accurately Visualize and manipulate real world data Visual realism Easier to interpret for human eye Professionally looking GPGPU Harness the power of GPU for general-purpose work!

  5. The basics of 3D programming 3D vectors: X, Y and Z 3D matrices (4x4 array) Translation Rotation Scaling A combination of above 3D vector multiplied by matrix Applying transformation 3D matrix multiplied by another matrix Combining multiple transformations Order is important!

  6. The basics of 3D programming World matrix Place object in 3D world. Scale, move, rotate, etc. View matrix How do we see the world? Eye position, direction and orientation. Projection matrix How the world is displayed. Field of view, aspect ratio, dimensions

  7. The basics of 3D programming V(2) Indices Vertices I(0) = 2 I(1) = 0 I(2) = 1 V(1) V(0)

  8. 3D: What library to use? Write games, not engines https://geometrian.com/programming/tutorials/write-games-not-engines Prefer framework rather than an engine Remember KISS and YAGNI principles! Avoid unnecessary complexity Avoid unnecessary features Too many options to choose from are not necessarily a good thing. Choose none! :)

  9. Using Direct3D in Delphi Direct3D is a de-facto Windows standard! Excellent driver and hardware support. Good documentation on MSDN web site. Delphi Tokyo 10.2 comes with latest DirectX headers. Delphi RTL provides all necessary 3D vector types and functions. Tutorial application on GitHub: https://github.com/yunkot/DelphiDirect3DTutorial

  10. Using Direct3D in Delphi Application Window D3D Context DXGI Factory D3D Swap Chain D3D Device D3D Shaders D3D Buffers D3D Views

  11. Using Direct3D Directly Let s open Direct3DTutorial project!

  12. Using OpenGL in Delphi Ne-He Tutorials: http://www.sulaco.co.za Delphi OpenGL community: http://delphigl.com (site in German) Embarcadero blogs: http://edn.embarcadero.com/article/26401 Many others (several pages on Google) http://github.com/neslib/DelphiLearnOpenGL http://www.noeska.net/ogl3xexamples.zip

  13. Using OpenGL Directly Let s see some existing examples!

  14. OpenGL: what to watch for Mixing Legacy (GL2) and Core (GL3+) features Many online examples have legacy or hybrid code. Difficult to know if certain function, enumeration or a specific value is deprecated or not. Hard to predict efficient code-path. Limited support on OS X (only 4.1 out of 4.6) No Compute Shaders :( Windows drivers issues Nvidia (excellent), AMD (good) and Intel (mediocre).

  15. OpenGL: considerations Fun learning experience Large community and collection of online materials. Get things done in few lines of code Legacy features? Use them! :) Currently all vendors support them fully and well. Beginner friendly: code is very short and elegant. Try things before getting into serious stuff . Avoid using in a production environment Instead focus on Vulkan, Metal and/or Direct3D APIs.

  16. Using FireMonkey Let s try some basic example!

  17. Using FireMonkey FireMonkey 3D design characteristics Wrapping Direct3D and OpenGL APIs DirectX on Windows, OpenGL on others Mixed fixed-function and programmable concepts Oriented towards UI applications Basic 3D functionality Simple shapes and models Minimalistic lighting without shadows Shader effects baked on top Might be difficult to use latest GPU features

  18. FireMonkey 3D strengths Strong 3D math and vector framework in RTL Initially was part of FireMonkey, now resides in System.Math.Vectors.pas GUI-oriented, facilitates showing UI on 3D surfaces See ControlsDemo (ControlsDesktop) example. Hardware-Accelerated Direct3D 11 Canvas with Batching GlobalUseGPUCanvas := True

  19. Other libraries GLScene Supports many different 3D graphics formats. Great integration with third-party physics, scripting and game engines. Many service and helper functions: Cadencer, Skyboxes, Perlin noise Getting outdated (pre-GL2 design?) But seems to have some recent movements! MPL, OpenGL-only :( Installation issues in Delphi Tokyo 10.2.3

  20. Other libraries Castle Game Engine A great collection of features shadows, bump mapping, mirrors, etc. Supports a large variety of 2D and 3D formats. Integrated with Kraft Physics Engine. Interesting features such as sound and editors. (L)GPL, OpenGL-only :(

  21. Other libraries Other game engines out there Proprietary vs open-source C/C++ libraries and engines Unity Unreal Ogre3D Afterwarp Framework (http://afterwarp.io) We ll see a quick preview shortly But we ll talk more about this one tomorrow. :)

  22. Advanced 3D Real-time Shadows Shadow Volumes Shadow Maps Hard edges Soft edges Order-Independent Transparency Instancing Generating Geometry directly on GPU

  23. The Future Compute Shaders and GPGPU More powerful AI Physics Parallel computing Ray-tracing Nvidia Opti-X Ray Tracing Engine Direct3D 12 Ray Tracing API Where we go from here?

More Related Content