![]() |
Murl Engine Lua Addon API
Version 1.0 beta
|
The IShader resource object interface.
A shader resource contains GPU shader program code in a number of possible formats, both source and binary forms are defined. The resource object can also contain meta information for the shader (such as information about attributes, texture semantics etc.), for shaders that cannot be queried for this information at run-time (e.g. DirectX 10+ HLSL binary blobs).
Get the number of individual shader chunks.
Integer GetNumberOfSubShaders()
Get the sub-shader at a given index.
Murl.Resource.IShader GetSubShader(Integer shaderIndex)
shaderIndex | The index of the shader, from 0 to GetNumberOfShaders()-1. |
Get the index of a sub-shader via a given type and language. If the resource does not contain a shader matching the given type and language, -1 is returned.
Integer GetSubShaderIndex(Murl.IEnums.ShaderType type, Murl.IEnums.ShaderLanguage language)
type | The shader type to query. |
language | The shader language to query. |
Get the shader type.
Murl.IEnums.ShaderType GetType()
Get the actual output shader language.
Murl.IEnums.ShaderLanguage GetOutputLanguage()
Get the input shader language this shader was translated from.
Murl.IEnums.ShaderLanguage GetInputLanguage()
Get the raw shader code data. This method returns the actual shader data that are passed to the video API. In case of OpenGL(ES), this represents a (possibly optimized) piece of GLSL source code. For DirectX, the data are present in binary form.
Murl.ConstData GetRawData()
Get the unoptimized shader source code, if present. This method returns a string containing the whole source code of the shader including prefix, definitions and actual code, before it is optimized and compiled. An empty string is a valid return value, which indicates that the original source code is not available.
String GetUnoptimizedSource()
Get the compiler log output of the unoptimized shader source code, if present.
String GetUnoptimizedLog()
Get the variable definitions of the unoptimized shader source code, if present. This method returns only the variable definition section of the unoptimized code. Use GetUnoptimizedSource() to get the full source.
String GetUnoptimizedDefinitions()
Get the prefix(es) of the unoptimized shader source code, if present. This method returns only the prefix of the unoptimized code. Use GetUnoptimizedSource() to get the full source.
Murl.Array.String GetUnoptimizedPrefix()
Get the code section(s) of the unoptimized shader source code, if present. This method returns only the actual code section of the unoptimized code. Use GetUnoptimizedSource() to get the full source.
Murl.Array.String GetUnoptimizedCode()
Get the optimized shader source code, if present. This method returns a string containing the optimized source code of the including prefix, definitions and actual code. An empty string is a valid return value, which indicates that the original source is not available.
String GetOptimizedSource()
Get the compiler log output of the optimized shader source code, if present.
String GetOptimizedLog()
Get the variable definitions of the optimized shader source code, if present. This method returns only the variable definition section of the optimized code. Use GetOptimizedSource() to get the full source.
String GetOptimizedDefinitions()
Get the prefix(es) of the optimized shader source code, if present. This method returns only the prefix of the optimized code. Use GetOptimizedSource() to get the full source.
Murl.Array.String GetOptimizedPrefix()
Get the code section(s) of the optimized shader source code, if present. This method returns only the actual code section of the optimized code. Use GetOptimizedSource() to get the full source.
Murl.Array.String GetOptimizedCode()
Get the number of constants used by the shader.
Integer GetNumberOfConstants()
Get the index of a constant with a given name.
Integer GetConstantIndex(String name)
name | The name to query. |
Get the data type of a given constant.
Murl.IEnums.ConstantType GetConstantType(Integer constantIndex)
constantIndex | The constant index, from 0 to GetNumberOfConstants()-1. |
Get the precision of a given constant.
Murl.IEnums.ShaderVariablePrecision GetConstantPrecision(Integer constantIndex)
constantIndex | The constant index, from 0 to GetNumberOfConstants()-1. |
Get the default value of a given constant as a string.
String GetConstantDefaultValue(Integer constantIndex)
constantIndex | The constant index, from 0 to GetNumberOfConstants()-1. |
Get the name of a given constant.
String GetConstantName(Integer constantIndex)
constantIndex | The constant index, from 0 to GetNumberOfConstants()-1. |
Get the number of constant buffers used by the shader.
Integer GetNumberOfConstantBuffers()
Get the index of a constant buffer with a given name.
Integer GetConstantBufferIndex(String name)
name | The name to query. |
Get the location or register number of a given constant buffer.
Integer GetConstantBufferLocation(Integer constantBufferIndex)
constantBufferIndex | The buffer index, from 0 to GetNumberOfConstantBuffers()-1. |
Get the predefined item of a given constant buffer.
Murl.IEnums.ConstantBufferItem GetConstantBufferItem(Integer constantBufferIndex)
constantBufferIndex | The buffer index, from 0 to GetNumberOfConstantBuffers()-1. |
Get the primary variable name of a given constant buffer.
String GetConstantBufferName(Integer constantBufferIndex)
constantBufferIndex | The buffer index, from 0 to GetNumberOfConstantBuffers()-1. |
Get the number of alternative variable names of a given constant buffer.
Integer GetNumberOfConstantBufferAlternativeNames(Integer constantBufferIndex)
constantBufferIndex | The buffer index, from 0 to GetNumberOfConstantBuffers()-1. |
Get an alternative variable name of a given constant buffer.
String GetConstantBufferAlternativeName(Integer constantBufferIndex, Integer alternativeNameIndex)
constantBufferIndex | The buffer index, from 0 to GetNumberOfConstantBuffers()-1. |
alternativeNameIndex | The name index, from 0 to GetNumberOfConstantBufferAlternativeNames()-1. |
Get the number of uniform variables present in a given constant buffer.
Integer GetNumberOfConstantBufferUniforms(Integer constantBufferIndex)
constantBufferIndex | The buffer index, from 0 to GetNumberOfConstantBuffers()-1. |
Get the global index of a uniform in a given constant buffer at a given index.
Integer GetConstantBufferUniformIndex(Integer constantBufferIndex, Integer uniformIndex)
constantBufferIndex | The constant buffer index, from 0 to GetNumberOfConstantBuffers()-1. |
uniformIndex | The local uniform index, from 0 to GetNumberOfConstantBufferUniforms(constantBufferIndex)-1. |
Get the number of uniform variables used by the shader.
Integer GetNumberOfUniforms()
Get the index of a uniform with a given name.
Integer GetUniformIndex(String name)
name | The name to query. |
Get the location, register number or constant buffer offset of a given uniform.
Integer GetUniformLocation(Integer uniformIndex)
uniformIndex | The uniform index, from 0 to GetNumberOfUniforms()-1. |
Get the index of the constant buffer the uniform belongs to.
Integer GetUniformConstantBufferIndex(Integer uniformIndex)
uniformIndex | The uniform index, from 0 to GetNumberOfUniforms()-1. |
Get the predefined item of a given uniform.
Murl.IEnums.UniformItem GetUniformItem(Integer uniformIndex)
uniformIndex | The uniform index, from 0 to GetNumberOfUniforms()-1. |
Get the data type of a given uniform.
Murl.IEnums.UniformType GetUniformType(Integer uniformIndex)
uniformIndex | The uniform index, from 0 to GetNumberOfUniforms()-1. |
Get the variable precision of a given uniform.
Murl.IEnums.ShaderVariablePrecision GetUniformPrecision(Integer uniformIndex)
uniformIndex | The uniform index, from 0 to GetNumberOfUniforms()-1. |
Get the array size of a given uniform.
Integer GetUniformArraySize(Integer uniformIndex)
uniformIndex | The uniform index, from 0 to GetNumberOfUniforms()-1. |
Get the default value of a given uniform as a string.
String GetUniformDefaultValue(Integer uniformIndex)
uniformIndex | The uniform index, from 0 to GetNumberOfUniforms()-1. |
Get the primary variable name of a given uniform.
String GetUniformName(Integer uniformIndex)
uniformIndex | The uniform index, from 0 to GetNumberOfUniforms()-1. |
Get the number of alternative variable names of a given uniform.
Integer GetNumberOfUniformAlternativeNames(Integer uniformIndex)
uniformIndex | The uniform index, from 0 to GetNumberOfUniforms()-1. |
Get an alternative variable name of a given uniform.
String GetUniformAlternativeName(Integer uniformIndex, Integer alternativeNameIndex)
uniformIndex | The uniform index, from 0 to GetNumberOfUniforms()-1. |
alternativeNameIndex | The name index, from 0 to GetNumberOfUniformAlternativeNames()-1. |
Get the number of attribute variables used by the shader.
Integer GetNumberOfAttributes()
Get the index of an attribute with a given name.
Integer GetAttributeIndex(String name)
name | The name to query. |
Get the location or register number of a given attribute.
Integer GetAttributeLocation(Integer attributeIndex)
attributeIndex | The attribute index, from 0 to GetNumberOfAttributes()-1. |
Get the predefined item of a given attribute.
Murl.IEnums.AttributeItem GetAttributeItem(Integer attributeIndex)
attributeIndex | The attribute index, from 0 to GetNumberOfAttributes()-1. |
Get the data type of a given attribute.
Murl.IEnums.AttributeType GetAttributeType(Integer attributeIndex)
attributeIndex | The attribute index, from 0 to GetNumberOfAttributes()-1. |
Get the variable precision of a given attribute.
Murl.IEnums.ShaderVariablePrecision GetAttributePrecision(Integer attributeIndex)
attributeIndex | The attribute index, from 0 to GetNumberOfAttributes()-1. |
Get the primary variable name of a given attribute.
String GetAttributeName(Integer attributeIndex)
attributeIndex | The attribute index, from 0 to GetNumberOfAttributes()-1. |
Get the number of alternative variable names of a given attribute.
Integer GetNumberOfAttributeAlternativeNames(Integer attributeIndex)
attributeIndex | The attribute index, from 0 to GetNumberOfAttributes()-1. |
Get an alternative variable name of a given attribute.
String GetAttributeAlternativeName(Integer attributeIndex, Integer alternativeNameIndex)
attributeIndex | The attribute index, from 0 to GetNumberOfAttributes()-1. |
alternativeNameIndex | The name index, from 0 to GetNumberOfAttributeAlternativeNames()-1. |
Get the number of varying variables used by the shader.
Integer GetNumberOfVaryings()
Get the index of a varying with a given name.
Integer GetVaryingIndex(String name)
name | The name to query. |
Get the location or register number of a given varying variable.
Integer GetVaryingLocation(Integer varyingIndex)
varyingIndex | The varying variable index, from 0 to GetNumberOfVaryings()-1. |
Get the data type of a given varying variable.
Murl.IEnums.VaryingType GetVaryingType(Integer varyingIndex)
varyingIndex | The varying variable index, from 0 to GetNumberOfVaryings()-1. |
Get the variable precision of a given varying variable.
Murl.IEnums.ShaderVariablePrecision GetVaryingPrecision(Integer varyingIndex)
varyingIndex | The varying variable index, from 0 to GetNumberOfVaryings()-1. |
Get the name of a given varying variable.
String GetVaryingName(Integer varyingIndex)
varyingIndex | The varying variable index, from 0 to GetNumberOfVaryings()-1. |
Get the number of texture (sampler) variables used by the shader.
Integer GetNumberOfTextures()
Get the index of a texture with a given name.
Integer GetTextureIndex(String name)
name | The name to query. |
Get the location or register number of a given texture sampler.
Integer GetTextureLocation(Integer textureIndex)
textureIndex | The sampler index, from 0 to GetNumberOfTextures()-1. |
Get the data type of a given texture sampler.
Murl.IEnums.TextureType GetTextureType(Integer textureIndex)
textureIndex | The sampler index, from 0 to GetNumberOfTextures()-1. |
Get additional flags of a given texture sampler.
Integer GetTextureFlags(Integer textureIndex)
textureIndex | The sampler index, from 0 to GetNumberOfTextures()-1. |
Get the variable precision of a given texture sampler.
Murl.IEnums.ShaderVariablePrecision GetTexturePrecision(Integer textureIndex)
textureIndex | The sampler index, from 0 to GetNumberOfTextures()-1. |
Get the semantic of a given texture sampler for a given color channel.
Murl.IEnums.TextureSemantic GetTextureSemantic(Integer textureIndex, Murl.IEnums.ColorComponent colorComponent)
textureIndex | The sampler index, from 0 to GetNumberOfTextures()-1. |
colorComponent | The color component to query. |
Get the semantic index of a given texture sampler for a given color channel.
Integer GetTextureSemanticIndex(Integer textureIndex, Murl.IEnums.ColorComponent colorComponent)
textureIndex | The sampler index, from 0 to GetNumberOfTextures()-1. |
colorComponent | The color component to query. |
Get the default value of a given texture sampler for a given color channel.
Number GetTextureDefaultValue(Integer textureIndex, Murl.IEnums.ColorComponent colorComponent)
textureIndex | The sampler index, from 0 to GetNumberOfTextures()-1. |
colorComponent | The color component to query. |
Get the primary variable name of a given texture sampler.
String GetTextureName(Integer textureIndex)
textureIndex | The sampler index, from 0 to GetNumberOfTextures()-1. |
Get the number of alternative variable names of a given texture sampler.
Integer GetNumberOfTextureAlternativeNames(Integer textureIndex)
textureIndex | The sampler index, from 0 to GetNumberOfTextures()-1. |
Get an alternative variable name of a given texture sampler.
String GetTextureAlternativeName(Integer textureIndex, Integer alternativeNameIndex)
textureIndex | The sampler index, from 0 to GetNumberOfTextures()-1. |
alternativeNameIndex | The name index, from 0 to GetNumberOfTextureAlternativeNames()-1. |