Skip to main content
gamedev.net
🔒 Locked

vertex shaders

Started by Rocket05 Jan 9, 2002 at 2:59 PM 1 replies 400+ views
Original Post
Rocket05
Rocket05
ever since d3d8 came out, ill ive heard about are these vertex shaders. what are they exactly? are they just microsoft''s new term for their flexible vertex format?
"I never let schooling interfere with my education" - Mark Twain
S1CA
S1CA
Nope. You''ll also find them called "vertex programs" in some OpenGL extensions.

Traditionally the transformation & lighting part of the pipeline exposed by APIs like D3D has had fixed functionality - it transforms vertices in a certain fixed way, applies lights in a fixed way, and transforms texture coordinates in a fixed way. The FVF code allowed you to turn parts of this functionality on or off and nothing else.

A vertex shader is a small program written in a "shader language" which totally replaces the part of the pipeline between just after the vertex is fetched to just before the clipping takes place. The beauty is that you get to write the shader program and therefore get complete control over how the transform and light works - all the times with the FVF system you thought "if only I could just do xxx to the vertex".

The shader language gets translated into on-chip microcode by the driver for capable hardware (e.g. GeForce3). On older style hardware under D3D, the program gets translated/"compiled" into CPU specific code so is only marginally slower than the fixed function pipe.

You write the program in a specialised assembly language where every register is a 4 component vector of 32bit IEEE floats. The instruction set is geared towards transformation & lighting so is almost all maths operations (dot product, multiplies, lighting fragments etc). There is currently no branching, subroutines, or access to any other vertices (its a "stream" model, designed to be easily translated to SIMD/parallel type processing hardware).

Take a look on the nVidia, ATI and MSDN websites for more info.

--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com
Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site
Vlion
Vlion
Sweet !
I`ve got to get my hands on DX8

the bugle4D engine;
a new dimension in graphics...
[link]http://members.tripod.com/thefivelions/bugle4d/[/link]
~V'lionBugle4d

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.