send messagemessage
articles
journals
info

The perfect realtime shadow algorithm

DrWatson's profile picture
Published in 
 · 1 Mar 2024
Written by: Vector/Vertigo (Brian Cowan) Email: cowan@gold.guate.net Vertigo Web Page: http://demoscene.interstat.net/~vertigo/ irc: #coders #vertcode Revision history: 10/06/97 v0.70Beta - Awesome tips from MidNight, touched up the doc 04/06/97 v0.60Beta - Added the tips section with help from Statix 01/06/97 v0.50Beta - A few typo fixes and a cool tip from Statix 30/05/97 v0.10Beta - Initial version INTRODUCTION Well, for the last 2 months or so I have been laying around the house, forcing my brain to try and come up with the perfect shadow algorithm, an algorithm that works beautifull...

Phong lighting and specular highlights

Theory, practice and explaination of the phong lighting and shading model.

DrWatson's profile picture
Published in 
 · 29 Feb 2024
by TimJ/Vertigo "I am he, as you are he, as you are me, and we are all together" email: tim@legend.co.uk irc: #coders #vertcode revision history: 16/02/97 v1.0 - Initial version INTRODUCTION First off, I hope this doc is of use to some people, and maybe other people will find it interesting. Recently, I've been thinking a lot about phong shading and lighting. There was something that was bugging me. I couldn't quite put my finger on it. It was something I knew to be true, but I had to explain it to myself. It all started when I was chatting to Vector about true phong shading. We'd both recently looked at Voltaire&#...

Reflections on Flat-Shading vs. Texture-Mappig

or I Can Live with Flat-Shaded Polygons

DrWatson's profile picture
Published in 
 · 31 Jan 2024
