head	1.1;
branch	1.1.1;
access;
symbols
	netbsd-11-0-RC4:1.1.1.1
	netbsd-11-0-RC3:1.1.1.1
	netbsd-11-0-RC2:1.1.1.1
	netbsd-11-0-RC1:1.1.1.1
	netbsd-11:1.1.1.1.0.10
	netbsd-11-base:1.1.1.1
	netbsd-10-1-RELEASE:1.1.1.1
	netbsd-8-3-RELEASE:1.1.1.1
	netbsd-9-4-RELEASE:1.1.1.1
	netbsd-10-0-RELEASE:1.1.1.1
	netbsd-10-0-RC6:1.1.1.1
	netbsd-10-0-RC5:1.1.1.1
	netbsd-10-0-RC4:1.1.1.1
	netbsd-10-0-RC3:1.1.1.1
	netbsd-10-0-RC2:1.1.1.1
	netbsd-10-0-RC1:1.1.1.1
	netbsd-10:1.1.1.1.0.8
	netbsd-10-base:1.1.1.1
	netbsd-9-3-RELEASE:1.1.1.1
	netbsd-9-2-RELEASE:1.1.1.1
	netbsd-9-1-RELEASE:1.1.1.1
	netbsd-8-2-RELEASE:1.1.1.1
	netbsd-9-0-RELEASE:1.1.1.1
	netbsd-9-0-RC2:1.1.1.1
	netbsd-9-0-RC1:1.1.1.1
	netbsd-9:1.1.1.1.0.6
	netbsd-9-base:1.1.1.1
	netbsd-8-1-RELEASE:1.1.1.1
	netbsd-8-1-RC1:1.1.1.1
	mesa-demos-8-4-0:1.1.1.1
	netbsd-7-2-RELEASE:1.1.1.1.2.2
	netbsd-8-0-RELEASE:1.1.1.1
	netbsd-8-0-RC2:1.1.1.1
	netbsd-8-0-RC1:1.1.1.1
	netbsd-7-1-2-RELEASE:1.1.1.1.2.2
	netbsd-7-1-1-RELEASE:1.1.1.1.2.2
	netbsd-8:1.1.1.1.0.4
	netbsd-8-base:1.1.1.1
	netbsd-7-1:1.1.1.1.2.2.0.4
	netbsd-7-1-RELEASE:1.1.1.1.2.2
	netbsd-7-1-RC2:1.1.1.1.2.2
	netbsd-7-1-RC1:1.1.1.1.2.2
	netbsd-7-0-2-RELEASE:1.1.1.1.2.2
	netbsd-7-0-1-RELEASE:1.1.1.1.2.2
	netbsd-7-0:1.1.1.1.2.2.0.2
	netbsd-7-0-RELEASE:1.1.1.1.2.2
	netbsd-7-0-RC3:1.1.1.1.2.2
	netbsd-7-0-RC2:1.1.1.1.2.2
	netbsd-7-0-RC1:1.1.1.1.2.2
	netbsd-7:1.1.1.1.0.2
	mesa-demos-8-2-0:1.1.1.1
	xorg:1.1.1;
locks; strict;
comment	@# @;


1.1
date	2014.12.16.06.01.19;	author mrg;	state Exp;
branches
	1.1.1.1;
next	;
commitid	JHkLWGb9LgMxce2y;

1.1.1.1
date	2014.12.16.06.01.19;	author mrg;	state Exp;
branches
	1.1.1.1.2.1;
next	;
commitid	JHkLWGb9LgMxce2y;

1.1.1.1.2.1
date	2014.12.16.06.01.19;	author snj;	state dead;
branches;
next	1.1.1.1.2.2;
commitid	HBvt2MfSKnG9W63y;

1.1.1.1.2.2
date	2014.12.23.02.55.03;	author snj;	state Exp;
branches;
next	;
commitid	HBvt2MfSKnG9W63y;


desc
@@


1.1
log
@Initial revision
@
text
@//
// Fragment shader for drawing the Mandelbrot set
//
// Authors: Dave Baldwin, Steve Koren, Randi Rost
//          based on a shader by Michael Rivero
//
// Copyright (c) 2002-2005: 3Dlabs, Inc.
//
// See 3Dlabs-License.txt for license information
//

varying vec3  Position;
varying float LightIntensity;

uniform float MaxIterations;
uniform float Zoom;
uniform float Xcenter;
uniform float Ycenter;
uniform vec3  InnerColor;
uniform vec3  OuterColor1;
uniform vec3  OuterColor2;

void main()
{
    float   real  = Position.x * Zoom + Xcenter;
    float   imag  = Position.y * Zoom + Ycenter;
    float   Creal = real;   // Change this line...
    float   Cimag = imag;   // ...and this one to get a Julia set

    float r2 = 0.0;
    float iter;

//    for (iter = 0.0; iter < MaxIterations && r2 < 4.0; ++iter)
    for (iter = 0.0; iter < 12.0 && r2 < 4.0; ++iter)
    {
        float tempreal = real;

        real = (tempreal * tempreal) - (imag * imag) + Creal;
        imag = 2.0 * tempreal * imag + Cimag;
        r2   = (real * real) + (imag * imag);
    }

    // Base the color on the number of iterations

    vec3 color;

    if (r2 < 4.0)
        color = InnerColor;
    else
        color = mix(OuterColor1, OuterColor2, fract(iter * 0.05));

    color *= LightIntensity;

    gl_FragColor = vec4(color, 1.0);
}
@


1.1.1.1
log
@initial import of mesa-demos-8.2.0
@
text
@@


1.1.1.1.2.1
log
@file CH18-mandel.frag was added on branch netbsd-7 on 2014-12-23 02:55:03 +0000
@
text
@d1 55
@


1.1.1.1.2.2
log
@Apply patch (requested by mrg in ticket 341):
Add split-out versions of glu-9.0.0, glw-8.0.0, and mesa-demos-8.2.0.
@
text
@a0 55
//
// Fragment shader for drawing the Mandelbrot set
//
// Authors: Dave Baldwin, Steve Koren, Randi Rost
//          based on a shader by Michael Rivero
//
// Copyright (c) 2002-2005: 3Dlabs, Inc.
//
// See 3Dlabs-License.txt for license information
//

varying vec3  Position;
varying float LightIntensity;

uniform float MaxIterations;
uniform float Zoom;
uniform float Xcenter;
uniform float Ycenter;
uniform vec3  InnerColor;
uniform vec3  OuterColor1;
uniform vec3  OuterColor2;

void main()
{
    float   real  = Position.x * Zoom + Xcenter;
    float   imag  = Position.y * Zoom + Ycenter;
    float   Creal = real;   // Change this line...
    float   Cimag = imag;   // ...and this one to get a Julia set

    float r2 = 0.0;
    float iter;

//    for (iter = 0.0; iter < MaxIterations && r2 < 4.0; ++iter)
    for (iter = 0.0; iter < 12.0 && r2 < 4.0; ++iter)
    {
        float tempreal = real;

        real = (tempreal * tempreal) - (imag * imag) + Creal;
        imag = 2.0 * tempreal * imag + Cimag;
        r2   = (real * real) + (imag * imag);
    }

    // Base the color on the number of iterations

    vec3 color;

    if (r2 < 4.0)
        color = InnerColor;
    else
        color = mix(OuterColor1, OuterColor2, fract(iter * 0.05));

    color *= LightIntensity;

    gl_FragColor = vec4(color, 1.0);
}
@


