simple_fp.cg

来自「delphi 最好的3D控件GLScene_Demos」· CG 代码 · 共 24 行

CG
24
字号
//
// Simple Fragment Program
//
// - Just do a simple remap of RGBA
//
// Note: For OUT.color.a < 1 to work, you need
// to set the blending mode of the material
// that uses the shader to bmTransparency so
// that blending is switched on.

struct FragOut {
  float4 color : COLOR;
};

FragOut main(float4 color : COLOR)
{
  FragOut OUT;

  OUT.color.rg = color.gg;       // Red, Green channels <- Green value
  OUT.color.ba = float2(0.3, 1); // Blue <- 0.3; Alpha <- 1

  return OUT;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?