<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: mu san</title>
    <description>The latest articles on Forem by mu san (@mu_san_cdd820a45d42450ddf).</description>
    <link>https://forem.com/mu_san_cdd820a45d42450ddf</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3264601%2Fb6e59e78-9ce3-48cc-b9ae-f44d1ae7c676.png</url>
      <title>Forem: mu san</title>
      <link>https://forem.com/mu_san_cdd820a45d42450ddf</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mu_san_cdd820a45d42450ddf"/>
    <language>en</language>
    <item>
      <title>GLSL Tutorial (Part 1): Solid Color Fill</title>
      <dc:creator>mu san</dc:creator>
      <pubDate>Tue, 23 Dec 2025 14:55:19 +0000</pubDate>
      <link>https://forem.com/mu_san_cdd820a45d42450ddf/glsl-tutorial-part-1-solid-color-fill-32no</link>
      <guid>https://forem.com/mu_san_cdd820a45d42450ddf/glsl-tutorial-part-1-solid-color-fill-32no</guid>
      <description>&lt;p&gt;When learning shader programming, the &lt;strong&gt;fragment shader&lt;/strong&gt; is the most approachable and visually intuitive place to start. In this tutorial, we will use a minimal example to understand the basic structure of a GLSL shader and learn how to render a solid color across the entire canvas using &lt;code&gt;gl_FragColor&lt;/code&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. What Is a Fragment Shader?
&lt;/h2&gt;

&lt;p&gt;The role of a fragment shader is simple in concept:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;It determines the final color of every pixel on the screen.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can think of it as a color calculator. The GPU executes the &lt;code&gt;main()&lt;/code&gt; function once for every pixel, and the result defines that pixel’s color.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Complete Example Code
&lt;/h2&gt;

&lt;p&gt;Let’s start by looking at the full shader code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight glsl"&gt;&lt;code&gt;&lt;span class="k"&gt;precision&lt;/span&gt; &lt;span class="kt"&gt;mediump&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;uniform&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt; &lt;span class="n"&gt;u_time&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;uniform&lt;/span&gt; &lt;span class="kt"&gt;vec2&lt;/span&gt; &lt;span class="n"&gt;u_resolution&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;gl_FragColor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;vec4&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This shader produces the following result:&lt;br&gt;
👉 &lt;strong&gt;The entire canvas is filled with solid red.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Basic Structure of a GLSL Shader
&lt;/h2&gt;

&lt;h3&gt;
  
  
  3.1 Precision Declaration
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight glsl"&gt;&lt;code&gt;&lt;span class="k"&gt;precision&lt;/span&gt; &lt;span class="kt"&gt;mediump&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This line defines the &lt;strong&gt;default precision&lt;/strong&gt; for floating-point numbers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;lowp&lt;/code&gt; – low precision (fast, less accurate)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mediump&lt;/code&gt; – medium precision (most common)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;highp&lt;/code&gt; – high precision (most accurate, slower)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In WebGL fragment shaders, &lt;strong&gt;declaring float precision is mandatory&lt;/strong&gt;, otherwise the shader will fail to compile.&lt;/p&gt;




&lt;h3&gt;
  
  
  3.2 &lt;code&gt;uniform&lt;/code&gt; Variables
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight glsl"&gt;&lt;code&gt;&lt;span class="k"&gt;uniform&lt;/span&gt; &lt;span class="kt"&gt;float&lt;/span&gt; &lt;span class="n"&gt;u_time&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;uniform&lt;/span&gt; &lt;span class="kt"&gt;vec2&lt;/span&gt; &lt;span class="n"&gt;u_resolution&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A &lt;code&gt;uniform&lt;/code&gt; variable:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is passed in from the CPU (JavaScript)&lt;/li&gt;
&lt;li&gt;Has the same value for all pixels during a draw call&lt;/li&gt;
&lt;li&gt;Is read-only inside the shader&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Common usage examples:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Meaning&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;u_time&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Elapsed time in seconds&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;u_resolution&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Canvas resolution (width, height)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;In this example, these variables are not yet used, but declaring them early prepares us for animations and coordinate-based effects later.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  4. &lt;code&gt;main()&lt;/code&gt;: The Shader Entry Point
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight glsl"&gt;&lt;code&gt;&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;main()&lt;/code&gt; is the &lt;strong&gt;only entry point&lt;/strong&gt; of a GLSL shader&lt;/li&gt;
&lt;li&gt;It is executed once &lt;strong&gt;per pixel&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;You never call it manually&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  5. &lt;code&gt;gl_FragColor&lt;/code&gt;: Outputting the Pixel Color
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight glsl"&gt;&lt;code&gt;&lt;span class="nb"&gt;gl_FragColor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;vec4&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the &lt;strong&gt;most important line&lt;/strong&gt; in the shader.&lt;/p&gt;

&lt;h3&gt;
  
  
  5.1 What Is &lt;code&gt;gl_FragColor&lt;/code&gt;?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;gl_FragColor&lt;/code&gt; is a built-in output variable&lt;/li&gt;
