Skip to main content

Material & shader management

In the upcoming changes in my editor I implemented the material system inspired on  Frostbite engine of DICE, binaries are download-able on the project page. Also I've implemented an conversion tool and file-format for future mesh formats using Assimp.
The implementation of these tools still need to mature to be considered robust, tested and frozen for production. But the rudimentary system is there and i have a good feeling about where this process is leading me.

So for the material system and how I implemented them, I have 5 aggregate classes which
in total represent the entire material system. Which are responsible this screen capture of the system in action.





  • Material: maintains the information of the source data used for generation.
  • Kernel: represents permutation of 'generation properties' and 'material' it is presumed material compiler is a deterministic function.
  • Kernel-Source: maintains a compiled version of the executable code and the type of code.
  • Kernel-ClassData: maintains collection of Kernel-Source and their respective class based data for example reflection meta-data.
  • Kernel-InstanceData: maintains collection of instance data for example rasterizer states and texture states.

One interesting challenge to solve was how to use external tools supplied by the pipeline to to semi-efficiently  generate the content. Recreating the tool in native code would be ideal for multi platform targeting, but it would time consuming and severely decrease productivity for improving code generation quality.

So a we have a few options for Inter Process Communication. For my problem I choose Piped Input/Output for the simplicity involved in setting things up.

  • Sockets allows us to use network capabilities to generate the content on the same target machine or a different machine all together. This could be a interesting match for console development.
  • Named Pipes is more of a approach where you get a buffer of a certain size and these buffers can be shared across multiple processes. The applications are responsible for being aware of each-other i.e. manual synchronization.
  • Piped Input/Output handlers this is when you change the stdout/stdin of a child process to your own handles possible handles could be sockets, interactive buffers, or complete files.

Comments

  1. Cool work!
    I'm the guy who created the surface shader system in Frostbite ;)

    ReplyDelete

Post a Comment

Popular posts from this blog

The 8 Best U.S. Cities to Visit for a Quick Vacation

The best thing about visiting a new city is experiencing the thrill of adventure. From delicious food to rich history, there’s always something new to do. Whether you live close to these cities or you’re planning on making a trip to the USA, here's 8 of the best U.S. cities to visit on your next vacation (in no particular order): 1. Portland, Oregon As Oregon’s largest city, Portland has steadily been on the rise as a hotspot for food and beer connoisseurs. It’s nestled between the Columbia and Willamette Rivers with a stunning view of snowy Mount Hood which only adds to the thriving artistic culture. Portland is also home to beautiful parks, bridges and bike paths, making this city a top choice for outdoor adventurists. If you’re looking for more breathtaking escapades, Portland is nearby to a few national forests including Mount Hood National Forest and Gifford Pinchot National Forest. 2. Nashville, Tennessee Nashville rightfully owns

Roadtrip germany

On our way to a road-trip headed to Germany, Frankfurt amz Main. We had the chance to stop by for one of my favorite foods as a child: Curry-wurst with fries. This brings back so much memories where we'd often go spent the Christmas weeks in Germany, going over the Christmas markets/fairs and enjoying the hot curry-wurst from the stands with snaps or gluhwein. Of course during a road-trip one cannot stop to have a little lunch too, yummie pie and sandwhich

Securing your hardware wallet

Recently I found myself to test out an Trezor. For people not aware this is a hardware wallet for cryptocurrencies (such as Bitcoin). It was very happy with my new toy, however during the installation I noticed an rather opaque security flaw in the design.