Archived

This topic is now archived and is closed to further replies.

scubabbl

The Render

Recommended Posts

Is it better practice to have your render function collect data from objects (Position etc) and then draw the objects to the screen, or is it better to give the objects their own drawing functions and just have the render function determine the order for things to be drawn and just have the objects on the board draw themselves?

Share this post


Link to post
Share on other sites
i prefer to have the renderfunction to choose how to draw, and the object has a function draw() that sends then it''s actual data and information (to the gpu)..

that way, i can implement for example sketchy,cartoony,or what ever sort of rendering by replacing the renderingfunction, and i can even go multipass if i need by replacing the renderingfunction. the objects can still draw themselves the same way.. it''s sort of
the object knows how it looks like
the viewer knows how it views stuff
and together, you get a nice image

"take a look around" - limp bizkit
www.google.com

Share this post


Link to post
Share on other sites
Well, I prefer another aproach:
Each object has a list of "view interfaces" - all derived from a base class. I can add/remove such view interfaces to an object and call the object to view itself using one interface... Basically, the object is just a physical mesh object, so it does not know how to view itselfs -> so the view interfaces.
That way you can write a view interface for GDI, for raytrace, for OGL, DX... whatever. The base view interface just knows how to access object geometrical data.
That''s the basic ideea. Stuff can get more rafinated.
Pet.

Share this post


Link to post
Share on other sites