&lt;li&gt;It defines the final color of the current fragment (pixel)&lt;/li&gt;
&lt;li&gt;Its type is &lt;code&gt;vec4&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  5.2 The RGBA Color Model
&lt;/h3&gt;

&lt;p&gt;A &lt;code&gt;vec4(r, g, b, a)&lt;/code&gt; represents:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Channel&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;th&gt;Range&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;R&lt;/td&gt;
&lt;td&gt;Red&lt;/td&gt;
&lt;td&gt;0.0 – 1.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;G&lt;/td&gt;
&lt;td&gt;Green&lt;/td&gt;
&lt;td&gt;0.0 – 1.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;B&lt;/td&gt;
&lt;td&gt;Blue&lt;/td&gt;
&lt;td&gt;0.0 – 1.0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;A&lt;/td&gt;
&lt;td&gt;Alpha (opacity)&lt;/td&gt;
&lt;td&gt;0.0 – 1.0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight glsl"&gt;&lt;code&gt;&lt;span class="kt"&gt;vec4&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;100% red&lt;/li&gt;
&lt;li&gt;0% green&lt;/li&gt;
&lt;li&gt;0% blue&lt;/li&gt;
&lt;li&gt;Fully opaque&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Result: &lt;strong&gt;pure red&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  5.3 Common Color Examples
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight glsl"&gt;&lt;code&gt;&lt;span class="c1"&gt;// White&lt;/span&gt;
&lt;span class="kt"&gt;vec4&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Black&lt;/span&gt;
&lt;span class="kt"&gt;vec4&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Green&lt;/span&gt;
&lt;span class="kt"&gt;vec4&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Semi-transparent blue&lt;/span&gt;
&lt;span class="kt"&gt;vec4&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  6. Why Is the Entire Screen the Same Color?
&lt;/h2&gt;

&lt;p&gt;Because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every pixel executes &lt;code&gt;main()&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Every pixel assigns the same value to &lt;code&gt;gl_FragColor&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;No coordinates, time, or varying data are used&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As a result:&lt;br&gt;
 &lt;strong&gt;The whole canvas is filled with a single color.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Shader Learn: Your Fast-Track to Hands-On GLSL Mastery</title>
      <dc:creator>mu san</dc:creator>
      <pubDate>Sat, 14 Jun 2025 02:54:12 +0000</pubDate>
      <link>https://forem.com/mu_san_cdd820a45d42450ddf/shader-learn-your-fast-track-to-hands-on-glsl-mastery-4l3k</link>
      <guid>https://forem.com/mu_san_cdd820a45d42450ddf/shader-learn-your-fast-track-to-hands-on-glsl-mastery-4l3k</guid>
      <description>&lt;p&gt;When you first dip your toes into GPU programming, the flood of scattered tutorials can feel overwhelming. &lt;strong&gt;Shader Learn&lt;/strong&gt; (shader-learn.com) takes a different approach: one browser-based hub that blends concise lessons, live coding, and project challenges into a single feedback loop. Below is a practical tour of the platform, ready for publication on dev.to.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Shader Learn Deserves Your Attention
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Zero setup friction&lt;/strong&gt; – An in-browser editor and WebGL canvas mean you write code and watch pixels change instantly; no local tool-chain required. ([shader-learn.com][1])&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A structured curriculum&lt;/strong&gt; – Six thematic tracks (Basic, Math, Lighting, Patterns, Animation, Noise) span 30-plus micro-lessons, each capped with an exercise and a canonical solution. ([shader-learn.com][2])&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Project-first pedagogy&lt;/strong&gt; – From particle storms to procedural textures, every module ends with a mini-project so you leave with a share-ready artifact instead of half-digested theory. ([shader-learn.com][1])&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cross-domain relevance&lt;/strong&gt; – Examples target game effects, creative coding, data-viz heatmaps, and web UI flourishes, making it easy to port skills back to real client work. ([shader-learn.com][2])&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Five-Minute Quick-Start
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Sign up at &lt;strong&gt;shader-learn.com&lt;/strong&gt; and open the &lt;em&gt;Basic&lt;/em&gt; path.&lt;/li&gt;
&lt;li&gt;Locate lesson 1, “Coordinate Basics”, then clear the editor and paste the fragment shader below.&lt;/li&gt;
&lt;li&gt;Press &lt;strong&gt;Run&lt;/strong&gt; and enjoy the instant gradient; tweak values to feel the GPU react in real time.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight glsl"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Fragment shader: render an XY gradient&lt;/span&gt;
&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// Normalized pixel coordinates (0-1 range)&lt;/span&gt;
  &lt;span class="kt"&gt;vec2&lt;/span&gt; &lt;span class="n"&gt;st&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;gl_FragCoord&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;xy&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;u_resolution&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="c1"&gt;// RGB = (x, y, constant blue)&lt;/span&gt;
  &lt;span class="kt"&gt;vec3&lt;/span&gt; &lt;span class="n"&gt;color&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;vec3&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;st&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;st&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;y&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="nb"&gt;gl_FragColor&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;vec4&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;color&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What’s happening?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;gl_FragCoord&lt;/code&gt; gives us the current pixel; dividing by the resolution normalizes it.&lt;/li&gt;
