head	1.2;
access;
symbols
	netbsd-5-2-3-RELEASE:1.1.1.1.2.1
	netbsd-5-1-5-RELEASE:1.1.1.1.2.1
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.2
	riastradh-drm2-base:1.2
	netbsd-5-2-2-RELEASE:1.1.1.1.2.1
	netbsd-5-1-4-RELEASE:1.1.1.1.2.1
	netbsd-5-2-1-RELEASE:1.1.1.1.2.1
	netbsd-5-1-3-RELEASE:1.1.1.1.2.1
	netbsd-5-2:1.1.1.1.2.1.0.4
	netbsd-5-2-RELEASE:1.1.1.1.2.1
	netbsd-5-2-RC1:1.1.1.1.2.1
	netbsd-5-1-2-RELEASE:1.1.1.1.2.1
	netbsd-5-1-1-RELEASE:1.1.1.1.2.1
	netbsd-5-1:1.1.1.1.2.1.0.2
	netbsd-5-1-RELEASE:1.1.1.1.2.1
	netbsd-5-1-RC4:1.1.1.1.2.1
	netbsd-5-1-RC3:1.1.1.1.2.1
	netbsd-5-1-RC2:1.1.1.1.2.1
	netbsd-5-1-RC1:1.1.1.1.2.1
	netbsd-5-0-2-RELEASE:1.1.1.1
	netbsd-5-0-1-RELEASE:1.1.1.1
	netbsd-5-0:1.1.1.1.0.4
	netbsd-5-0-RELEASE:1.1.1.1
	netbsd-5-0-RC4:1.1.1.1
	netbsd-5-0-RC3:1.1.1.1
	netbsd-5-0-RC2:1.1.1.1
	netbsd-5-0-RC1:1.1.1.1
	netbsd-5:1.1.1.1.0.2
	netbsd-5-base:1.1.1.1
	MesaDemos-7-0-3:1.1.1.1
	xorg:1.1.1;
locks; strict;
comment	@# @;


1.2
date	2009.06.11.01.04.30;	author mrg;	state dead;
branches;
next	1.1;

1.1
date	2008.07.29.05.07.11;	author mrg;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2008.07.29.05.07.11;	author mrg;	state Exp;
branches
	1.1.1.1.2.1;
next	;

1.1.1.1.2.1
date	2009.09.17.03.31.59;	author snj;	state dead;
branches;
next	;


desc
@@


1.2
log
@merge MesaDemos 7.4.2
@
text
@//
// Fragment shader for procedurally generated toy ball
//
// Author: Bill Licea-Kane
//
// Copyright (c) 2002-2003 ATI Research 
//
// See ATI-License.txt for license information
//

varying vec4 ECposition;   // surface position in eye coordinates
varying vec4 ECballCenter; // ball center in eye coordinates

uniform vec4  LightDir;     // light direction, should be normalized
uniform vec4  HVector;      // reflection vector for infinite light source
uniform vec4  SpecularColor;
uniform vec4  Red, Yellow, Blue;

uniform vec4  HalfSpace0;   // half-spaces used to define star pattern
uniform vec4  HalfSpace1;
uniform vec4  HalfSpace2;
uniform vec4  HalfSpace3;
uniform vec4  HalfSpace4;

uniform float InOrOutInit;  // = -3
uniform float StripeWidth;  // = 0.3
uniform float FWidth;       // = 0.005

void main()
{
    vec4  normal;              // Analytically computed normal
    vec4  p;                   // Point in shader space
    vec4  surfColor;           // Computed color of the surface
    float intensity;           // Computed light intensity
    vec4  distance;            // Computed distance values
    float inorout;             // Counter for computing star pattern

    p.xyz = normalize(ECposition.xyz - ECballCenter.xyz);    // Calculate p
    p.w   = 1.0;

    inorout = InOrOutInit;     // initialize inorout to -3

    distance[0] = dot(p, HalfSpace0);
    distance[1] = dot(p, HalfSpace1);
    distance[2] = dot(p, HalfSpace2);
    distance[3] = dot(p, HalfSpace3);

    distance = smoothstep(-FWidth, FWidth, distance);
    inorout += dot(distance, vec4(1.0));

    distance.x = dot(p, HalfSpace4);
    distance.y = StripeWidth - abs(p.z);
    distance = smoothstep(-FWidth, FWidth, distance);
    inorout += distance.x;

    inorout = clamp(inorout, 0.0, 1.0);

    surfColor = mix(Yellow, Red, inorout);
    surfColor = mix(surfColor, Blue, distance.y);

    // normal = point on surface for sphere at (0,0,0)
    normal = p;

    // Per fragment diffuse lighting
    intensity  = 0.2; // ambient
    intensity += 0.8 * clamp(dot(LightDir, normal), 0.0, 1.0);
    surfColor *= intensity;

    // Per fragment specular lighting
    intensity  = clamp(dot(HVector, normal), 0.0, 1.0);
    intensity  = pow(intensity, SpecularColor.a);
    surfColor += SpecularColor * intensity;

    gl_FragColor = surfColor;
}
@


1.1
log
@Initial revision
@
text
@@


1.1.1.1
log
@initial import of MesaDemos-7.0.3
@
text
@@


1.1.1.1.2.1
log
@Apply patch (requested by mrg in ticket #958):
Bring over X.Org updates from HEAD.
@
text
@@

