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 procedural bumps
//
// Authors: John Kessenich, Randi Rost
//
// Copyright (c) 2002-2006 3Dlabs Inc. Ltd. 
//
// See 3Dlabs-License.txt for license information
//

varying vec3 LightDir;
varying vec3 EyeDir;

uniform vec3  SurfaceColor;    // = (0.7, 0.6, 0.18)
uniform float BumpDensity;     // = 16.0
uniform float BumpSize;        // = 0.15
uniform float SpecularFactor;  // = 0.5

void main()
{
    vec3 litColor;
    vec2 c = BumpDensity * gl_TexCoord[0].st;
    vec2 p = fract(c) - vec2(0.5);

    float d, f;
    d = p.x * p.x + p.y * p.y;
    f = 1.0 / sqrt(d + 1.0);

    if (d >= BumpSize)
        { p = vec2(0.0); f = 1.0; }

    vec3 normDelta = vec3(p.x, p.y, 1.0) * f;
    litColor = SurfaceColor * max(dot(normDelta, LightDir), 0.0);
    vec3 reflectDir = reflect(LightDir, normDelta);
    
    float spec = max(dot(EyeDir, reflectDir), 0.0);
    spec *= SpecularFactor;
    litColor = min(litColor + spec, vec3(1.0));

    gl_FragColor = vec4(litColor, 1.0);
}
@


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
@@

