Jump to content
  • Advertisement
Sign in to follow this  
yodaman

OpenGL starting work on my renderer...

This topic is 5014 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites
Darnit. Forum logged me out again. That should have been:


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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!