starting work on my renderer...

Started by
3 comments, last by Mayrel 19 years, 6 months ago
Hiya! Im working on a project which I hope I can someday call a game engine. Ive just gotten, well most of the framework done such as the system code, utilities and math lib etc done so now I want to start on the renderer. In my basic design, the renderer will be a collection of code such as wrappers for opengl, cg shader class, lighting class, shadowing, decals, basically anything thing that makes polygons look good. This all will be build into a dll and interfaced by a single 'renderengine' class. The terrain engine, model and animation engine etc will all of course use the render core but will be seperate from the dll. What Im having a bit of a hard time with is this: should I create a common triangle and mesh class and derived from these or should I just create functions in the model classes which have methods for doing whatever I need? I personally think that I should create a common mesh class and derive both models and the terrain patches from it. Alrighty, well thats the basic design of my engine... all low level code that has to do with shading, clipping, splitting, texturing, etc a polygon, is part of the render engine. How does that sound?
www.jinx.com www.thebroken.org www.suprnova.org www.mozilla.org
Advertisement
well it looks like I made a bad post. 69 viewers 0 replys.
www.jinx.com www.thebroken.org www.suprnova.org www.mozilla.org
I think it;s more that you're not really asking a question... You kind of answer your own question, and even if you didn't I think it's a matter of personal prefrence.

If you want more feed back post more specific questions.
Quote:Original post by yodaman
Hiya!

Hi.
Quote:
What Im having a bit of a hard time with is this: should I create a common triangle and mesh class and derived from these or should I just create functions in the model classes which have methods for doing whatever I need? I personally think that I should create a common mesh class and derive both models and the terrain patches from it.

I have a top-level Model class that contains virtual functions for rendering the object and doing collision testing and whatever. Then I derive specific classes from that:

Model
NullModel (Has no physical form, used to hold sound effects or lights)
Sprite (2D billboarded thingy)
Mesh (Something made out of triangles (virtual))
StaticMesh (Doesn't move. (Allows for optimisation) (virtual))
SimpleMesh (Just a list of triangles.)
BspMesh (Partitioned.)
PortalMesh (Portalised.)
OctreeMesh (Octreed.)
DynamicMesh (Does move. (virtual))
InterpolatedMesh (Interpolates between SimpleMeshes.)
SkeletalMesh (A SimpleMesh skin over an DynamicMesh skeleton.)
RagdollMesh (Does physics. Is a skeleton for SkeletalMesh to use.)

I may be able to improve things. For example, I might have a superclass specifically for Skeletons, so that people don't try using a SkeletalMesh as the skeleton for a SkeletalMesh. Unless doing that proves to be useful.
Darnit. Forum logged me out again. That should have been:

Model+-NullModel+-Sprite`-Mesh  +-StaticMesh  | +-SimpleMesh  | +-BspMesh  | +-PortalMesh  | `-OctreeMesh  `-DynamicMesh    +-InterpolatedMesh    +-SkeletalMesh    `-RagdollMesh

CoV

This topic is closed to new replies.

Advertisement