Articles: Graphics
 

Bookmark and Share

(7) 
Pages: [ 1 | 2 | 3 | 4 | 5 | 6 | 7 ]

CgFX in Practice

CgFX works with the fifth version of max and with DirectX API, only. If your project demands OpenGL, you may stop reading any further: you will find no useful info for yourself. Max doesn't allow this: you will have to export a scene for a standalone CgFX Viewer program and process the shader there. Thus, you won't use the advantages of the max operational environment.

Or you can choose an alternative: NVIDIA has already issued a similar plug-in for Maya, which works with OpenGL only. By the way, developers say that in this case OpenGL instructions are translated into DirectX ones to be performed. And in fact particularly the fifth version of max is required because only in this version, the material editor has a new tab called Viewpoint Shader Manager through which you access the hardware shader functions.

The last requirement deals with the graphic card you use. If you are planning to take full advantage of CgFX, I strongly recommend you to use a graphics card with the last-generation GPU from NVIDIA. Shaders may not run on “older” GPUs at all, or will be emulated, that is, executed by the central processor. It is really slow.  Moreover, no interactivity is to be mentioned in this case.

So, 3d studio max 5 is configured for DirectX API, your workstation has a Quadro FX (or at least GeForce FX) graphics card, and the object is loaded – what comes next? Next you launch the material editor, find the Viewport Manager tab, select CgFX in the list and check “Enabled” on the left.

After that, you gain access to the “Viewport Shader – CgFX” scroll that contains Material Mapping Options and Connection Editor. The first is for bitmap processing, the second is for setting up the user-defined parameters of the hardware shader.

The name of the file with the shader is displayed above the “Connection Editor” button.

As for the bitmaps, they are analogous to the bitmap slots of the standard part of the materials editor – diffusion color, transparency, light and so on. Checking an option allows the shader to use this attribute at rendering. To do it, you must also load the corresponding bitmap into the properties slot in the standard part of the materials editor.

I'd like to stress the fact that it is the shader program that solely defines what material properties from the list are actually used. You can load all material properties slots with textures, but only those of them will be visible that are processed in the shader code. Conversely, if a bitmap is processed by the shader, but is not loaded in the materials editor slot, the object will be rendered wrongly (or may not be displayed at all).

 
Pages: [ 1 | 2 | 3 | 4 | 5 | 6 | 7 ]

Discussion

Comments currently: 7
Discussion started: 08/22/03 03:58:30 AM
Latest comment: 07/24/06 07:04:00 AM

View comments

Add your Comment