**************************************************************** * A GFA RAYTRACE TUTORIAL OF SORTS Nick Smith May, 1992 * **************************************************************** ST Format UK's recent publishing of GFA Raytrace on its JUNE 92 coverdisk provides an opportunity for thousands to experience the wonderful world of raytracing on the ST. I hope others will find the program as fun to play with as I have and find imaginative ways to put its tools to work. I'm writing this tutorial to help new users get up to speed quickly and guide them up the learning curve before frustration sets in and prevents them from really seeing what the program is capable of. While this tutorial will be no substitute for the manual, I'm hoping it will provide enough info to lock in some fundamental concepts of using Raytrace and get you beyond the trial and error phase into getting pleasing, predictable results. The biggest challenge GFA Raytrace presents is the sheer number of variables: 3 axes, 5 material types, 10 reflectivity/transparency settings, 12 object types, 360 degrees of viewing angles, 512 colors, 64,000 pixels to fill a screen, and a million combinations all add up to alot of things to get under control at once when a scene is created and rendered. So, lets work our way through some of these variables and by the end I hope you'll have a sense of cohesion that will help you generate the kind of picturess GFA Raytrace's authors knew the program was capable of. X, Y, Z Navigating in RT's 3-D editor is the single biggest hurdle to come to grips with. Never having taken geometry, I had to relearn coordinate systems. This may seem obvious to some, but I had to remember X as across as in 'a cross' & 'x-country skis' to lock that in, Y as '(Y)up and down', and Z (in a German accent) 'Zee depth iz set vith za Zee axis'. DUH!, but hey it helped... Most operations of placement and movement of objects require that you do so focusing on AT LEAST TWO WINDOWS. Which two are most important depends on which axis you are placing; X: Top and Front, Y: Front and Right, Z: Top and Right. Especially when you need to MOVE or KILL an object, your crosshairs must be in the objects bounding box in At Least Two Windows. Once you have selected an object to ADD, Right Click and your cross- hairs will appear to help you place it. Press the HELP key, and your crosshairs will be labeled X,Y,Z. Note that the orientation of your axes will vary for each view window! RT is one of the few ST programs that rely heavily on the Right mouse button. Right clicking from the ADD menu brings up your crosshairs for placement. Then, when the Right Botton is dragged, it sets the Z axis (depth) of the object or point you're currently placing. Left Clicking consistently locks points or objects into place. I cannot emphasize enough how important these concepts are! ********************************************************************* If there is only one thing you get out of this tutorial, this is it - the most unintuitive aspect of the program that must be grapsed is placing your Z axis: You need to Right Drag the mouse up and down to move an object back or bring it forward in your 3-D world. Release the R Button to hold the Z axis in place. Focus on the Top and Right views when setting this coordinate for accurate placement. As the brief tutorial in ST Format mentioned, you may want to set up your Z axis first, then focus on setting X & Y. Left Click to set. ********************************************************************* Placing an object on the X and Y axes are more intuitive; merely move your mouse side to side, or up and down to position it, then Left Click to lock it in place. UNDO to abort any placement operation in progress. If you click on 1/1 Window Scale in the editor you will zoom out and see two things in the Right View window. The X is the center of your world and cannot be moved, it is only a point of reference. The + sign is your observer (camera) and can be moved at will by selecting Observer and moving it to a new position. From the front view these overlap by default and look like an asterisk *. You can see the center X in the right view window's far right edge, but the observer is not visible at 1/2 scale. Use 1/1 to get a overview of your workspace. Use Window Scale 1/4 or 1/8 to zoom in for accurate placement of objects (adjusting the window sliders may be necessary.) Also helpful when trying to Move or Kill objects very close together... A side issue: There are 3 types Scales used by the program, Window Scale sets your workspace view. Rayscale in the Edit menu sets the zoom level of the camera within your world. In Raytrace mode, Scale sets the size of the pic to calculate. The manual does apologize for using similar terminology for three very different functions, keep these distinctions in mind. FOLLOW THE SEQUENCE! Okay, once you grasp the coordinate aspects and get an idea of how to move around in your 3-D world, the only other difficulty to overcome is putting things into it. Understand that Raytrace is a very MODAL program. At its lowest level, it has three modes; EDIT, RAYTRACE, AND ANIMATE. You are in one of these three at any given time. And specifically in EDIT mode, each menu option on the right selects a sub-mode and has a very specific sequence for you to follow. Consider the ADD object function. Click on Add and choose an object type (a sphere - the circle with a cross in it.) Now you must choose the color of the sphere by dragging the RGB sliders (white is default). Then select Material and you will move to another mode where you choose Type (Dull is default, choose Mirrored.) Select Percent (60% is default, choose 40%.) Click Exit to leave Percent Mode, Click Exit to leave color/material mode. Then place your object by Right Clicking and using the crosshairs as described. So note, this basic act of Adding an object to your 3-D world involves stepping through a very specific sequence of _modes_ that must be followed in order. And this is common to many of Raytrace's other functions: Say you want to change the color of the sphere you just placed; to change an existing object, select EDIT then choose Object, then choose Color. Right click and the crosshairs will reappear in effect asking you to tell the program which object you want to edit the color of. Move the crosshairs to fit within the bounding box of the sphere In At Least Two Windows, Left Click. Now the RGB sliders appear. Drag them to a new color and Exit. Tho you can't see it now, when rendered the object will have the new chosen color. This pattern is similar for the other EDIT modes. To Move an object, select Edit/Object/Move. Right Click and then lock in your crosshairs within the objects bounding box and drag to a new position, Left Click to set it. Now lets ADD a Lamp. (Ya gotta have a lamp if you want to see anything!) Select ADD, choose the light bulb icon. The RGB sliders appear (default is white, leave it that way for now.) Right Click and the crosshairs appear with a lamp symbol at its intersection. If we want a Lamp above and to the side of our sphere, we have to pay close attention to its position in the view windows. Set its depth (Z axis) first by focusing on the Right view and place it in the upper right hand corner of the window by Right Dragging the mouse down to move it to the right hand side of the window, or in the Top view, to the bottom of the window. This places the lamp between you (the + Observer) and the object. Release the right button to leave in place, then focus on the Front view to set it horizontally and vertically so that it is somewhat centered and above the sphere. Left click to lock the lamp in position. If you weren't satisfied with its position, you could step through the Edit/Lamp/Move sequence to fine tune it. The acts of adding an object and lamp, changing their material or color, and then moving them are fundamental to navigating the program. The above exercise shows how a logical sequence is imposed on the user. In your head, a conversation of sorts needs to take place and would sound like this: "I want to ADD a SPHERE that's BLUE, and TRANSPARENT partially(50%). I want it this far away from me(Z), sitting here(Y) in my viewpoint, and off to the side(X). I'll ADD a LAMP that's WHITE and to the upper left of the sphere. I'll ADD a GROUND and place it, EDIT the GROUND SIZE to SMALL, then EDIT the GROUND COLOR by PICKING YELLOW and MOVING THE SLIDERS to RED." A DOZEN TO CHOOSE FROM, CRUDE BUT BASIC SHAPES The first icon in the ADD menu, the Ground/Horizon is actually both in one; Right Click to choose which and begin placement. Note the Ground cannot be placed above the middle of your word - if you try it will snap automatically to -1 X coordinate. It will appear only in your Right and Front views as a horizontal dotted line. The Horizon is used to set the lower limit of a Sky picture if you choose to load one. It too appears as a dotted line, but only in the fourth Perspective view window. The next icon is the default Walls - Predefined rectangles that are placed for you automatically. You can select Left or Right Walls, and the 1-5 option gives you walls placed at various angles. Once set, you can always move them later. What's significant here is that they are just rectangles, but were created in the proper sequence so that texture map pics loaded onto them appear in the proper position. Next, the rectangle. Only three of its four corners needs to be set, the program will calculate the fourth. No matter where you begin your rectangle the first line that stretches from the origin point will be the 'top' of a texture mapped pic if you choose to use one. To place one as a wall, set the upper right corner first, drag to upper left and set that point, then down. A final left click will set the rectangle in place. The triangle is identical, except the third point will stretch out lines from the first two points set. The ellipse is probably the most important object to grasp because other objects; the Pie, Ellipse Segment, Cylinder Segment, Cylinder and Cone ALL depend on setting a circular shape first as the objects base in the same manner. It begins with setting the center point, setting a second for one point on the outer circumference, then setting yet another. This is because it is an ellipse tool. You need the third point to create oval shapes. If you want to create perfect circles, watch your view windows closely before locking in the last point. From the top view you should strive for a perfect circle if you are placing the base of a cone or cylinder horizontally on the ground. The other objects all continue from there. Vertical objects like the cone and cylinder require you to then stretch the object to determine its height and the direction it extends in, then lock it in place. Most complicated are ellipse/pie/cylinder segments which once the base ellipse is set then require placing start/end, inside/out- side circumference points. Much more complicated than... THE SPHERE! Piece of cake. The basic building block of any tracing. After setting the center with a left click, simply move the mouse to expand or shrink the circumference, then click to set it. I spent many months just using spheres in my initial tracings. Plop down a sphere, play with its material, colors, percentages. Add a second lamp, change your ground size, load a ground pic, load a sky pic, set Smear to ON. To hell with trying any complex objects! There's a HUGE learning curve just having one single sphere and seeing all the variables that can affect it. When you get to the point where you KNOW what a sphere scene will look like before you even attempt to trace it, you can actually start getting creative with the program, and have gotten over the hump. LIGHT UP YOUR LIFE Tricky things Lamps are, Add a second, and suddenly the first doesn't have the effect it did alone. Lamps are very distance dependent. Generally the lamp closest to the object will have the most effect, the one farther away may have little or none. Very unpredictable. Generally, I have a main white lamp for my scene, then may add a colored lamp far off to the side and lower to add a glow to the side of objects to highlight them. Also be aware you're mixing light, not solid pigments. Shine a single Blue light on a Red sphere and it will be BLACK (not purple!) The red sphere has no blue component in it to reflect _any_ of the blue light! Important concept. Initially, stick with colored objects with white lamps or vice versa to avoid unpleasant surprises. GET SOME PERSPECTIVE! *** Read this section twice! It holds the keys to *** *** helping you create your best raytraced scenes ever. *** Perspective is what makes the difference between a dull tracing and one that has depth. There are four arrows in the Edit mode to let you shift your viewing angle - worth experimenting with. Also try various Rayscale settings: it acts as a zoom/fish eye lens in combination with your Observer's placement. Don't be afraid to get radical - view a scene like a drunk who's fallen on the floor, or from above looking down from a helicopter! Don't limit yourself to the default observer position/angles the program gives you. Moving your observer and losing your objects in the perspective window is a good start, stumble around with the four arrows till you can finally get things into view again. Chances are you'll come up with an interesting viewpoint. Perhaps the most important concept to grasp is to separate your lamp position from your observation point. Looking at the world straight on like a coal miner with a lamp in your helmet produces dull pics where the objects themselves hide the shadows they create and the scene looks flat. Like dramatic lighting in photography, place your lamp slightly to the side of an object to see more of the shadow. Lower your lamp to stretch the shadow even further. This is what makes a scene with depth and interest, what we're striving for. + Observer THIS: NOT THIS: L Lamp L o Sphere L + + ___ Ground _____o______ _____o______ Interesting.. BORING!!! The Grand canyon is best viewed at sunrise and sunset! Place your lamps and observer accordingly to make the most of shadows and highlights. SO, WHAT DOES IT LOOK LIKE? Okay, so now you've got your scene laid out, let's move to the RAYTRACE menu. No sense bothering with a full screen trace at this point. Note the 1 / [1] [2] [[4]] [8] option near the bottom. This defaults to 1/4 scale on boot up. Use this to get a small (3" x 3") tracing of your scene to get a faster preview before commiting an hour or more to a full screen trace. I've found the 1/8th scale to be too small to see enuff detail. And the 1/2 scale is important when using texture maps to see the pattern clear enough. The tendency to get color streaks when the program begins to run out of colors on a scanline are usually not visible till you are in 1/2 scale or larger. (see the Color Problems section of the manual) Generally 1/4 is best for for the edit, test, edit, test cycle. Select Do Raytracing for a preview. Use the Do Area function when say, you change your ground colors and just want to see the changes on the bottom half of the screen. It will present you with a horizontal line to begin your tracing at and work down from there, saving a few minutes unecessarily retracing an area that hasn't changed. Again good for testing purposes. Use HELP to peek at a trace in progress, any key to resume, and ESCape to terminate and return to the Raytrace menu. Select Do And Save when you're ready to commit to a tracing and want the security of unattended write to disk. But before you do that, move back to EDIT mode and select STATUS. Here you are presented with several options. The first is Compression OFF/ON. Since my viewer program RAYVIEW and Lonny Pursell's RAY2SPEC converter only work on uncompressed .SUL pics I recommend setting compression OFF before your final trace. Do note the Load/Save Screen functions in the Raytrace menu. You can use this to load both types of Raytrace formats SUL/SCL, as well as Neo, Degas or -uncompressed- Spectrum (SPU) pics. If you have compressed Raytrace pics you want to convert to uncompressed, use Load Screen, go to the Edit mode and select Status then toggle Compression off then select Save Screen again from the Raytrace menu. Sorry no external converter exists. Check out the other options in the Status menu. Smear has an interesting effect on smoothing spheres. And try Ground Light Weak/Strong to see its effect on your ground pattern/map. TEXTURE MAPPING Raytraced pics really get interesting when you start using texture maps; picture files placed onto objects surfaces. Granite columns, wood tables, Marble floors are possible when such maps are used. There is a good selection of basic patterns I created on GEnie as RAYTEX1.LZH to get you started. Note only several of the object types can be mapped - a rectangle (or wall), the ground, ellipses, cylinders, and triangles. Experiment with a sample pic to see how each type places the object onto its surface. Although texture mapped objects and sky pics can load uncompressed Spectrum pics (as well as Neo/Degas) Only 16 color pics can be used as a ground. Speaking of Sky Pics, be aware of three things: First that unlike the ground, objects will not cast shadows on the sky. I try to keep objects away from the back area when using sky pics to aviod having the shadow being clipped off by the Sky pic itself. You MUST place a Horizon in the prespective window from the Add Ground option in order to have a Sky. All skies have a horizon, right? Sky pics tend to aggravate 'color problems' since a very colorful sky pic may use up all 48 colors per scanline itself - and force your objects to grab out of only those 48 colors and streaking will result. Single color-range sky pics work best, a gradient of blues or gray thru white clouds will keep the number of colors used at a minimum and leave the rest of the 48 for the objects themselves. This may not make sense now, but when color streaking crops up in certain scenes you'll know what causes it. If you place 5 differently colored spheres horizontally across the same scanlines, you'll force Raytrace to start picking and choosing colors for you, usually two thirds of the way across the screen is where colors will begin to be substituted. REFLECT A MOMENT In fifty words or less: USE MIRRORS!!!! Lots of interesting results when a mirror acts as a second veiwpoint. Texure map a mirrored rectangle to make a wood tabletop look varnished or a marble floor look highly polished. Use a rectangle placed horizontally as a ground to reflect objects sitting on it. Place a mirror as a backdrop and get a good view of the backside of the objects in front of it. SEE THRU, PEEK-A-BOO Perhaps most difficult to get good results with is the Transparent object type. High percentages work best. Lots of trial and error here, but having other objects or textures beneath or behind a transparent one shows off its ability to refract light rays. ONLY ON SPHERES! The program is inconsistent on this: But BRIGHT and TEXTURED (with a grid on the surface - not as in Texture Map) as materials ONLY WORKS ON SPHERES. The program really ought to grey these out when selecting materials for other object types, and its not clearly spelled out in the manual. If you try them on other objects, they will default to dull. (a related issue; percentage only affects degree of mirroring or transparency - again this should have been greyed out when using Dull, Bright, or Texured objects.) THE END? Thats it, I'm toasted here. Lots of topics left untouched, but hey that's what the manual is for right? I hope at least some shred of this proves helpful to somebody out there. And if it does, you can prove it by sending me some samples of your work on disk, I'm anxious to see what others can wring out of this neat program. Please take the time to send some pics my way! Join other Raytrace users on GEnie in the ST Roundtable Category 22 GFA, Topic 4 GFA RAYTRACE and help me keep a lively discussion going. I can be reached in E-Mail there to S.SMITH65. or float a disk into my mailbox: Nick S. Smith 4406 5th Avenue South Minneapolis, MN 55409 USA