Let’s focus on the first sentence for a minute
Posted: Sun Dec 22, 2024 6:34 am
We learn that shaders are computer programs that are used for calculating the lighting of 3D scenes. You can see why that would be helpful for video games. And that’s actually the origin of shaders.
Way back in the era of computer australia email database having barely enough computing power to run the early examples of real-time 3D, developers needed some tools to perform their calculations as efficiently as possible. That’s when a new category of graphics processing focused programs appeared. Since the output of such a program at that time was usually a shaded scene, the name stuck – a shader.
Unshaded geometry vs Output of a shader – Flutter Shader Guide
Left: Unshaded geometry; Right: Output of a shader
That’s cool and all, but that doesn’t seem useful for our Flutter projects, right?
We’re pretty much never doing any actual 3D, so why bother with shaders?
Reading the Wikipedia definition further, we learn that while shaders were originally built for 3D graphics, they were later repurposed to other applications. Among these, we find special effects – exactly what we need for our Flutter UIs!
Related content: Flutter App Development by Droids On Roids
And what about the “Fragment” part of “Fragment Shader”?
So, now that we know what we can use shaders for, let’s see where they fall in the process of drawing UI to the screen.
Even though the Flutter Development Team only just started boasting about Fragment Shader API with the release of Flutter 3.7[2], shaders were an essential part of Flutter since the very beginning. And Flutter itself uses them all the time – without even telling you – for stuff like gradients, blurs, drawing images, etc.[3]
Way back in the era of computer australia email database having barely enough computing power to run the early examples of real-time 3D, developers needed some tools to perform their calculations as efficiently as possible. That’s when a new category of graphics processing focused programs appeared. Since the output of such a program at that time was usually a shaded scene, the name stuck – a shader.
Unshaded geometry vs Output of a shader – Flutter Shader Guide
Left: Unshaded geometry; Right: Output of a shader
That’s cool and all, but that doesn’t seem useful for our Flutter projects, right?
We’re pretty much never doing any actual 3D, so why bother with shaders?
Reading the Wikipedia definition further, we learn that while shaders were originally built for 3D graphics, they were later repurposed to other applications. Among these, we find special effects – exactly what we need for our Flutter UIs!
Related content: Flutter App Development by Droids On Roids
And what about the “Fragment” part of “Fragment Shader”?
So, now that we know what we can use shaders for, let’s see where they fall in the process of drawing UI to the screen.
Even though the Flutter Development Team only just started boasting about Fragment Shader API with the release of Flutter 3.7[2], shaders were an essential part of Flutter since the very beginning. And Flutter itself uses them all the time – without even telling you – for stuff like gradients, blurs, drawing images, etc.[3]