Graphics Reference
In-Depth Information
be open, and all the others will be closed. Open the ones you need
when you need them.
As an example of how the uniform variable selectors are presented, the
parameter interface window and color selection window shown in Figure 4.4
were created as a result of the lines in the GLIB file shown in that figure.
Examples of GLIB Files
In Chapter 3 we saw some examples of vertex and fragment shaders and the
images they create with glman . In this section we present the GLIB files that
correspond to these examples, so you can see how they were set up. These
example GLIB iles are prety simple, but they will help you get started on
writing your own as you start developing shaders using glman .
We'll see the example GLIB file from the screen shader example of the
previous chapter. In this example, you will see the following features:
The perspective is identified, with a field of view.
Eye position information is provided (eye position, look-at position, up-
vector).
The vertex and shader files ovalnoise.vert and ovalnoise.frag are
specified.
Uniform variables are set up.
The geometry is a standard teapot.
##OpenGL GLIB
Perspective 70
LookAt 0 0 3 0 0 0 0 1 0
Vertex ovalnoise.vert
Fragment ovalnoise.frag
Program OvalNoise \
uAd <.05 .1 .5> uBd <.05 .1 .5> \
uNoiseAmp <0. 0. 3.> uNoiseFreq <0. .25 1.> \
uAlpha <0. 1. 1.> \
uTol <0. 0. .25> \
uUseChromaDepth <false> \
uChromaBlue <-5. -2.4 -1.> \
uChromaRed <-3. 1.1 2.> \
uDotColor {1. .5 0.}
Teapot
Search WWH ::




Custom Search