![Learn Shader Programming In Delphi FireMonkey | Embarcadero RAD Studio Delphi C++Builder Blogs learn shader programming in delphi firemonkey](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2021/02/Learn-Shader-Programming-In-Delphi-FireMonkey--6680289.png?resize=1140%2C675&ssl=1)
Computer Graphics Programming class is one of the interesting ones in any computer science undergraduate program. This semester I am taking this course as my core science course, and it is getting fascinating every topic. Since most of the universities teach programming in C++ or Java, I am using the “Computer Graphics Programming In OpenGL With Java” book as my primary source now. Furthermore, knowing matrix algebra is somehow required for learning computer graphics, which I have done in my first semester within the Applied Math class.
![computergraphicscscoursemuminjonguru2259064 | Embarcadero RAD Studio Delphi C++Builder Blogs computer graphics cs course muminjonguru 2259064](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2021/02/computer-graphics-cs-course-muminjonguru-2259064.jpg?resize=750%2C422&ssl=1)
I found out that learning computer graphics with higher-level languages is better than learning in C. For instance, higher-level languages are convenient for beginners. Moreover handling events, input-output operations, and object-oriented design patterns are helpful when writing cleaner, and good code. The beautiful part of this class is you learn how to utilize the power of the GPU! And exploring the parallel architecture of the GPU is one of the essential parts of graphics programming.
Actually, this post is about Shader Programming in Delphi FireMonkey. FireMonkey is a cross-platform UI framework and written to use the GPU where possible. And the 3D scene environment is one of the best features of the FireMonkey.
Erik van Bilsen who is one of the Embarcadero Delphi MVPs has written a long blog post about Shader Programming in Delphi FireMonkey. In his blog post, you can learn how to utilize the power of FireMonkey 3D development. He has developed 6 different sample projects to demonstrate the use of custom materials and shaders in Delphi FireMonkey.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
procedure TFormMain.Form3DCreate(Sender: TObject); begin LabelBackend.Text := 'Backend: ' + Context.ClassName; FMaterialSource := TBlueMaterialSource.Create(Self); Plane.MaterialSource := FMaterialSource; end; procedure TFormMain.Form3DRender(Sender: TObject; Context: TContext3D); begin {$IF Defined(MACOS) and not Defined(IOS)} { Workaround for https://quality.embarcadero.com/browse/RSP-32121 } if (GlobalUseMetal) then Context.FillRect(Point3D(-Width, -Height, 100), Point3D(Width, Height, 100), 1, Color); {$ENDIF} end; |
In the first sample, the demo application just renders every pixel using a blue color. And, shows you how to configure your application to utilize custom materials and shaders which is the fundamental part before doing anything else.
![embarcaderodelphifiremonkeyshaderprogramming3283881 | Embarcadero RAD Studio Delphi C++Builder Blogs embarcadero delphi firemonkey shader programming 3283881](https://i0.wp.com/blogs.embarcadero.com/wp-content/uploads/2021/02/embarcadero-delphi-firemonkey-shader-programming-3283881.jpg?resize=750%2C498&ssl=1)
Stay tuned, and we will learn other samples in coming posts.
Be sure to check out the full blog post here!
Design. Code. Compile. Deploy.
Start Free Trial Upgrade Today
Free Delphi Community Edition Free C++Builder Community Edition