&lt;li&gt;We pack those XY values into RGB channels, producing a diagonal sweep.&lt;/li&gt;
&lt;li&gt;Because the code runs per-pixel on the GPU, changes are visible the moment you hit &lt;strong&gt;Run&lt;/strong&gt;, cementing the mental model of &lt;em&gt;parallel shading&lt;/em&gt; long before matrix algebra enters the chat.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Learning Tracks at a Glance&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Track&lt;/th&gt;
&lt;th&gt;Key Topics&lt;/th&gt;
&lt;th&gt;Lessons&lt;/th&gt;
&lt;th&gt;Ideal Stage&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Basic&lt;/td&gt;
&lt;td&gt;Coordinates, UVs, color&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;td&gt;Novice&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Math&lt;/td&gt;
&lt;td&gt;Trig, vectors, matrices&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;td&gt;Beginner&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Lighting&lt;/td&gt;
&lt;td&gt;Phong, PBR fundamentals&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;Intermediate&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Patterns&lt;/td&gt;
&lt;td&gt;Procedural textures, ramps&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;td&gt;Intermediate&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Animation&lt;/td&gt;
&lt;td&gt;Time uniforms, easing, FFT&lt;/td&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;Advanced&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Noise&lt;/td&gt;
&lt;td&gt;Perlin, FBM, worley&lt;/td&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;Advanced&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Completion progress is tracked so the site can suggest what to tackle next. ([shader-learn.com][2])&lt;/p&gt;




&lt;h2&gt;
  
  
  Project Ideas to Cement Your Knowledge
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Interactive Starfield&lt;/strong&gt; – Combine the &lt;em&gt;Noise&lt;/em&gt; track’s FBM lesson with mouse-driven camera motion for a lobby-screen ready background.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hero Banner Shader&lt;/strong&gt; – Adapt the &lt;em&gt;Patterns&lt;/em&gt; stripes demo into a lightweight animated header for your personal site—one &lt;code&gt;&amp;lt;canvas&amp;gt;&lt;/code&gt; beats a 2 MB GIF.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Heatmap Renderer&lt;/strong&gt; – Use gradient lookup + simplex noise for a performant data-visualization layer that paints directly in the fragment stage.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each sample ships with &lt;em&gt;copy-pasteable&lt;/em&gt; scaffolding so you drop it straight into React, Vue or raw Three.js.&lt;/p&gt;




&lt;h2&gt;
  
  
  Shader Learn vs. Shadertoy: Picking the Right Tool
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Aspect&lt;/th&gt;
&lt;th&gt;Shader Learn&lt;/th&gt;
&lt;th&gt;Shadertoy&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Learning Flow&lt;/td&gt;
&lt;td&gt;Guided curriculum + tasks&lt;/td&gt;
&lt;td&gt;Open gallery; self-directed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Onboarding Time&lt;/td&gt;
&lt;td&gt;Minutes&lt;/td&gt;
&lt;td&gt;Depends on prior GLSL fluency&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Community Focus&lt;/td&gt;
&lt;td&gt;Discord Q&amp;amp;A, instructor feedback&lt;/td&gt;
&lt;td&gt;Showcase &amp;amp; peer critique&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pricing&lt;/td&gt;
&lt;td&gt;Free core; optional Pro packs&lt;/td&gt;
&lt;td&gt;Free (donation supported)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If you already crank out signed-distance fields on Shadertoy, Shader Learn’s quizzes will help patch theory gaps; if you’re new, start here, then graduate to Shadertoy’s wild west of inspiration.&lt;/p&gt;




&lt;h2&gt;
  
  
  Study Tips for Consistent Progress
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;One lesson per day&lt;/strong&gt; – Momentum matters more than marathon sessions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Annotate your tweaks&lt;/strong&gt; – Keep a Git repo or Gist of every shader variant; watching diff-logs is a crash course in GPU performance trade-offs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Write post-mortems&lt;/strong&gt; – After each mini-project, jot down what surprised you (e.g., precision qualifiers, branching costs). Those notes turn into blog posts—and potential job-interview talking points.&lt;/li&gt;
&lt;/ol&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Shader Learn distills the “edit-run-see” loop of shader art into a clean, incremental curriculum. Whether you’re a front-end engineer chasing buttery scroll effects or a technical artist prototyping next-gen visuals, the platform’s bite-size tasks and instant GPU feedback form a straight, well-lit path to mastery.&lt;/p&gt;

&lt;p&gt;Ready to level up? Head to &lt;strong&gt;&lt;a href="http://www.shader-learn.com" rel="noopener noreferrer"&gt;http://www.shader-learn.com&lt;/a&gt;&lt;/strong&gt;, crack open the first lesson, and watch your pixels spring to life. If the journey hits home, spread the word—GLSL newcomers everywhere will thank you.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>glsl</category>
      <category>shader</category>
      <category>webgl</category>
    </item>
  </channel>
</rss>
