Friday, December 18, 2015

Data Driven Rendering in Stingray


We’re all familiar with the benefits that a data driven architecture brings to gameplay: code is decoupled from data, enabling live linking and rapid iteration. Placing new objects in the editor or modifying the speed of a character has an immediate effect on a live game instance. Really speeds up the development process as you fine tune scripts, gameplay and other content.

What about graphics programming?  It turns out that the same architecture and associated benefits apply to Stingray’s renderer.

Just by modifying configuration files (albeit somewhat complex configuration files) we can implement new shader programs, post-processing effects and even different cascading shadow map implementations. All in real time, on a live game instance. Which is a big win for graphics programmers: try out new ideas, fine tune shaders all with real-time feedback. No more of that long edit/compile/run/debug cycle. And this applies to the entire rendering pipeline: everything from the object space to world space transforms to shadow casting and the final rendering pass is all exposed as config file data, not as C++ code as with traditional architectures.

I gave a presentation on this topic a while back which has now found it’s way to our YouTube channel:

https://www.youtube.com/channel/UC0fIe6XV1PjilADTei9JMOA

By the way, there’s a lot of other great Stingray content up there so please check it out! The renderer presentation can be found under “Stingray Render Config Tutorial.”

The details as well as a PowerPoint can be found there. The code changes to add a trivial greyscale post-processing effect involve:

settings.ini: 

The render_config variable points to the renderer.config file. Settings.ini also provides a section to override default settings found in the next file, renderer.render_config

core/stingray_renderer/renderer.render_config:

Points to our shader libraries, text files containing actual shader programs. A section called global_resources allocates graphics buffers, such as scratch buffers for the cascading shadow maps and G-buffers for deferred rendering along with the main framebuffer. And most of the actual rendering is invoked in the resource_generators section. Again, more details in the YouTube video though a surprising amount can be learned just by grepping through the various config files and playing with the settings. Which is easy to do since it’s all data driven!

core/stingray_renderer/shader_libraries/development.shader_source:

One of several shader libraries. While shader code can be entered as text here, Stingray also provides a graphical node-based shader editor. And we support ShaderFX materials from Max or Maya. It’s often easier (and more portable) to implement shaders graphically.

But whatever method you choose to implement shaders in, the key point is that Stingray's entire rendering pipeline is fully accessible through configuration files. With our data driven architecture making complex rendering changes, while still non-trivial, is a whole lot faster and easier (and portable!) than working with platform-specific C++ code.

25 comments:

  1. Hi there is not link to any power point presentation in the youtube channel. I could only find this old presentation http://gamedevs.org/uploads/benefits-of-a-data-driven-renderer.pdf

    ReplyDelete

  2. Thanks for all the tips mentioned in this article! it’s always good to read things you have heard before and are implementing, but

    from a different perspective, always pick up some extra bits of information.

    geek squad support
    geek squad chat
    Webroot geek squad
    geek squad tech support
    norton.com/setup
    trend micro download

    ReplyDelete
  3. Thank you for this blog. I was about to sign up to first rate when this showed up in the results. I hope I can find something that can really help me out. I do not drive so an online work will be great.It really makes me happy and I am satisfied with the arrangement of your post. You are really a talented person I have ever seen.Geek Squad Tech Support visit for more information

    ReplyDelete
  4. Your blog is very informative, meaningful and to the point. Being a technical support blogger. I find you have a very good writing sense due to which you explain details about technical support perfectly, for more exploring your knowledge about Support For HP Printer | Number +1-877-760-6133, HP Printers Support | HP Printers Support Number
    hp printer error codes

    ReplyDelete
  5. Thank you for the inspiring and insightful piece of writing. I found This post is quite helpful.

    Visit: www.trendmicro.com/bestbuypc

    ReplyDelete
  6. Nice and well written post. Almost you cover all thing in an amazing post.

    Visit: MY.KASPERSKY.LOGIN

    ReplyDelete
  7. Thanks For Sharing Information, I really Like Your Blog. Its Really Helpful For me And Please Keep Posting.

    Visit: kaspersky download already purchased

    ReplyDelete
  8. Wow!! It's a really great experience sharing with us. I like your post, it's a really interesting.

    Visit: www.trendmicro.com/bestbuypc

    ReplyDelete
  9. Excellent blog. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking.

    Visit: www.trendmicro.com/bestbuypc

    ReplyDelete
  10. Nice and well written post. Almost you cover all thing in an amazing post.

    Visit: www.trendmicro.com/downloadme

    ReplyDelete
  11. Excellent blog. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking.

    Visit: www.trendmicro.com/getmax

    ReplyDelete
  12. very nice put up, i certainly love this web site, keep on it.

    Visit: Enter Norton product key

    ReplyDelete
  13. Excellent blog. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking.

    Visit: www.norton.com/setup

    ReplyDelete
  14. It is very helpful to secure your device and it is very light weighted antivirus product.

    Visit: central.bitdefender.com

    ReplyDelete
  15. Thanks for sharing the information. Your blog has always been a source of great tips.

    Visit: www.bitdefender.com/downloads

    ReplyDelete
  16. Wonderful blog post, thank you so much for the great information which you provided.

    Visit: bitdefender sign in

    ReplyDelete
  17. Thank you for the inspiring and insightful piece of writing. I found This post is quite helpful.

    Visit: install trend micro on new computer

    ReplyDelete
  18. Nice and well written post. Almost you cover all thing in an amazing post.

    Visit: www.trendmicro.com/downloadme

    ReplyDelete
  19. Thanks For Sharing Information, I really Like Your Blog. Its Really Helpful For me And Please Keep Posting.

    Visit: AOL DESKTOP GOLD DOWNLOAD

    ReplyDelete
  20. Wow!! It's a really great experience sharing with us. I like your post, it's a really interesting.

    Visit: how to download bitdefender already paid for

    ReplyDelete
  21. TomTom is the official update tool for TomTom.com, that includes several helpful things like the flexibility to simply install new maps and services, restore and backup your TomTom, receive free traffic alerts, and even use services that ordinarily need a wireless information association.
    tomtom.com/getstarted | tomtom get started | www.tomtom.com/getstarted | tomtom update

    ReplyDelete
  22. webroot is the Website page or a link to download or Activate your webroot products. user may directly download webroot Antivirus program from this link without creating a webroot account. But creating an account is still a better alternative as you can login to your webroot account and get your product Information like Expiration and activation date anywhere and install other device from webroot Account dashboard. www.webroot.com/safe |

    webroot.com/safe |
    Install Webroot With Key Code

    ReplyDelete