<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Fragment on Feynman's Blog</title><link>/en/tags/fragment/</link><description>Recent content in Fragment on Feynman's Blog</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Sat, 15 Aug 2026 12:00:00 +0800</lastBuildDate><atom:link href="/en/tags/fragment/index.xml" rel="self" type="application/rss+xml"/><item><title>10 | GLSL Basics</title><link>/en/posts/threejs-glsl/</link><pubDate>Sat, 15 Aug 2026 12:00:00 +0800</pubDate><guid>/en/posts/threejs-glsl/</guid><description>&lt;blockquote class="blockquote-regular"&gt;
 &lt;p&gt;The first 9 lessons all used Three.js built-in materials (MeshStandardMaterial, MeshBasicMaterial&amp;hellip;). This lesson starts writing custom shaders — talking to the GPU directly with GLSL, so gradients, waves, and Fresnel effects are generated entirely by code instead of built-in material presets.&lt;/p&gt;

&lt;/blockquote&gt;
&lt;p&gt;&lt;img src="/images/2026-07-07_series_threejs-creation-diary/10_glsl/demo.png" alt="Demo: GLSL basics (gradient sphere, Fresnel rim-glow sphere, Raw sphere, wave floor, live parameter panel)"&gt;&lt;/p&gt;
&lt;h2 id="01-learning-objectives"&gt;01 Learning Objectives&lt;/h2&gt;
&lt;p&gt;This lesson focuses on GLSL shader programming fundamentals:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Understand the structure and execution flow of Vertex / Fragment Shaders&lt;/li&gt;
&lt;li&gt;Master the roles of &lt;code&gt;gl_Position&lt;/code&gt; / &lt;code&gt;gl_FragColor&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Distinguish the three variable types: &lt;code&gt;attribute&lt;/code&gt; / &lt;code&gt;uniform&lt;/code&gt; / &lt;code&gt;varying&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Understand &lt;code&gt;ShaderMaterial&lt;/code&gt; vs &lt;code&gt;RawShaderMaterial&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Master coordinate transformations (model → world → view → clip)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="02-glsl-basic-syntax"&gt;02 GLSL Basic Syntax&lt;/h2&gt;
&lt;p&gt;GLSL is a C-style shading language, slightly different from JS/TS. First, the most common &amp;ldquo;parts&amp;rdquo;.&lt;/p&gt;</description></item></channel></rss>