Not logged in, Join Here! or Log In Below:  
News Articles Search    

Submitted by Wolfgang Engel, posted on February 09, 2002

Image Description, by Wolfgang Engel

The screenshots in the upper half of the IOTD are part of an article named "Photo Realistic Faces with Vertex and Pixel Shaders", which will be published with the source of the necessary tools (diffuse cube map generator, a texture mapping cylindrical wrapper (MAX Plugin)) and an example program in the book ShaderX - Vertex and Pixel Shader Programming Tips & Tricks (Wordware Inc., May 2002). This article shows step-by-step, how to prepare art in a way, that the result looks photorealistic and it explains each line in the source code needed to produce photo realistic faces with the help of vertex and pixel shaders in real-time.

The top left picture are two photographs from a digital camera that the technique starts with. It was taken in complete darkness with a Digital Camera with a flash attached. The green backgound was built from some fabric purchased at a fabric store and glued onto some poster board.

The two screenshots in the second row of the left half of the IOTD shows the differences between no spline blending and spline blending. Spline blending is used by the cylindrical wrapper that is provided with source as a MAX plugin. The screenshot on the top right shows the various layers used to make the final image for normal 3D lighting. The bottom left shows three cube maps that are used in environmental lighting.

The last screenshot in the lower right corner shows a final image when environmental lighting is used.

Each of these renderings can be done in one pass on a Geforce3 and two passes on Geforce1 and above. This effect can be achieved in 2 passes on multitexturing capable hardware by using sphere maps.

The screenshots in the lower half of the IOTD are part of an article named ""Designing a Vertex Shader-Driven 3D Engine for the Quake III level and Shader Format", which will be published with the source of a Quake 3/Return to Castle Wolfenstein level viewer in the book ShaderX - Vertex and Pixel Shader Programming Tips and Tricks (Wordware Inc. May 2002). This article shows, how to implement a shader system for a current game engine.

The example program converts the Quake 3/RTCW shader scripts to vertex shaders while starting up. The author Bart Sekura divided the Quake 3/RTCW shaders into three categories to facilitate the setup code as well as provide easier and more optimized code paths for rendering:
  • The first one is the default Quake III shader that uses base texture and lightmap texture and constant diffuse. There is no vertex or texture coordinate deformation and diffuse color is not coming from vertex stream data. This is by far the majority of shaders, also known as default shaders, automatically created when there is no explicit script code. Primarily used for basic world geometry. The second category is very similar to the above shader type, the difference being the diffuse color is coming from vertex stream. It also uses base texture and lightmap. Used primarily for mesh models embedded in world geometry.

    The third category covers all non-standard shaders, which represents arbitrarily complex shaders, with one or many passes, various vertex and texture coordinate deformation functions, etc.

    Read more on ShaderX at

    Image of the Day Gallery


    Message Center / Reader Comments: ( To Participate in the Discussion, Join the Community )
    Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.

    February 10, 2002, 03:13 PM

    Awesome! Just awesome. I don't know what else to say. (Well except that this is probably going to be a great book to have. ;)

    Jari Komppa

    February 10, 2002, 03:21 PM

    YES! A book about directx that doesn't waste 1/3 of the pages on basic win32 api programming!


    February 10, 2002, 04:00 PM

    At last here are the screenshots!. WOW. I´ve been waiting for them since I read on February 2nd in that they will appear as IOTD in a few days. Great looking book, I love the Gems "foramt". When could we see more screenshots?.

    Anyone who wants to see the book´s contents, here is the link


    February 10, 2002, 04:04 PM

    very interesting idea (converting q3a shader scripts to gf3 vertex shaders)!

    just one question though: how do you plan to overcome the lack of subsurface scattering modelling on normal 3d accelerated cards to give photorealistic faces?

    still, it's by far the best face rendering i've seen :) great job!


    February 10, 2002, 04:29 PM

    Amazing work! Definitely looking forward to the book... and lewarning how to do more than hello world apps ;)

    Kenneth Hurley

    February 10, 2002, 05:22 PM

    Hi, Kenneth Hurley here. I did the facial stuff for the shaderX book.

    Yes, sub-surface scattering is a hard problem. I'm sure we'll be able to solve that with the next generation hardware!

    I looked into Henrik Wann Jensen's BSSRDF stuff, but it's still not perfect, but pretty close. There might be an elegant solution for the current generation of hardware, but I didn't have the time to research this fully.


    February 10, 2002, 07:13 PM

    Never had a need for vertex/pixel shaders, but nonetheless this looks to be an interesting addition to the 3D programming books. Look forward to reading it.


    February 10, 2002, 09:26 PM

    Hi ken, I thought that face looked like you! I can't wait to read your article and all the others. This will be an awesome book.


    February 10, 2002, 09:33 PM

    It's about time the IOTD went up. I didn't expect this, what an awesome set of shaders.

    I can picture it now, everyone will be mapping there faces into quake.

    Keep up the good work even after ShaderX is done.

    Roch Denis

    February 11, 2002, 02:52 AM

    Hey you're using flipcode for promotion, wont work on me... err
    *glazzed zombie look* Must... buy... book!


    Cant wait to get that book !


    February 15, 2002, 05:27 PM

    Man, that guy's face looks totally real!!! Except for the eyes... they're a little frightening! Perhaps it just looks that way because he saw this IOTD post too? Oh wait, I'm caught in an infinite logic loop!!! Help! Someone throw me a life ring!

    This thread contains 11 messages.
    Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.