Compute shader:一种在 GPU 上运行的着色器程序,用于执行通用并行计算任务(不直接负责图像的顶点/像素绘制),常用于粒子模拟、后处理、物理计算、AI 推理前后处理、图像处理等。
/kəmˈpjuːt ˈʃeɪdər/
I wrote a compute shader to blur the image.
我写了一个计算着色器来对图像做模糊处理。
By using a compute shader, the engine updates millions of particles each frame in parallel and then writes the results into a buffer for rendering.
通过使用计算着色器,引擎可以在每一帧并行更新数百万个粒子,并把结果写入缓冲区供渲染使用。
compute 源自拉丁语 computare(“计算、合计”);shader 来自 shade(“阴影/着色”)加后缀 -er(表示“做……的人/物”)。合起来 compute shader 指“用于计算用途的着色器程序”,强调它利用 GPU 的并行能力做通用计算,而不局限于传统图形管线中的“上色”。