Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

16
  • 1
    I cannot seem to grasp the idea of "invert the dependencies away from the things that are difficult to design", are you talking about inheritance only ? Using the example of PSP / OpenGL, you mean instead of making a OpenGLBillboard, you'd make a OpenGLRenderer that knows how to draw any type of IBillBoard ? But would it do that by delegating logic to IBillBoard, or would it have huge switches or IBillBoard types with conditionals ? That's what I find hard to grasp, because that doesn't seem maintainable at all ! Commented Dec 18, 2018 at 20:28
  • @SteveChamaillard The difference is, say, PSP (limited hardware) must handle volume primitives using old school screendoor transparency and a different ordering of rendering evaluation: digitalrune.github.io/DigitalRune-Documentation/media/…. When you have one central RendererPsp which knows the high-level abstractions of your game scene, it can then do all the magic and backflips it needs to render such things in a way that looks convincing on the PSP.... Commented Dec 18, 2018 at 20:30
  • Whereas if you had such volume primitives requesting to render themselves, either their operations are so high-level that they're basically specifying themselves to render (which makes no difference except roundabout redundancy and further coupling), or the renderer abstraction is incapable of really doing things the most effective way possible on the PSP (at least without doing backflips, which it wouldn't need to do if the dependencies were inverted). Commented Dec 18, 2018 at 20:32
  • 1
    Ok i think I got it now. Basically you're saying that such concerns (i.e hardware) are so high level that making low level objects such as a BillBoard depend on those would be really hard to do ? Whereas a IRenderer is high level already and could depend on these concerns with a lot less trouble ? Commented Dec 18, 2018 at 20:54
  • 1
    With cutting-edge rendering concerns on disparate platforms, disparate hardware capabilities, it's too hard to design something where I'm the boss and tell it what to do. It's much easier for me to say, "Hey, I'm a cloudy/foggy thing with greyish watery particles like this, and try to make me look good please, don't capture my neck which I haven't shaved lately", and let the renderer figure out how to render me in a way as beautiful and as real-time as possible given the limitations it's working with. Any attempt to tell it what to do will almost certainly result in a counter-productive path. Commented Dec 18, 2018 at 21:01