Buzz #14
29 апреля 1998 |
|
Assembler - Description of the algorithms: 2D bump mapping, Gouraud Shading, Fast Phong Shading, Z Buffering, Flat Shading, Voxels.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^ ° ° · ·@@## ∙ · ° ° · · · · @ / # ° ° ###%° ¢ ° ° · - '/ ¢ ° / ° '/ \ °°·#/ ° ° · '/ · # # / ° ° # / @ @ ° ° · @ / \ @ ° ^^^^^^^^^^^^^^^^^^^^ JUST Cool effect! ^^^^^^^^^^^^^^^^^^^ (C) 1998 main text by Sat / MegaCode / Extreme (C) 1998 asciigfx 'add.text by Demiurge Ash / Eternity Industry ------------------ Over time, Spectrum effects more welling. Together with the effects of changing lexicon and encoders. We offer you to join the world 'vyskoih mother' :-). After reading these things Guide verbiage you can impress your friends with watching regular demos, pointing at the screen with the words: "Duc, at x voxel, e-me! Oppanki!". 2D bump mapping -------------- It looks as if the light source sharitsya body-surface. This effect you can see in Deme "Power 1 Up "by Megacode. ° Is very simple: 4 ° X ° 2 a) compute the normal in ° at X: 3 Nx = 2x - 4x Ny = 1y - 3y b) to these coordinates we choose the brightness level of plaques, which usually represents concentric circles with a maximum brightness in the center and fades to the edges. Ny Nx c) throws brightness to the point of X - and all! Gouraud Shading -------------- For quality paint stands in second place after fong'a. Essential nedostaok - using nebolshogo number colors become visible transitions (as a rule it is always visible). Shaded gouraud constructed by interpolation of color from one point with a known brightness to the other - and with a known brightness, in other words is needed as an input parameter to have 3 points, because Interpolation is the equation second degree ax ¤ + bx + c, 3 points are needed for the coefficients a, b, c. If the object - a 4-hugolnik, we need all 3 vertices. All other points polygon can be found on these three. Fast Phong Shading ----------------- The most savory way to paint. Its distinguishing feature is a very smooth color transitions. Very often you will notice that on object reflects light source (this is no longer in any different shading). Thus, we again need the normal to the surface, as in bump mapping'e, but here's how to calculate them smartly and painless - it is for us still a question. All other operations are similar bump'u. Z Buffering ---------- Rather coarse shading. Pixel color is determined by its Z-coordinate. Typical fill 'layers' that are always parallel to the plane of the screen. It seems there is nothing to explain is not necessary - all just obvious. Flat Shading ----------- Most lamersky method, widely distributed in the ZX, as requires a minimum amount of time. The entire face is painted monotone. Its color is determined by the distance to the light source and angle to it. On the ZX is almost always believe that the source light is located behind the screen, it is fixed - and counting color face in her Zsr coordinate, which is calculated as the average the coordinates of points constituting the brink. Voxels ----- A simple way to depict the earth's surface. In the construction method is used Z-buffer'a, ie begin to build the landscape from the farthest point, remote from the observer to the screen. It is necessary to have a height map. Point height is determined brightness in the height map. Moreover, when Rusu, we point on the screen, you must her to draw the entire height (stretch) to keep the integrity of image. To all this add some perspective, poizvraschaemsya little - and get landscape vplone lovely landscape. By the way, as Voxel'i built, so 0 they look like: a lot of points that 0 | some jump from place to place | | when you move the landscape. W W 'Pulling' of points to altitudes
Other articles:
Similar articles:
В этот день... 21 November