Skip to main content
GameDev.net gamedev.net
🔒 Locked

Handling Different Draw methods - Diffuculty

Started by TristanRhodes Dec 21, 2004 at 1:19 PM 0 replies 800+ views
Original Post
TristanRhodes
TristanRhodes
Hi folks I've got to the point where I am building objects from a set of Vertices, Indecies and Textures. Now, i'd like to render these objects to the screen, but don't like the idea of handling all the drawing methods inside the object, it strikes me as pointless to have all my objects self painting... sounds like hard work and messiness. Idealy, i'd want the object to set the device buffers to the appropriate value and then let a rendering pipe handle drawing it to screen. This being done through some kind of interface. Once the device gets control back, I can pull out the paint args (polygon count, etc), and paint the object to the screen. My problem comes with the number of different paint methods there are. How can I determine which one to use, the objects will vary in how they are drawn? Also, which are more suited to certain uses? I'm trying to think beyond basic primitives here, some solid object with multiple jagged faces, etc. Maybe I could use some kind of enumeration, but that seems a weak way of determining which path to take. There has to be a more intuitive way, but it's eluding me. Cheers Tris
Lestat3D
Lestat3D
Hi, I think you're a little bit confused.
You've got to think a renderable object as a chunk of data understandable by the renderer. Then the renderer is able to render the object the way it has to be rendered. So, the method to use for rendering an object is given by its set of attributes. Those attributes can be from a D3DMATERIAL structure to a VERTEX SHADER, it's your choice, but you've got to organize the data to be interpreted by the renderer. Remember that the renderer only have to render what the occluder got to give to the renderer.

Topic Locked

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

Sign in to reply to this topic.