🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Question about Direct X...

Started by
1 comment, last by MSW 22 years, 6 months ago
I''m planning out a ''cel rendering'' 3D engine. I''ve read lots of articals on doing this in DX and OpenGL, etc...but I''m not aiming to actualy ''shade'' the image as in anime...I''m wanting to something more ''flat'' shaded (if that makes sense)... So this might not really be the correct place to ask...but I come from a long history of DOS programing and am just getting up to speed with Windows and OO structures... The plan right now is to do software rendering, with possibly, subdivision surfaces (for added detail) with a assembly written flat shaeded triangle rendering routine (with Z-buffer) where the first and/or last pixel of the scan line could be set to black (depending on the slope of the line it defines)...fairly simple right? easy enough to implament for a software 3D modeling/animation rendering program (Lightwave, etc..) Now doing this realtime at a minimum resolution of 640X480 could be a problem... Now I can create a DDdraw surface in non-video memory...lock it down...render the polygons...then blit the whole thing to video memory...I''m not looking for 60+ FPS...but my question is how many polygons could I render this way on a typical 450Mhz PC...keeping in mind I''d need to update the z-buffer as well? Also do I have to mess around with video memory banks and such, or would DX handle all that? PS: as bad as this sounds I really wouldn''t need much more then 8-bit color depth...I''d think...which could really help speed up the rendering routine... Thanks
Advertisement
umm if you are going for the old school flat shading. thats simple. just tell either opengl or d3d to switch the shading mode from gouard to flat shade mode (which is not cell shading, but literially one color per polygon face)

quick info on shading modes:

flat shading: what you want. one color per polygon face. the is figured out by a per polygon normal from the first vertex of the polygon.

gouard shading: the normal shade method. lighting is calculated at each normal and interpolated acroos the face.

phong shading (not support by most cards): even better since its per pixel by interpolating the normal across the face and doing some other things (heh google has better explaination)

cell shading: not a true shading mode and must be done using vertex shaders and other tricks with textures. it is designed to create bands of color by lower the number of shades of colors used. this is done by a 1d texture. this is not what you want.

so basically you are not after cell shading but flat shading.
Yes, Im after flat shadeing...but not quite the way you are thinking...there is no lighting to speak f...so each polygon has an assigned color...additionaly each edge is linked to another polygon...if the linked polygon isn''t visable it would draw the edge as a black line...

I know I could use the 3D accelerator cards for the flat shaded polygons...but adding in all the black lines presents a lot of problems, because I DON''T want the line thinkness to change...it''s always going to be one set thickness....I could go back and render black polygons to approximate the lines...but this adds complication and could actually slow things down more then doing it all in software (there may only be 700 polygons on the screen...but If I needed to go back and draw every edge...that would add 21000 "black line" polygons for that one frame...not something I want to do)...and useing a stencel buffer is out of the question as not all cards support them.

This topic is closed to new replies.

Advertisement