Fun at 700MHz VI: physics engine

2009-11-04 at 18:37 | Posted in Computer path | Leave a comment
Tags: , , , , ,

Have you ever find your self playing much longer than predicted with some kind of physic engine, moving things around just to see how they react?. It just became unbearable not knowing how to make a physic engine so I studied some papers and made this one. When a spinning top shows precession without you having programmed it explicitly you know the physic engine is working right?

Fun at 700MHz V: commercial game

2009-11-04 at 18:21 | Posted in Computer path | Leave a comment
Tags: , , , , ,

This is a game called Resurrection for Dinamic we did with a small team, we where just 4 artists and 2 programmers:

Fun at 700MHz IV: procedural textures

2009-11-04 at 18:12 | Posted in Computer path | Leave a comment
Tags: , , , , ,

Ray tracing wake me up to the enormous possibilities of things that doesn’t exist and because so have infinite detail level and cost 0 bytes of data to store, procedural textures:

Fun at 700MHz III: aliasing

2009-11-03 at 19:32 | Posted in Computer path | Leave a comment
Tags: , , , , ,

We graphic programmers spend our lives fighting against aliasing, it always gets in the way and most of the time complex and heavy cycle consuming strategies are needed to fix the problem. But aliasing can also be harnessed to produce beautiful images, think of aliasing not as some ugly effect that appears when you try to render your images but as: the interference between two unequal patterns. These are some experiments based on the RayWarping engine following these theme, the potential for procedural textures is significant:

Fun at 700Mhz II: RayWarping videos

2009-11-03 at 16:51 | Posted in Computer path | 1 Comment
Tags: , , , , ,

Here there are some real-time videos captured from the RayWarping engine, everything is pure ray tracing. First a video of a procedural city, the textures are hand-made from photos. You may find interesting the first rotating pseudocube (about 45 seconds into the video) above the trees, it is in fact a rotating tesseract projected from 4D into 3D, all is real-time with no precalcs. The ground and the pond have bumpmapping. There are spheres, cones, cylinders, boxes and non-linear cones featuring as geometry. Some of the portrayed materials are crystal and mirror:

This is a realtime walk trough a procedural infinite texture that never repeats itself and shows interestingly symmetric patterns, I call it ‘Alberto’s Maze’. In fact it was later used on my Raydiosity engine as the base for some procedural city like blocks:

Finally just a bunch of geometry randomly put all over the place to see how the RayWarping engine reacts to chaotic arrangements:

Fun at 700MHz: RayWarping renders

2009-11-02 at 14:35 | Posted in Computer path | Leave a comment
Tags: , , , , ,

So I bought a K7 at 700MHz which is still working 24/7 as server at my home and then put it to work: ray tracing rules, I felt that at a very deep level, so I immediately concentrated all my efforts on making a real-time ray tracing engine. It was a little tricky at 700MHz and so it teach me interesting things. This engine was called RayWarping, it was able to move in real-time at low resolution and also synthesising HQ static images usually in less than 10 seconds. To support fast ray tracing I developed a spatial partition I called CNP (Cubic Neighbor Partition). It was in essence a non uniform grid with each face of each cell communicated with each neighbor trough a 2D binary spatial partition. Here are some examples of static images (for real-time videos see next post):

From Intel to AMD

2009-11-02 at 14:00 | Posted in Computer path | 1 Comment
Tags: , , , , ,

Except my first 8 bit computer all the rest until now used Intel CPUs, but not any more AMD began building seriously good cheap chips and so I decided to buy a K5 at 400MHz, what a good processor. Again I felt the duty of putting to use all that new power and began to understand that, with time, raytracing was going to be just the best way to represent things. This are my fisrts experiments:

32 bits rules

2009-11-02 at 11:47 | Posted in Computer path | Leave a comment
Tags: , , , , ,

Yea, I was buzzing with excitement when I got my first 32 bit computer, I jump from a 286 directly to a wonderful 486Dx2 66 MHz without ever having a 386 (which I regard as an incredibly good CPU for that time anyway). I think it was then I began to feel a kind of obligation to make programs that put to use all that overwhelming computer power for a good cause. The math coprocessor of the 486 worked amazingly fast (this was the first Intel CPU with integrated math coprocessor) and I decided to stop using integer fix point arithmetic in favor of 32 bit floating point maths. So all the operations started to be much more accurate and a myriad of new possibilities became reachable. Also the games were better, much better, in fact I spent so much time playing Doom that I could see corridors passing by when I closed my eyes, for real, not joking man. Then I got a Pentium 133MHz (without the division bug) and the floating point arithmetic became so fast I couldn’t believe it. So I kept improving my engines and did a two player tank game among other things. Since the game was made absolutely from scratch it teach me a lot, specially about 3D collision detection. Of course I stopped using Turbo C and started enjoying the DOS4GW world of real 32 bit indexing RAM, so much fun.

