Aller au contenu

Photo

Material Shader Setup


  • Veuillez vous connecter pour répondre
1 réponse à ce sujet

#1
pkpeachykeen

pkpeachykeen
  • Members
  • 77 messages
Some of you may be aware of my Voodoo Shader project and the Shard plugin, designed to bring modern customizable shaders to NWN2. As part of that project, I'm setting up a system where shaders can be attached to textures, allowing them to be used as materials. This allows a lot of new effects; simple things like metal or velvet, more complex effects like parallax and height mapping, all the way up to dynamic snow like Crysis and Skyrim use.

In order to make this happen, the shaders need attached to the textures somehow. In NWShader, I used material files to handle this. The concept is each mod, hak or texture pack has a file listing textures, the shader to be used, and any settings.

What I'm trying to figure out now is the syntax for those. The current options are:

Simple XML form:
<Material texture="flat_texture.dds" effect="bump.fx">
    <Parameter name="bump_texture" value="bump_texture.dds" />
</Material>

Simple curly form:
material "flat_texture.dds"
{
    effect = "bump.fx";
    parameters
    {
        bump_texture = "bump_texture.dds";
    }
}

Since this system will be used most by artists, I'd like to get some feedback from you before going one way or the other.

I will be making simple tools, and potentially a Max plugin, to help handle this, but those all depend on which format is used. They also won't be out immediately, so there might be a short period where materials are written by hand.

Anyone have a preference between the above snippets?

Modifié par pkpeachykeen, 15 janvier 2012 - 10:47 .


#2
-Semper-

-Semper-
  • Members
  • 2 259 messages
i like the xml form. it's easy to write and to edit ;)