The XML shader resource class. More...
#include "murl_resource_xml_shader.h"
Additional Inherited Members | |
Public Types inherited from Murl::IFactoryObject< IObject > | |
using | ClassInfoArray = Array< const ClassInfo * > |
Definition of an array of ClassInfo objects. | |
Public Member Functions inherited from Murl::Resource::IObject | |
virtual Bool | GetFileDependencies (Array< String > &fileNames) const =0 |
Fill a given string array with names of files the resource depends on. More... | |
Public Member Functions inherited from Murl::IFactoryObject< IObject > | |
~IFactoryObject () override | |
The destructor. | |
virtual const ClassInfo * | GetObjectClassInfo () const=0 |
Get the object instance's class info, if present. More... | |
virtual void | ResetObjectProperties ()=0 |
Reset the object instance's properties to their default values. | |
Static Public Member Functions inherited from Murl::IFactoryObject< IObject > | |
static const PropertyInfo * | GetPropertyInfo () |
Get the class' property info struct. More... | |
static const AttributeInfo * | GetAttributeInfo () |
Get the class' attribute info struct. More... | |
static void | ResetProperties (IFactoryObject< IObject > *object) |
Reset an object instance's properties to their default values. More... | |
Detailed Description
The XML shader resource class.
An XML shader file is recognized by its <Shader> root element. The root element accepts the following attributes:
- ignoreErrors: default false tbd
- forceOptimization: default false tbd
The following child elements are allowed for the root element:
- <Constants>
- <Attributes>
- <ConstantBuffers>
- <Varyings>
- <Textures>
- <VertexPrefix>
- <FragmentPrefix>
- <VertexSource>
- <FragmentSource>
The <Constants> element allows the following child elements:
- <Constant>
The following attributes are accepted in an <Constant> tag:
- name: A string value specifying the name.
- value: A string value specifying the value.
- type: A string value from the IEnums::ConstantType enumeration specifying the type.
- precision: A string value from the IEnums::ShaderVariablePrecision enumeration specifying the precision.
The <Attributes> element allows the following child elements:
- <Attribute>
The following attributes are accepted in an <Attribute> tag:
- name: A string value specifying the name.
- item: A string value from the IEnums::AttributeItem enumeration specifying the attribute item.
- type: A string value from the IEnums::AttributeType enumeration specifying the attribute type.
- precision: A string value from the IEnums::ShaderVariablePrecision enumeration specifying the precision.
The <ConstantBuffers> element allows the following child elements:
- <ConstantBuffer>
The following attributes are accepted in an <ConstantBuffer> tag:
- item: A string value from the IEnums::ConstantBufferItem enumeration specifying the item.
- name: A string value defining the name.
The <ConstantBuffer> element allows the following child elements:
- <Uniform>
The following attributes are accepted in an <Uniform> tag:
- name: A string value defining the name.
- item: A string value from the IEnums::UniformItem enumeration specifying the type.
- arraySize: tbd
- value: A string value defining the value.
- type: A string value from the IEnums::UniformType enumeration specifying the type.
- precision: A string value from the IEnums::ShaderVariablePrecision enumeration specifying the precision.
The <Varyings> element allows the following child elements:
- <Varying>
The following attributes are accepted in an <Varying> tag:
- name: A string value defining the name.
- type: A string value from the IEnums::VaryingType enumeration specifying the type.
- precision: A string value from the IEnums::ShaderVariablePrecision enumeration specifying the precision.
The <Textures> element allows the following child elements:
- <Texture>
The following attributes are accepted in an <Texture> tag:
- unit: A string value from the IEnums::TextureUnit enumeration specifying the unit.
- name: A string value defining the name.
- type: A string value from the IEnums::TextureType enumeration specifying the type.
- precision: A string value from the IEnums::ShaderVariablePrecision enumeration specifying the precision.
The <VertexPrefix> element is used to specify an optional prefix part of the vertex shader. The actual code should be put inside a CDATA section (<![CDATA[
... ]]>
). The <VertexPrefix> element accepts the following attributes:
- language: A string value from the IEnums::ShaderLanguage enumeration specifying the shader language.
The <FragmentPrefix> element is used to specify an optional prefix part of the fragment shader. The actual code should be put inside a CDATA section (<![CDATA[
... ]]>
). The <FragmentPrefix> element accepts the following attributes:
- language: A string value from the IEnums::ShaderLanguage enumeration specifying the shader language.
The <VertexSource> element is used to specify the vertex shader source code. The actual code should be put inside a CDATA section (<![CDATA[
... ]]>
). The <VertexSource> element accepts the following attributes:
- language: A string value from the IEnums::ShaderLanguage enumeration specifying the shader language.
- inputLanguage: A string value from the IEnums::ShaderLanguage enumeration specifying the input shader language.
- outputLanguage: A string value from the IEnums::ShaderLanguage enumeration specifying the output shader language.
- enableOptimization: A boolean key to enable/disable optimization. The default value is ???.
The <FragmentSource> element is used to specify the fragment shader source code. The actual code should be put inside a CDATA section (<![CDATA[
... ]]>
). The <FragmentSource> element accepts the following attributes:
- language: A string value from the IEnums::ShaderLanguage enumeration specifying the shader language.
- inputLanguage: A string value from the IEnums::ShaderLanguage enumeration specifying the input shader language.
- outputLanguage: A string value from the IEnums::ShaderLanguage enumeration specifying the output shader language.
- enableOptimization: A boolean key to enable/disable optimization. The default value is ???.
Example of an XML shader file:
Use the <Resource> tag in a .murlres package's resource.xml file to specify an XML shader resource. See Resource::Object.
The documentation for this class was generated from the following file:
- murl_resource_xml_shader.h