Skip to main content
gamedev.net
🔒 Locked

Renderer *Behavior*

Started by Grizwald 1 reply 300+ views
Original Post
Grizwald
Grizwald
I''m in the process of creating a renderer for my engine, and i was wondering what behaviors or traits a renderer would have. These traits or behaviors wouldn''t be in a renderer class, but would be given as template arguments to another game object, lets say a mesh: CMesh Monster blah blah Some things i''ve though up: an API trait - does it use OpenGL or D3D? a style behavior - line, point, fill (maybe non-photorealistic?) a texture mode behavior - anisotropic, bilinear, nearest point Thanks for the input, i''m a little stuck. I''ve been scribbling these for days in study hall :D
I love me and you love you.
darookie
darookie
I don''t consider template arguments as a good solution for this.
The reason is, that you cannot change template parameters at run-time which would create a pretty rigid model for your renderer.

OGL and D3D both use states to modify the rendering behavior, so your 3d object classes should do it in a similar way.

To complete your behavior list,take a look at the available options for the APIs.

BTW. an API trait isn''t useful at all, since only one API can be used at a time and the renderer core has to be different for each API.
An abstract renderer base-class however, is a nice idea.

You could also add fancy things like shaders, lighting model,
shadow casting method, transparency, ...

Topic Locked

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

Sign in to reply to this topic.