The engine does this for most is not all of the models in the world, but I will focus on a character.
-----------------------------------------
They use 3d Studio Max, Maya, lightwave, (whatever) to create the highest resolution model of the character they can muster. Each part is textured with the desire material and it comes out looking like it does on the Doom III: Legacy video. That''s a definate.
Next they use some algorithm or plugin for one of their work shops to create a low polygon count version of the model, but they don''t skin that directly. They use the high poly model (I''m guessing 500,000 polygons) to save a texture for each part they can deform seperately (head, torso, legs). The low poly model is used for UV coordinates for the pixels on the high poly model.
Next, a bump map is generated using the same technique. Only instead of determining which color pixel goes on the texture, depth measurements are calculated at every pixel generated before and written to the bumpmap as depth values that coorespond to each pixel (texel) on the previous map. (depths between high poly model and low poly model)
All of the UV coordinates line up to the low poly model, but because of the Dot3 bump mapping, the texels are extruded to the height they would be on the higher resolution model. (creating veins, wires, pipes, bevels, smooth curves, etc.)
------------------------------------
**\/*\/*\/*\/*\/*\/*\/*\/*\/*\/******************
Does Anyone know how this is normally done and if my speculation is correct?
**\/*\/*\/*\/*\/*\/*\/*\/*\/*\/******************
During runtime, blood, dirt, urine, whatever are either textured or stenciled on.
Also, for lighting reflections, he uses a cube map.
As for casting shadows..I''ve seen some of the shadows in the legacy Video, and upon studying them closely, I believe he gets away with the low poly model as the caster. The Only way I know how to do shadowing using the stencil buffer is the "Carmack" way.
Stencil buffer Shadow Casting Rundown:
quote:
It''s very simple. If you don''t know what a mask is when rendering or blitting is, basically it''s a and/or/not/xor operation where it tests the destination pixel to see if it''s non zero. If the pixel is non zero (for a 1 bit stencil buffer), it will render to that pixel on the screen using an alpha value which is blended onto the current pixel.
Ok, how the method works: get a papel towel tube and cut one end until it is 45 degrees. Now slit the tub completely in half the long ways. You should have 2 half-tubes, one shorter than the other. The uncut ends of the tubes represent the object casting the shadow.
Now, Pretend the outside of the tube is the face of the polygons that make up the shadow volume (the entire tube is the shadow volume). Notice if you look at the tube with the longer one in front, and the shorter tube in back, the faces of the polygons on the back(short tube face away from you.
3D programs naturally have a way to tell when a polygon is facing away from you (and you can''t normally see it), they specify the verticies in Clockwise order. When the verticies run counter-clockwise, they are facing away from you and don''t need to be drawn.
ok, The Z-buffer stores the z values of everypixel on the screen. When rendering to the stencil buffer, it is possible to check the z buffer to makesure we don''t render behind anything we can see past. or in this case, cast a shadow past.
Place a peice of paper on the table and hold the longer tube facing you where you can see all of the outside of it, and the cuts should be perpendicular to you. Mark around the bottom where it meets the paper. Now, from your point of view, draw lines on the paper that look like they line up with the tube from your viewing direction. You won''t be physically tracing the tube, as it will be suspended off the paper, but from your perspective, you should see the lines line up with the edge of the tube.
Pull that off the paper and you should see an oval the extends off in one direction. The first pass rendering to the stencil buffer does this. It renders all of the polys facing you (they are in Clockwise order from your perspective). This increments the spots between the lines and clips according to the Z-buffer (your zbuffer says you can see therough the table)
The second pass renders all of the polys facing away from you, only this time, they decrement the values they touch.
Line up the second half of the tube on the paper where the first tube ended, and line it up visually with the lines you drew before for the shaft of the first one. The outside of the tube should be facing away from you and the concave portion of the bottom facing toward you. Trace the bottom edge with a different color pen and trace the shaft on the paper with the different color. Everything boxed in by the diferent color was decremented, and when we render to that part, it is masked off and won''t recieve the alpha blend color.
After implementing this for all objects in the scene, a large quad the size of the screen is rendered to the scene, only rendering the pixels that have a non zero value in the stencil buffer. Usually, the color of the quad is dark grey, and it is alpha enabled, so it blends with the current scene, creating all of the shadows. Note: while rendering this final quad, it clears the stencil buffer for the next frame.
I''m more concerned on how to create the bump maps and the textures. Does Anyone know how this is normally done and if my speculation is correct?