Graphics Engine Design

I am looking for material on designing a graphics engine. The main purpose of the engine will be tech demo development and function as  shader playground.

To start with I have some ideas about decoupling materials and shaders. I would like to have the flexibility that an object can have multiple materials. One part could be a diffuse surface with phong illumination, another part of the same object could be a bump mapped rusty surface with cook-torrance illumination etc.

If anyone could point me to some good sources to investigate or have some thought please share.

 

 



Answer this question

Graphics Engine Design

  • jude_kid

    You might want to check Yann Lombards posts on GameDev about graphics engines and shaders and all sorts of juizy stuff. You can find an index here: http://triplebuffer.devmaster.net/misc/yannl.php


  • QUT lecturer

     

    Have you had a look at the Xilath Engine that Pieter has been working on www.pieterg.com. You also might want to have a look at the shader tutorials on his pages. The tutorials that he goes through use his engine as a base.



  • Ixnatifual

    As I think has been hinted at already in this thread - what you're doing is far from trivial. Particularly when you mention that materials vary per-polygon and you have double-refraction type effects you could be working with higher requirements than a lot of AAA titles

    I've been working on implementing my own system lately, and the key part that I came to realise early on is working out what the basic fundamental building blocks were. Shaders are very powerful, but they have their limitations - not just in the features, but in the case of what is practical from a software standpoint.

    In my case I worked out what classes of effects I wanted to express - my engine (as I'll bet yours) does not need to represent every known type of material. Thus defining that subset is your first step. The next part was working out where these effects have common functionality and common input/output data. This, by extension, indicates those that do not share and have to be considered an effect class in their own right.

    With that information in mind I could put together a rough outline of the effect files, and how much I could run from the FX files and how much the application had to deal with.

    My engine doesn't have to deal with transparent objects (I like to cheat ) and materials are nicely grouped together (analagous to subsets in ID3DXMesh). This makes the application side of things trivial. However, in your case this isn't likely to be so - your application is likely to require some element of sorting and material management. I just hope for your sake that you don't have to end up rendering individual triangles!

    hth
    Jack



  • CorneVR

    Well, you could use the directX effect system, which contains everything that you really need to play with : materials (shaders, textures..). Also it supports multiple passes and so on. I think you should check out the NVidia FX Composer too.

    Anyway, in the other hand it would be good to know how to make one by yourself, but it isn't the easiest thing to do. So I suggest you start with the dx effect system before making one by yourself. There is plenty of tutorials in SDK to help you out with it.


  • David Cautley

    There is no easy answer to what you are looking. There is many ways to solve these things.

    I think that what you want is a ready graphics engine that can handle all of these. I think you should check Torgue or Ogre (don't know does these even support all of those effects, but they are worth of checking, what I'v heard). :)


  • NDaigneault

    Well I aint really looking for an engine.... I am designing  a shader/material oriented engine ;-) But I will defintely lookin to ogre.
  • OutlawPhx

    Thanks for the input, nice with some thoughts on the issuse.

    I already have most of the building blocks, and material sorting is definately something I will be needing. Currently I export 3dsmax objects to DirectX in an acceptable format so no need to render indivdual triangles. Also I can extract shader information from the files and with the effect file format I can retrieve render pass information. The hard part is the materials and a common subset would be a good idea.


  • Slyr133

    Hi Glenn, I have looked over the two articles, unfortuantely they seem to mainly concern them selfs with the overall engine design of a game. I am more interrested in creating a graphics engine and in how to create a flexible shader oriented engine with complex materials and multiple lighting models in essence on a per polygon basis.

     

     


  • thawzin

    I have looked into the posted sources. I think you have misunderstand what I am trying to design.

    I wish to render different models with multiple materials. We could have a 3ds max model with several materials.

    1 ) A rusty material defined by lets say a a decal map, normal map, and a gloss map.

    2) A double refraction glass material defined by an environment map and a shader performing dual refraction over multiple passes. 

    3) A translucent material required parial volume ray casting

    The materials will vary per polygon over the entire 3ds max model. The dilema is designing a framework capable of handling complex material properties without having to write a shader per phenomena.

    I want to have as low a coupling between materials and the actual model materials. The exact model composition ( materials) is not known pre hand...


  • jelo

     

    A while ago I came across the following 2 articles which may help you,

    www.gamedev.net - Enginuity http://www.gamedev.net/reference/programming/features/enginuity1/

    Game Engine Anatomy 101 - http://www.extremetech.com/article2/0,3973,594,00.asp



  • Desktop Alert Inc.

    Oh.. well, you should start from designing the basic classes for these. I have these classes in my effect system :

    CTexture - CTextureLayer

    CShaderDeclaration - CVertexShader - CPixelShader

    CMaterial - CEffect

    If you want more information about how I use this system, check out my engines sample code at : http://koti.mbnet.fi/arex/db/index.html

    Also if you want I can provide you with some basic class design diagrams from my engine (about the effect system). I haven't yet found an effect that I could not do with it, bump mapping, specular mapping, enviroment mapping, and so on...  :)


  • Graphics Engine Design