Just before Christmas, I rented two Sega Saturn games, Virtua Racing and Sega Rally Championship, in order to compare the two. Santa was only going to bring me one, so I had to choose: VR was my favorite in the arcades for a very long time, and I had heard just wonderful things about Rally. So I sat down and played both for few hours each, on separate occasions. I fell in love with Rally, but did not much care for the translation of VR -- it was missing the arcade feel. (though, since Santa also brought me an Arcade Racer steering wheel accessory, I happen to really like VR -- perhaps as much as Rally. The steering wheel makes all the dif...

Tiled Texture Mapping for pow2 Texture Sizes

DrWatson's profile picture
Published in 
 · 31 Jan 2024
by TheGlide/SpinningKids Milan, Italy - June 1 st , 1998 INTRODUCTION I assume here you know the basics of texture mapping, as explained in fatmap and fatmap2 docs by MRI/Doomsday. This doc is about texture mapping using texture maps stored as tiles, namely 8x8 pixels tiles. Storing the maps this way can improve very much cache access. Most of the time we have to traverse the texture through non-horizontal lines, and this causes many cache misses. The worst situation happens when we have to traverse the texture vertically: each texel we access will be on a different row, and this will require, from the processor side, a whole cach...

Gravity: how to realistically simulate jumping and interstellar maneuvers

DrWatson's profile picture
Published in 
 · 31 Jan 2024
The information contained in document will allow you to realistically simulate jumping and interstellar maneuvers. The purpose of this document is to understand the physics of the world we live in, and apply realistic physics to your game. It will not give you optimized routines for your program, that is your job! But if you understand how things work, it will be a heck of a lot easier. Basics There are some key terms I will define to make sure we are talking about the same things: Distance : Total path of travel. Displacement : Difference between original position, and final position Speed : Change in displacement divided by the change i...

Perspective Transforms

DrWatson's profile picture
Published in 
 · 21 Jan 2024
By Andre Yew (andrey@gluttony.ugcs.caltech.edu) This is how I learned perspective transforms --- it was intuitive and understandable to me, so perhaps it'll be to others as well. It does require knowledge of matrix math and homogeneous coordinates. IMO, if you want to write a serious renderer, you need to know both. First, let's look at what we're trying to do: S (screen) | * P (y, z) | /| | / | | / | |/ | * R | / | | / | | / | | E (eye)/ | | W ---------*-----|----*------------- <- d -><-z-> E is the eye, P is the point we're trying to project, and R is its projected position on ...

Lighting Your Texture Maps

DrWatson's profile picture
Published in 
 · 21 Jan 2024
Introduction So, you've got your engine running, you have texture mapping, and some kind of shading in place, it runs fast, its smooth, but you feel somethings missing. You need to shade your texture maps. But you haven't got a clue how to do it! Well, I shall now explain the simple process of adding shading or transparency to your textures, in 256 colour mode. 16*16 Linear Palette The easiest way to make primitive shading is to change your palette. Firstly, you will only be able to have 256 / n shades, where n is the number of colours you will be using. Secondly, the image quality is very poor. But, I'll explain it anywa...

Fast Squareroots

DrWatson's profile picture
Published in 
 · 21 Jan 2024
by Arne Steinarson (arst@ludd.luth.se) BRIEF Integer squareroot approximation which executes in 16-27 cycles through effective bitsearch and 256 byte LUT table. Higher value for 486, lower for Pentium systems. On both CPU:s this means a performance improvement of at least 330% compared to using the FPU. In addition one removes the overhead of converting the integer value to a float and back again. OBSERVATION Note that \sqrt{(2^{16})} = 2^{8} , \sqrt{(2^{10})} = 2^{5} . Interesting, just half the position of the bit. But what if we've got a multibit number such as 2710h (=10000 dec)? TRIAL Go looking for the bit in the highest positio...

How to implement 2d bump mapping

DrWatson's profile picture
Published in 
 · 21 Jan 2024
Hello fellow coders. This is Sqrt(-1) speaking. Many demos nowadays feature 2d bump mapping (the effect in which highlight travels upon a bumpy surface (prolly with embossed writing or something on it) seen from above), so I decided to write something about it... As you'll soon see, I convert my page into this kind of a text articles w/ sample programs and source codes. I hope you will be happy now. (To you whom got this article from else where, consider visiting www.sci.fi/~zaphod) Ok, to the point. To really do REAL 2d bump mapping one has to calculate normals for every pixel in bump map (an image representing "heights" of p...

Avatar's Guide To 3D-Rotations

DrWatson's profile picture
Published in 
 · 21 Jan 2024
StEP oNE! - 12 muls / rotation rotate around z-axis: x' = x*cos(A) + y*sin(A) y' = x*sin(A) - y*cos(A) rotate around y-axis: x'' = x'*cos(B) + z*sin(B) z' = x'*sin(B) - z*cos(B) rotate around x-axis: y'' = y'*cos(C) + z'*sin(C) z'' = y'*sin(C) - z'*cos(C) after this the rotated vector is (x'',y'',z'') StEP tWO! - 9 muls / rotation + 14 muls init If we evaluate the rotations from the first step we get x'' = x * [cos(A)cos(B)] + + y * [sin(A)cos(B)] + + z * [sin(B)] y'' = x * [sin(A)cos(C) + cos(A)sin(B)sin(C)] + + y * [-cos(A)cos(C)...

Three Dimensional Shading In Computer Graphics

DrWatson's profile picture
Published in 
 · 21 Jan 2024
By Lithium /VLA Hopefully you have read the companion document 3DROTATE.DOC, as this one will build upon the concepts presented in my attempt to teach some of the math need to make 3D graphics a reality. This file will cover such important topics as the Dot Product and how routines are best constructed for real-time 3D rotations and planar shading. Our Friend, The Dot Product The Dot Product is a neat relation that will allow you to quickly find the angle between any two vectors. It's easiest to explain graphically, so I will exercise my extended-ASCII keys. Two Vectors A & B A (Xa, Ya, Za) |A| = û( (Xa)² + (Ya)² + (Za)² ) B (...

Tutorial #1: Fire effect

DrWatson's profile picture
Published in 
 · 20 Jan 2024
, , / \/ \ (/ //_ \_ .-._ \|| . \ \ '-._ _,:__.-"/---\_ \ ______/___ '. .--------------------'~-'--.)_,( , )\ \ `'--.___ _\ / | DarK I ,' \)|\ `\| /___.-' \ \ _:,_ Tutorial #1: Fire effect " || ( .'__ _.'\ '-/,`-~` |/ \ ___.> /=,| http://www.multimania.com/darki | / _.-'/_ ) | email:darki@multimania.com | /` ( /(/ |_________________________________| \\ " Ascii art by Shanaka Dias (snd) '==' Introduction This is the first tutorial (of many I hope) on programming various 2d and 3d effects. I am starting off...

Complete HOW TO of polygons

DrWatson's profile picture
Published in 
 · 20 Jan 2024
released 12-01-94 by Voltaire/OTM (Zach Mortensen) email: mortens1@nersc.gov INTRODUCTION After receiving numerous requests to do so, I have compiled a HOW TO doc on polygon filling. It seems that a lot of people out there are a lot like myself, they really dislike using other people's code because it is extremely difficult to figure out, especially if it is highly optimized. Sometimes text files are the answer, often times however they do more harm than good. When I was writing my 3d engine a few erroneous text files caused me to waste several days debugging, and in the end I wound up deriving everything on my own. Hopefully I ha...

voxel landscape explanation/demo

DrWatson's profile picture
Published in 
 · 20 Jan 2024
otmvoxel released 11-08-94 voxel landscape explanation/demo by Voltaire/OTM all source Copyright (C) 1994 Zach Mortensen email: mortens1@nersc.gov see OTMVOXEL.NFO and OTM-94.NFO for more information OPENING WORDS I make the assumption that you have at least some experience in writing 3d code. You should not attempt to understand voxels if you cannot understand the basics of 3d. If you are interested in the 3d engine used to make this demo, it is availible via ftp at hornet.eng.ufl.edu the archive is /demos/code/graph/library/V3DT090.ZIP I highly recommend picking it up (unbiased opinion of the author ;)) WHAT ...

Technique for the Phong shading based on linear interpolation of angles

A new approximation technique for the Phong shading model based on linear interpolation of angles

DrWatson's profile picture
Published in 
 · 20 Jan 2024
released 3-30-95 by Voltaire/OTM [Zach Mortensen] email: mortens1@nersc.gov IRC: Volt in #otm, #coders INTRODUCTION Realtime phong shading has always been a goal for 3d coders, however the massive amount of calculations involved has (until recently) hampered progress in this area. When I first heard the term 'realtime phong shading' mentioned about 6 months ago, I laughed to myself at what I perceived was an oxymoron. In my experience at the time (derived from reading several 3d documents), phong shading required a tremendous amount of interpolation and one square root per pixel. Even with lookup tables for the square root fun...

Sorting algorithms for 3d graphics

DrWatson's profile picture
Published in 
 · 20 Jan 2024
released 2-20-95 by Voltaire/OTM [Zach Mortensen] email: mortens1@nersc.gov INTRODUCTION During the past month, I have received many inquiries concerning sorting algorithms used in 3d engines, which are the fastest, etc. I figured I could save myself some IRC and email writing time by compiling a text on the matter that would explain everything in a concise manner. In this text, I will describe various sorting algorithms, and the pros and cons of each. This primarily covers variations of the radix sort, which I have found to be the fastest algorithm. A fast sort is critical to a fast 3d engine, perhaps even more critical than a fast p...

A Cheater's Form of Z Clipping

DrWatson's profile picture
Published in 
 · 8 Jan 2024
A Cheater's Form of Z Clipping By Ian Romanick, idr@cs.pdx.edu In the 3D graphics realm, it is necessary to perform clipping to the Z plane. This operation is computationally expensive, not only because it typically involves a number of multiplies and divides and must be performed on a polygon to polygon basis, but also because it can degenerated triangles in to quadrilaterals. In systems that are based solely around triangles, the degeneration into quadrilaterals can cause an incredible increase in complexity and computation time. A very simple solution to this problem exists, that is perfectly acceptable in many cases. This paper wi...

Bilinear Interpolation of Texture Maps

DrWatson's profile picture
Published in 
 · 8 Jan 2024
Introduction Do you sometimes notice that when you texture map, the screen looks a little jaggy? Do your texture look pixellated? Well, there is a way around that. You filter your textures. In this file, I'll explain some of the more common techniques, and fast implementations of them. Bilinear Interpolation Bilinear interpolation (now on called 'bilerp' for short) is a process of filtering the surrounding texels, to smooth out any jaggies occurring between pixels, and giving the screen a smoother look. The basic calculation is as follows (from a post to usenet, author unknown): double texture[N][M]; // 0 <= x <...

SPEEDY FREE DIRECTION TEXTURE MAPPING AND OTHER NIFTY TRICKS

DrWatson's profile picture
Published in 
 · 4 Jan 2024
Hello, my friend! You are viewer nr 3098 since December 1995 of: SPEEDY FREE DIRECTION TEXTURE MAPPING AND OTHER NIFTY TRICKS Some Wild-Ass Speculations and Untested Theories (that will work :-) by Håkan 'Zap' Andersson, 95-02-02 Throw me a mail at: zap@lysator.liu.se -1. Greed/Copyright If you use any of this stuff in your commercial game, I at least think I deserve to: Be mentioned and thanked thoroughly in the game. Thank Hakan 'Zap' Andersson, zap@lysator.liu.se Receive a copy of the game!! Receive obscene amounts of cash :-) If you fail to comply to the above, it may turn out that I had already patented all algori...

Bump Mapping

DrWatson's profile picture
Published in 
 · 4 Jan 2024
(c) 1995 Brian Lingard Introduction This article will briefly summarize Blinn's method for performing bump mapping and will skip over some of the mathematical detail. Interested readers should consult the references given at the end. An example of applying bump mapping to the task of embossing is given in the second section, along with some sample images and source code. Blinn's Method In 1978, James Blinn presented a method of performing what is called bump mapping. Bump mapping simulates the bumps or wrinkles in a surface without the need for geometric modifications to the model. The surface normal of a given surface is perturbe...
loading
Neperos cookies
This website uses cookies to store your preferences and improve the service. Cookies authorization will allow me and / or my partners to process personal data such as browsing behaviour.

By pressing OK you agree to the Terms of Service and acknowledge the Privacy Policy

By pressing REJECT you will be able to continue to use Neperos (like read articles or write comments) but some important cookies will not be set. This may affect certain features and functions of the platform.
OK
REJECT