像素着色器(Pixel Shader):一种在图形渲染管线中运行的程序,用来为屏幕上的每个像素计算最终颜色与效果(如光照、阴影、纹理混合、反射、雾效等)。在许多现代图形 API 中,概念上常与 fragment shader(片段着色器)对应或近似(不同体系命名略有差异)。
/ˈpɪksəl ˈʃeɪdər/
A pixel shader changes the color of each pixel on the screen.
像素着色器会改变屏幕上每个像素的颜色。
By writing a custom pixel shader, the developer achieved realistic lighting, smooth shadows, and subtle material highlights in real time.
通过编写自定义像素着色器,开发者实现了实时的逼真光照、柔和阴影以及细腻的材质高光效果。
pixel 来自 “picture element(图像元素)” 的缩写,指图像的最小单位“像素”;shader 源于 shade(着色、明暗处理),在计算机图形学中指用于计算颜色与光照的程序。合起来 pixel shader 就是“对像素进行着色计算的程序”。