Sophie

Sophie

distrib > * > cooker > x86_64 > by-pkgid > 0243c8b7bca94179c78b9bd6ac76c033 > files > 626

cg-examples-3.0.0018-0.1.x86_64.rpm

// These vertex and fragment programs are used by texture_array.c

// Vertex pass-through program for 2D positions with color
void offset_layer(float2 position  : POSITION,
                  float3 texcoord  : TEXCOORD0,
                     
              out float4 oPosition : POSITION,
              out float3 oTexCoord : TEXCOORD0,
          
          uniform float layerOffset)
{
  oPosition = float4(position,0,1);
  oTexCoord = texcoord;
  oTexCoord.z += layerOffset;
}

// Fragment program using 2D texture array sampler
float4 choose_decal(float3 texcoord : TEXCOORD0,
                         
            uniform sampler2DARRAY decalArray) : COLOR
{
  return tex2DARRAY(decalArray, texcoord);
}