"Marble Bagels in the Tunnel"


Marble Bagels in the Tunnel... the next great cult movie coming to a computer near you ;-)


Note from Game Developer magazine editors:
Corrections to the September "Mixed Rendering" article

The article "Implementing Mixed Rendering," inadvertantly reversed figures 2a (pg. 36) and 2b (pg. 38). Also, the title for figure 2b (the true figure 2b) should be "Texture mapping composite and double buffer in SW thread." Second, we inadvertantly omitted credit for one of the authors, Herb Marselas. Mr Marselas is a Senior Engineer with the Intel Platform Architecture Lab. Having written a variety of software, Mr. Marselas is now focused on hardware and software issues in increasing 3D graphics performance. He can be reached at Herb_Marselas@ccm.jf.intel.com.


Note: Information in this document is provided in connection with Intel products. No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted by this document or by the sale of Intel products. Except as provided in Intel's Terms and Conditions of Sale for such products, Intel assumes no liability whatsoever, and Intel disclaims any express or implied warranty, relating to sale and/or use of Intel products including liability or warranties relating to fitness for a particular purpose, merchantability, or infringement of any patent, copyright or other intellectual property right. Intel products are not intended for use in medical, life saving, or life sustaining applications. Intel retains the right to make changes to specifications and product descriptions at any time, without notice.

OverDrive and Pentium are registered trademarks and Intel486, Intel487, Intel386, Intel387, and i486 are trademarks of Intel Corporation.

**Third-party brands and trademarks are the property of their respective owners.

(C) Copyright 1997 Intel Corporation. All rights Reserved.


Note: This application has been tested on with a Diamond Monster (3Dfx), a 3D Blaster (Rendition) and a Matrox Mystique under DirectX release 5. The application requires a 3D HW card with at least 4 Mbytes of memory - 2 Mbyte cards are not adequate. It also requires a computer with a CPU enabled for Intel's MMX™ technology. Please remember that it is demo software and is only meant to illustrate the Mixed Rendering methodology. Don't expect it to be bug free. If you have particular questions or comments on the code, please feel free to contact me. - H. Barad barad@iil.intel.com

The torus in the mixed rendering application is made up of about 400 polygons. It's procedurally textured in real-time using Perlin noise that's been optimized for MMX™ technology.

User interface

Ctrl-F1 - toggle lighting on/off

Ctrl-F2 - change the power of cosine for illumination

Ctrl-F3 - toggle complex/simple shading(only when light on)

Ctrl-F4 - cloud effect on torus

Ctrl-F5 - toggle texture resolution fixed/changing

Ctrl-F6 - change the number of noise octaves 2,3,4,5,6

Ctrl-F7 - change the style/color of the marble texture

Ctrl-F8 - toggle between marble and wood textures

Ctrl-F9 - toggle Z-buffering on torus

Ctrl-F10 - toggle between BLT and texture/SPOT compositing methods

Ctrl-F11 - scale up the object

Ctrl-F12 - scale down the object

When the wood is loaded, the light is shutoff.


The simple shading is just (very) simplified Phong-like shading. The complex one is based on object normal's perturbation by the noise. This affect can be done in two methods.


For more detailed documentation look at the code, procedural.c .



Code


This code is quick illustration of procedural texture mapping using fixed-point arithmetic and MMX™ Technology. Some parts of the application were not optimized ,and we expect better performance after fine tuning.


Note: some of the .c/.cpp files are D3D files from \dxsdk\sdk\samples\misc that were changed by us, so if you want to build the demo use the files provided in the zip file and not the regular D3D files from the misc directory.



Compilation


To compile the code you should create a project of 'application' kind under MSVC and insert all the .c, .cpp, .asm (or .obj if you don't want to deal with .asm compiling) files from the zip archive.


To assemble the .asm files you will need MASM 6.11d and add to your MSCV setting:


'path'\ml -c -Zi -coff -Fo$(TargetDir)\$(InputName).obj $(InputPath) under build command, under 'output files' add $(TargetDir)\$(InputName).obj


As well add:

Under 'C/C++-preprocessor': 'path'\dxsdk\sdk\inc

Under 'link': 'path'\dxsdk\sdk\lib\ddraw.lib

In the mixed app put the .ppm files in the directory where the app(.exe) is, or in the directory where the .mdp is if you want to run it from msdev.

Bugs

When compiling under MSVC 4.2 under "Release Mode," the optimizations cause a texture problem to the Tunnel texture. Therefore, we suggest compiling under "Debug Mode" without the optimizations. However, for added performance we suggest turning optimizations on for render.c.