Skip to main content
GameDev.net gamedev.net
🔒 Locked

Material system design

Started by skynet_7777 Mar 10, 2009 at 3:23 PM 1 replies 2.1k views
Original Post
skynet_7777
skynet_7777
Hi All, Currently I am working on my graphics engine's material system. My initial thoughts are that each material will be represented by XML file that will refer to a FX file having pixel and vertex shader. The XML file also having variables(Shader's global variables)along with values that should be used by the shader in order to render the material.Basically it's kind of material instancing in which different values are seted to produce different results.During rendering, scene geometry will be grouped by the Shader i.e for each group in GeomertyGroups setShader(i) RenderGeometryGroup(i) Is this the suitable material system design for current generation engines.? Please, provide your thoughts/inputs for additional design considerations. Link to a article for material system design of modern game engine will also be helpful. Thanks and Regards, Skynet_7777.
InvalidPointer
InvalidPointer
I'm personally a fan of DSL-type (aka Source-esque) material systems, but I'm likely going to take flak for that as opposed to using a 'standard' markup language. IIRC, Crysis uses pretty much the exact method you describe, XML-based material system and all.
clb: At the end of 2012, the positions of jupiter, saturn, mercury, and deimos are aligned so as to cause a denormalized flush-to-zero bug when computing earth's gravitational force, slinging it to the sun.
JarkkoL
JarkkoL
In my engine, I define material classes in C++ and expose material specific attributes in the editor (textures, etc.) which can be assigned to the material object. When the object is rendered, it calls render() to the material class(es) assigned to it, which in turn set shaders, textures, etc. and perform the rendering of the object.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.