From 8 to 16 bits

2009-10-30 at 15:56 | Posted in Computer path | Leave a comment
Tags: , , , , ,

It was really like a giant leap for me when I finally manage to save enough money to buy my fist PC, a 286 with 287 at 16 MHz, 1024 Kb of RAM and 40 Megabytes HD. Of course the more immediate thing I noticed was the MHz jump, everything going so ‘fast’. But there was much more to it, for example I was amazed that I could operate with 16 bit integers natively, and with very little overhead even 32 bit integers!, for sure I would never ever going to need more than that, I thought. In spite of all that, there was something even more sweet for me: now I had machine code instructions for multiplication and … even division!, what an incredible thing. It was then that after some more Basic and Assembler I went right to Pascal and some time later to C. Once I learn enough C I never looked back and began developing some games, some IA programs (automatic maze construction, ecosystems on regular square grids of plant-eating worms, 3D puzzle solvers, chess horse problem…), my first 3D engine (it drew only lines, but they were… very straight and… beautiful), some Mandelbrot and Julia set generators, an emergent based electronic circuit simulator… . Then I started to recognize the value of polygons and made my first opaque polygon engine and used it to procedurally generate landscapes very similar to the excellent 8 bit game ‘The Sentinel’. This engine used integer fixed point arithmetic for all 3D operations. A tweaked 320x240x256 mode was used so it looked nice, for those days. And… of course I spent a good amount of time playing games like Scorched Earth, Starcon, Gengis Khan & Bandit Kings of Ancient China, Iron Man, Monkey Island, Loom and many more.

The digital beginning

2009-10-25 at 19:58 | Posted in Computer path | Leave a comment
Tags: , , , , ,

When I was 6 or 7 years old something happened that changed my life forever. I was alone at the lunch room of my house watching TV and a brief documentary about computers was broadcasted. It explained how binary numbers worked and barely anything more, but I knew instantly that was something I wanted to know better. I took notes on a small notebook and for days I fantasized about what a computer could do and how in the world could be programmed. I didn’t know then but eventually I’ll be able to have my own computer!. Fast forward a couple of years and technology was already giving me the opportunity to realize my dream. The campaign for ‘Buy a computer for the family’ began and approximately 1 year later I got an Amstrad CPC 464 with a Z80 at 4Mhz and 64 Kbytes of memory, it used regular music tapes as data storage and came with a fairly good handful of games. It also had a very safe green monitor. This computer is still working perfectly and from time to time I take it out and play some old games loaded from music tapes with my wife María. My first program wrote my name indefinitely on the screen. With no training available I began teaching myself reading books and it was very hard. With time the ways of the bits became, little by little, unfolded before my eyes and I knew it was a life long attraction. In  those good old times loading a game was a game in itself, it could last about 10 minutes and at any moment a read error could arise forcing you to readjust the header height and restart from the very beginning the game loading. At first I programmed in Basic then I learnt Z80 Assembler with a very good book from Rodnay Zacks. I lacked an assembler so I programmed directly in hexadecimal machine code, of course I was very relieved when an assembler finally turn my way. As time passed I began to have more fun cracking the games than playing them, some of the protections where impressive and smart, one on them lasted until the very end but got finally broken. Simplifying it was a piece of code that started with a loop that unencrypted all the rest of the code (that was apparently garbage until that moment). That action made appear a new loop just consecutive to the first and when execution got there, a new loop was reveled. Each loop was different, all the loops used the R register that changed value upon instruction execution, so you couldn’t just trace over the loops because the execution of the tracer instructions changed R value and corrupted everything. It did some more dirty tricks, a really beautiful protection. Some of my favourite games where Elite, Manic Miner, Nebulus and Ghost & Goblins. I had much fun coding a 3D editor, some games, 3D fractal generators, 2D sprite editors, some artificial intelligence routines, the classic Game of Life, a Basic totally translated to Spanish and many more things.

This was an eye opener for me, I learnt what a height field was, and using the second swapping RAM bank this real-time movie was possible on my old 8 bit computer:

Having more fun with the ‘big’ second bank of memory of 64 K bytes:

The Amstrad CPC had a video chip that could be persuaded to do a kind of thing similar to scroll, the good thing is that it was an instant operation. In this program that feature is used in combination with very simple trigonometry to animate a kind of spiralling cross:


My father took me to a science museum and I liked a pair of rounded square gears so spent some time deducing the right proportions between radius, sides and separation and then tested it on the 8 bit computer:

« Previous PageNext Page »

Blog at WordPress.com.
Entries and comments feeds.