Unformatted text preview:

mjb – December 29, 2011 1 glman, a Better View into GLSL glman is a program to allow a better view into the OpenGL Shading Language (GLSL). It does not take the place of an OpenGL program for real shader applications, but it is a nice OpenGL program substitute for running experiments as you learn about shaders. You start glman by double-clicking on its executable’s icon. In the Oregon State University Computer Graphics Education Lab, glman is started with: Start → All Programs → Shaders → glman.exe The starting user interface window looks like this. At the same time, a console window pops up. There are, at times, useful messages that are displayed there. Most of the time, you can ignore it. Iconify it if you want. Loading a GLIB File GLIB stands for GL Interface Bytestream. It is an ASCII-encoded input file inspired by the Photorealistic RenderMan RIB file. The GLIB portion of the glman menu looks like this. Load a new GLIB File This brings up a dialog box that allows you to select a GLIB file. glman parses your GLIB file and creates a scene in a new graphics window. Reload the GLIB File Reloads the currently-loaded GLIB file. This is useful if you have just edited a shader source file and want to test it. The following commands are allowed in a GLIB file. The command itself is case-insensitive, but any text arguments are case-sensitive. Numbers in square brackets [ ] show the default values if the parameters are not set. If you read nothing else in this document, read this. Some shaders expect to find the default OpenGL viewing situation, that is, the eye at the origin looking in –Z. So, glman provides that situation when your scene is first displayed. Unfortunately, this often leaves you seeing little or nothing of your scene because you’re inside it. Thus, usually your first move upon opening up a new .glib scene should be to use the Eye Transformation “Trans Z” widget to push the scene back into the viewing volume where it is more visible.mjb – December 29, 2011 2 GLIB Scene Creation Window and Viewing Volume WindowSize wx wy Specifies the initial graphics window size. [600. 600.] Ortho xl xr yb yt Set the current projection to orthographic with the given parameters. [-3. 3. -3. 3.] Perspective fov Set the current projection to perspective with the given field of view angle (degrees). [50.] Transformations (Like OpenGL itself, these transformations take effect in the reverse order in which they are listed.) Translate tx ty tz Pre-concatenate a translation onto the current matrix Rotate angle ax ay az Pre-concatenate a rotation onto the current matrix (angle in degrees) Scale s Pre-concatenate a uniform scale onto the current matrix Scale sx sy sz Pre-concatenate a non-uniform scale onto the current matrix PushMatrix Push the current matrix on the matrix stack TransformBegin Same as PushMatrix PopMatrix Pop the current matrix from the matrix stack TransformEnd Same as PopMatrix Creating Geometry Box dx dy dz Creates a 3D box. If specified, (dx,dy,dz) are the lengths of the sides. [2. 2. 2.] Cylinder radius height Draw a solid cylinder. [1. 1.] Cone radius height Draw a solid cone. [1. 1.] DiskXY Creates a unit disk parallel to the XY plane and passing through Z=0. JitterCloud numx numy numz Creates a jittered 3D point cloud. If specified, numx, numy, and numz are the number of points to use in each direction. See PointCloud. [10 10 10]mjb – December 29, 2011 3 LinesAdjacency [v0] [v1] [v2] [v3] Creates an instance of the new OpenGL GL_LINES_ADJACENCY primitive. This works with geometry shaders and only makes sense if they are available on your system. Each vertex consists of an x, y, and z, given in square brackets. So, for instance, [v0] might be: [1. 2. 3.] Obj filename Reads in a .obj geometry filename into lists of GL_TRIANGLES. If filename is not given, glman will prompt you for it. The complete .obj format can be quite complex. This feature, however, just supports vertices, normals, texture coordinates, and faces. Any face with more than 3 vertices is automatically converted into triangles. ObjAdj filename Reads in a .obj geometry filename into a list of GL_TRIANGLES_ADJACENT. This is useful for use with Geometry Shaders for applications such as smoothing and silhouettes. If filename is not given, glman will prompt you for it. The complete .obj format can be quite complex. This feature, however, just supports vertices, normals, texture coordinates, and faces. Any face with more than 3 vertices is automatically converted into triangles. If you don’t have a real need, use Obj instead of ObjAdj. The file will read faster and the resulting geometry will display faster. PointCloud numx numy numz Creates a regular 3D point cloud. If specified, numx, numy, and numz are the number of points to use in each direction. See JitterCloud. [10 10 10] QuadBox numquads Draws a series of ‘numquads’ quadrilaterals (default=10) parallel to the XY plane. The XYZ coordinates run from (-1.,-1.,-1.) to (1.,1.,1.). The 3D texture coordinates run from (0.,0.,0.) to (1.,1.,1.).This is a good way to test 3D textures. QuadXY z size nx ny Creates a quadrilateral parallel to the XY plane, passing through Z=z. If given, size is the quadrilateral’s dimension, going from (-size,-size) to (size,size) in X and Y. If given, nx and ny are the number of sub-quads this quadrilateral is broken into. This is a good way to test 2D textures. QuadXZ y size nx nz Creates a quadrilateral parallel to the XZ plane, passing through Y=y. If given, size is the quadrilateral’s dimension, going from (-size,-size) to (size,size) in X and Z. If given, nx and nz are the number of sub-quads this quadrilateral is broken into.mjb – December 29, 2011 4 QuadYZ x size ny nz Creates a quadrilateral parallel to the YZ plane, passing through X=x. If given, size is the quadrilateral’s dimension, going from (-size,-size) to (size,size) in Y and Z. If given, ny and nz are the number of sub-quads this quadrilateral is broken into. Soccerball radius Creates a geometric soccer ball from 12 pentagons and 20 hexagons. As part of this, two uniform variables are defined: 1. FaceIndex: which face are we on right now. 0-11 are the pentagons, 12-31 are the hexagons. 2. Tangent: vec3 pointing in a consistent tangent direction, same as the Sphere uses.


View Full Document

OSU CS 519 - a Better View into GLSL

Download a Better View into GLSL
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view a Better View into GLSL and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view a Better View into GLSL 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?