Home

Awesome

Weaver

Weaver is an HLSL surface shader parser, implemented as a content pipeline extension for XNA / MonoGame.

To make Weaver useful, you will need to integrate Weaver into your game engine. Weaver, by itself, only handles parsing a specific surface shader language into a node hierarchy.

This is an example of the surface shader language that Weaver parses:

shader "Specular"
{
	properties
	{
		float3 DiffuseColor = (1, 1, 1)
		float Alpha = 1
		float3 SpecularColor = (0.5, 0.5, 0.5)
		float SpecularPower = 16
		Texture2D DiffuseTexture = "white"
	}

	surface
	{
		lightingmodel "BlinnPhong"

		inputs { float2 uv }

		__hlsl__
		void surface(SurfaceInput input, inout BlinnPhongSurfaceOutput output)
		{
			output.Diffuse = tex2D(DiffuseTexture, input.uv) * DiffuseColor;
			output.Alpha = Alpha;
			output.Specular = SpecularColor;
			output.SpecularPower = SpecularPower;
		}
		__hlsl__
	}
}

Usage

License

Weaver is released under the MIT License.