AR_Engine_SDK
Functions | Variables
XMaterial.lua File Reference
类 XMaterialParamDescInfo 继承关系图:
Inheritance graph
类 XMaterialShaderDescInfo 继承关系图:
Inheritance graph
类 IXMaterial 继承关系图:
Inheritance graph
类 IXMaterialInstance 继承关系图:
Inheritance graph
类 IXMaterialManager 继承关系图:
Inheritance graph

Functions

function XMaterialParamDescInfo__XAnnotation new () end
 @type string More...
 
function XMaterialParamDescInfo__XAnnotation new (other) end
 
function IXMaterial Release () end
 
function IXMaterial GetMaterialFileName () end
 
function IXMaterial GetPassNum () end
 
function IXMaterial GetMaterialRenderLayer () end
 
function IXMaterial GetShadingType () end
 
function IXMaterial GetRenderLayerSortValue () end
 
function IXMaterial IsEnableCastShadow () end
 
function IXMaterial IsLightingEnabled () end
 
function IXMaterial GetSrcBlendFactorType (nPassIndex) end
 
function IXMaterial GetDestBlendFactorType (nPassIndex) end
 
function IXMaterial GetSrcAlphaBlendFactorType (nPassIndex) end
 
function IXMaterial GetDestAlphaBlendFactorType (nPassIndex) end
 
function IXMaterial IsEnableDepthTest (nPassIndex) end
 
function IXMaterial IsEnableDepthWrite (nPassIndex) end
 
function IXMaterial IsEnableTwoSidedShow (nPassIndex) end
 
function IXMaterial GetCullMode (nPassIndex) end
 
function IXMaterial GetZTestFunc (nPassIndex) end
 
function IXMaterial GetMaterialPassDescInfo (nPassIndex) end
 
function IXMaterial GetMatShaderDescInfo (nPassIndex) end
 
function IXMaterial GetMatParamCount () end
 
function IXMaterial GetMatParamDescInfoByParamName (szName) end
 
function IXMaterial GetMatParamDescInfoByParamId (id) end
 
function IXMaterial GetMatParamIdByParamName (szName) end
 
function IXMaterial GetSupportMacroCount () end
 
function IXMaterial GetSupportMacroById (id) end
 
function IXMaterialInstance GetMaterialPtr () end
 
function IXMaterialInstance GetMaterialInsFile () end
 
function IXMaterialInstance GetParameterCount () end
 
function IXMaterialInstance GetParameterDescInfoByParamName (szName) end
 
function IXMaterialInstance GetParameterDescInfoByParamId (id) end
 
function IXMaterialInstance GetParameterIdByParamName (szName) end
 
function IXMaterialInstance GetParameterByParamId (iId) end
 
function IXMaterialInstance GetParameterByParamName (szName) end
 
function IXMaterialInstance SetParameterByParamName (szName, val) end
 
function IXMaterialInstance SetParameterByParamId (id, val) end
 
function IXMaterialInstance SetTextureParameterByParamName (szName, pTexture) end
 
function IXMaterialInstance SetTextureParameterByParamId (id, pTexture) end
 
function IXMaterialInstance IsMacroEnabled (id) end
 
function IXMaterialInstance EnabledMacro (id, bEnable) end
 
function IXMaterialInstance ChangeMtl (szMaterialFile) end
 
function IXMaterialInstance ApplyAndUpdateMaterial (pSrcMtlIns) end
 
function IXMaterialInstance IsCastShadow () end
 
function IXMaterialManager Init () end
 
function IXMaterialManager SaveMaterial (pMaterial, szFileName, bBinary, bSaveToMinSupportVersion) end
 
function IXMaterialManager GetMaterial (szMaterialFileName, szReplaceShaderMacro, bBinary, bReload) end
 
function IXMaterialManager SaveMaterialInstance (szSaveMatInsFile, szMatFile, szShaderMacro, aParams, bBinary) end
 @type XMaterialDataType More...
 
function IXMaterialManager GetMaterialInstance (szMaterialInsFileName, szReplaceShaderMacro, bReLoad, bBinary) end
 
function IXMaterialManager CreateMaterialInstance (szNewMaterialInsFile, szMaterialFile, szReplaceShaderMacro) end
 
function IXMaterialManager ReloadMaterialInstance (szMaterialInsFile) end
 
function IXMaterialManager IsMaterialInstanceExist (szMtlInsFile, szReplaceShaderMacro) end
 
function IXMaterialManager IsMaterialInstanceLoaded (szMtlInsFile, szReplaceShaderMacro) end
 

Variables

 XMaterialParamDescInfo = {}
 
XMaterialParamDescInfo iType = {}
 @type XMaterialDataType More...
 
XMaterialParamDescInfo strMatParamName = ''
 @type string More...
 
XMaterialParamDescInfo nId = 0
 @type number More...
 
XMaterialParamDescInfo bUser = false
 @type boolean More...
 
XMaterialParamDescInfo nTexAddreU = {}
 @type XTexAddressType More...
 
XMaterialParamDescInfo nTexAddreV = {}
 @type XTexAddressType More...
 
XMaterialParamDescInfo nTexAddreW = {}
 @type XTexAddressType More...
 
XMaterialParamDescInfo nTexFilter = {}
 @type XTexFilterType More...
 
XMaterialParamDescInfo XWT_INPUT1 = 0
 
XMaterialParamDescInfo XWT_INPUT2 = 0
 
XMaterialParamDescInfo XWT_INPUT3 = 0
 
XMaterialParamDescInfo XWT_INPUT4 = 0
 
XMaterialParamDescInfo XWT_COLOR = 0
 
XMaterialParamDescInfo XWT_TEXTURE = 0
 
XMaterialParamDescInfo XWT_NUM = 0
 
 XMaterialParamDescInfo__XAnnotation = {}
 
XMaterialParamDescInfo XAnnotation = XMaterialParamDescInfo__XAnnotation
 
XMaterialParamDescInfo__XAnnotation strShowNameOnWidgetUI = ''
 @type string More...
 
XMaterialParamDescInfo__XAnnotation nWidgetType = 0
 @type number More...
 
XMaterialParamDescInfo__XAnnotation strTexName = ''
 @type string More...
 

Function Documentation

◆ ApplyAndUpdateMaterial()

function IXMaterialInstance ApplyAndUpdateMaterial ( pSrcMtlIns  )

应用其他材质实例的参数到本材质实例

Parameters
pSrcMtlInsIXMaterialInstance 应用的材质实例对象
Returns
boolean 是否执行成功

◆ ChangeMtl()

function IXMaterialInstance ChangeMtl ( szMaterialFile  )

切换材质模板

Parameters
szMaterialFilestring 材质模板文件名
Returns
boolean 是否切换成功

◆ CreateMaterialInstance()

function IXMaterialManager CreateMaterialInstance ( szNewMaterialInsFile  ,
szMaterialFile  ,
szReplaceShaderMacro   
)

创建一个内存中的材质实例,材质实例名称和宏连接起来的字符串作为key

Parameters
szNewMaterialInsFilestring
szMaterialFilestring
szReplaceShaderMacrostring
Returns
IXMaterialInstance

◆ EnabledMacro()

function IXMaterialInstance EnabledMacro ( id  ,
bEnable   
)

设置是否启用某个材质参数宏id

Parameters
idnumber 材质参数宏id
bEnableboolean 是否启用
Returns
void

◆ GetCullMode()

function IXMaterial GetCullMode ( nPassIndex  )

IXMaterial_GetCullMode00

Parameters
nPassIndexnumber
Returns
XRenderStateCullMode

◆ GetDestAlphaBlendFactorType()

function IXMaterial GetDestAlphaBlendFactorType ( nPassIndex  )

IXMaterial_GetDestAlphaBlendFactorType00

Parameters
nPassIndexnumber
Returns
XBlendFactorType

◆ GetDestBlendFactorType()

function IXMaterial GetDestBlendFactorType ( nPassIndex  )

IXMaterial_GetDestBlendFactorType00

Parameters
nPassIndexnumber
Returns
XBlendFactorType

◆ GetMaterial()

function IXMaterialManager GetMaterial ( szMaterialFileName  ,
szReplaceShaderMacro  ,
bBinary  ,
bReload   
)

获取一个内存中或硬盘上的材质,IXMaterial引用计数+1

Parameters
szMaterialFileNamestring
szReplaceShaderMacrostring
bBinaryboolean
bReloadboolean
Returns
IXMaterial

◆ GetMaterialFileName()

function IXMaterial GetMaterialFileName ( )

获取材质资源文件名

Returns
string 材质资源文件名

◆ GetMaterialInsFile()

function IXMaterialInstance GetMaterialInsFile ( )

获取材质实例文件名

Returns
string 材质实例文件名

◆ GetMaterialInstance()

function IXMaterialManager GetMaterialInstance ( szMaterialInsFileName  ,
szReplaceShaderMacro  ,
bReLoad  ,
bBinary   
)

获取一个内存中或硬盘上的材质实例,IXMaterialInstance引用计数+1

Parameters
szMaterialInsFileNamestring
szReplaceShaderMacrostring
bReLoadboolean
bBinaryboolean
Returns
IXMaterialInstance

◆ GetMaterialPassDescInfo()

function IXMaterial GetMaterialPassDescInfo ( nPassIndex  )

IXMaterial_GetMaterialPassDescInfo00

Parameters
nPassIndexnumber
Returns
XMaterialPassDescInfo

◆ GetMaterialPtr()

function IXMaterialInstance GetMaterialPtr ( )

获取材质指针

Returns
IXMaterial 材质指针

◆ GetMaterialRenderLayer()

function IXMaterial GetMaterialRenderLayer ( )

IXMaterial_GetMaterialRenderLayer00

Returns
XMaterialRenderLayer

◆ GetMatParamCount()

function IXMaterial GetMatParamCount ( )

获取材质参数个数

Returns
number 材质参数个数

◆ GetMatParamDescInfoByParamId()

function IXMaterial GetMatParamDescInfoByParamId ( id  )

根据材质参数id获取材质参数信息描述结构体

Parameters
idnumber 材质参数id
Returns
XMaterialParamDescInfo 材质参数信息描述结构体

◆ GetMatParamDescInfoByParamName()

function IXMaterial GetMatParamDescInfoByParamName ( szName  )

根据材质参数名获取材质参数信息描述结构体

Parameters
szNamestring 材质参数名
Returns
XMaterialParamDescInfo 材质参数信息描述结构体

◆ GetMatParamIdByParamName()

function IXMaterial GetMatParamIdByParamName ( szName  )

根据材质参数名获取材质参数id

Parameters
szNamestring 材质参数名
Returns
number 材质参数id

◆ GetMatShaderDescInfo()

function IXMaterial GetMatShaderDescInfo ( nPassIndex  )

IXMaterial_GetMatShaderDescInfo00

Parameters
nPassIndexnumber
Returns
XMaterialShaderDescInfo

◆ GetParameterByParamId()

function IXMaterialInstance GetParameterByParamId ( iId  )

根据材质参数id获取材质参数信息

Parameters
iIdnumber 材质参数id
Returns
XMaterialParamTypeValue 材质参数信息

◆ GetParameterByParamName()

function IXMaterialInstance GetParameterByParamName ( szName  )

根据材质参数名获取材质参数信息

Parameters
szNamestring 材质参数名
Returns
XMaterialParamTypeValue 材质参数信息

◆ GetParameterCount()

function IXMaterialInstance GetParameterCount ( )

获取材质参数总个数

Returns
number 材质参数总个数

◆ GetParameterDescInfoByParamId()

function IXMaterialInstance GetParameterDescInfoByParamId ( id  )

根据材质参数id获取材质参数信息描述结构体

Parameters
idnumber 材质参数id
Returns
XMaterialParamDescInfo 材质参数信息描述结构体

◆ GetParameterDescInfoByParamName()

function IXMaterialInstance GetParameterDescInfoByParamName ( szName  )

根据材质参数名获取材质参数信息描述结构体

Parameters
szNamestring 材质参数名
Returns
XMaterialParamDescInfo 材质参数信息描述结构体

◆ GetParameterIdByParamName()

function IXMaterialInstance GetParameterIdByParamName ( szName  )

根据材质参数名获取材质参数id

Parameters
szNamestring 材质参数名
Returns
number 材质参数id

◆ GetPassNum()

function IXMaterial GetPassNum ( )

IXMaterial_GetPassNum00

Returns
number

◆ GetRenderLayerSortValue()

function IXMaterial GetRenderLayerSortValue ( )

IXMaterial_GetRenderLayerSortValue00

Returns
number

◆ GetShadingType()

function IXMaterial GetShadingType ( )

IXMaterial_GetShadingType00

Returns
XMaterialShadingType

◆ GetSrcAlphaBlendFactorType()

function IXMaterial GetSrcAlphaBlendFactorType ( nPassIndex  )

IXMaterial_GetSrcAlphaBlendFactorType00

Parameters
nPassIndexnumber
Returns
XBlendFactorType

◆ GetSrcBlendFactorType()

function IXMaterial GetSrcBlendFactorType ( nPassIndex  )

IXMaterial_GetSrcBlendFactorType00

Parameters
nPassIndexnumber
Returns
XBlendFactorType

◆ GetSupportMacroById()

function IXMaterial GetSupportMacroById ( id  )

根据id获取对应材质宏信息

Parameters
idnumber 宏id
Returns
XMaterialSupportMacro 对应材质宏信息

◆ GetSupportMacroCount()

function IXMaterial GetSupportMacroCount ( )

获取支持的材质宏的个数

Returns
number 支持的材质宏的个数

◆ GetZTestFunc()

function IXMaterial GetZTestFunc ( nPassIndex  )

IXMaterial_GetZTestFunc00

Parameters
nPassIndexnumber
Returns
XRenderStateZTestFunc

◆ Init()

function IXMaterialManager Init ( )

初始化

Returns
boolean 是否初始化成功

◆ IsCastShadow()

function IXMaterialInstance IsCastShadow ( )

是否投射阴影

Returns
boolean 是否投射阴影

◆ IsEnableCastShadow()

function IXMaterial IsEnableCastShadow ( )

IXMaterial_IsEnableCastShadow00

Returns
boolean

◆ IsEnableDepthTest()

function IXMaterial IsEnableDepthTest ( nPassIndex  )

IXMaterial_IsEnableDepthTest00

Parameters
nPassIndexnumber
Returns
boolean

◆ IsEnableDepthWrite()

function IXMaterial IsEnableDepthWrite ( nPassIndex  )

IXMaterial_IsEnableDepthWrite00

Parameters
nPassIndexnumber
Returns
boolean

◆ IsEnableTwoSidedShow()

function IXMaterial IsEnableTwoSidedShow ( nPassIndex  )

IXMaterial_IsEnableTwoSidedShow00

Parameters
nPassIndexnumber
Returns
boolean

◆ IsLightingEnabled()

function IXMaterial IsLightingEnabled ( )

IXMaterial_IsLightingEnabled00

Returns
boolean

◆ IsMacroEnabled()

function IXMaterialInstance IsMacroEnabled ( id  )

判断是否启用了某个宏

Parameters
idnumber 材质宏id
Returns
boolean 是否启用

◆ IsMaterialInstanceExist()

function IXMaterialManager IsMaterialInstanceExist ( szMtlInsFile  ,
szReplaceShaderMacro   
)

判断材质实例是否存在(内存+硬盘)

Parameters
szMtlInsFilestring
szReplaceShaderMacrostring
Returns
boolean 材质实例是否存在

◆ IsMaterialInstanceLoaded()

function IXMaterialManager IsMaterialInstanceLoaded ( szMtlInsFile  ,
szReplaceShaderMacro   
)

判断材质实例是否已加载

Parameters
szMtlInsFilestring
szReplaceShaderMacrostring
Returns
boolean 材质实例是否已加载

◆ new() [1/2]

@type string

XMaterialParamDescInfo_XAnnotation_new00

Returns
XMaterialParamDescInfo__XAnnotation

@type number @type string @type number XMaterialSupportMacro_new00

Returns
XMaterialSupportMacro

◆ new() [2/2]

function XMaterialParamDescInfo__XAnnotation new ( other  )

XMaterialParamDescInfo_XAnnotation_new01

Parameters
otherXMaterialParamDescInfo::XAnnotation
Returns
XMaterialParamDescInfo__XAnnotation

◆ Release()

function IXMaterial Release ( )

释放信息

Returns
void

◆ ReloadMaterialInstance()

function IXMaterialManager ReloadMaterialInstance ( szMaterialInsFile  )

重新加载材质实例

Parameters
szMaterialInsFilestring 材质文件名
Returns
void

◆ SaveMaterial()

function IXMaterialManager SaveMaterial ( pMaterial  ,
szFileName  ,
bBinary  ,
bSaveToMinSupportVersion   
)

保存材质文件

Parameters
pMaterialIXMaterial
szFileNamestring
bBinaryboolean
bSaveToMinSupportVersionboolean
Returns
void

◆ SaveMaterialInstance()

function IXMaterialManager SaveMaterialInstance ( szSaveMatInsFile  ,
szMatFile  ,
szShaderMacro  ,
aParams  ,
bBinary   
)

@type XMaterialDataType

@type string @type string @type boolean @type XVECTOR4 保存材质实例

Parameters
szSaveMatInsFilestring 材质实例文件名
szMatFilestring
szShaderMacrostring
aParamsXMaterialInsParameterForSave[]
bBinaryboolean
Returns
void

◆ SetParameterByParamId()

function IXMaterialInstance SetParameterByParamId ( id  ,
val   
)

根据材质参数id设置材质参数信息

Parameters
idnumber 材质参数id
valXMaterialParamTypeValue 材质参数信息
Returns
void

◆ SetParameterByParamName()

function IXMaterialInstance SetParameterByParamName ( szName  ,
val   
)

根据材质参数名设置材质参数信息

Parameters
szNamestring 材质参数名
valXMaterialParamTypeValue 材质参数信息
Returns
void

◆ SetTextureParameterByParamId()

function IXMaterialInstance SetTextureParameterByParamId ( id  ,
pTexture   
)

根据材质参数id设置材质纹理参数

Parameters
idnumber 材质参数id
pTextureIXTexture 材质纹理参数对象
Returns
void

◆ SetTextureParameterByParamName()

function IXMaterialInstance SetTextureParameterByParamName ( szName  ,
pTexture   
)

根据材质参数名设置材质纹理参数

Parameters
szNamestring 材质参数名
pTextureIXTexture 材质纹理参数对象
Returns
void

Variable Documentation

◆ bUser

XMaterialParamDescInfo bUser = false

@type boolean

◆ iType

@type XMaterialDataType

◆ nId

@type number

◆ nTexAddreU

XMaterialParamDescInfo nTexAddreU = {}

@type XTexAddressType

◆ nTexAddreV

XMaterialParamDescInfo nTexAddreV = {}

@type XTexAddressType

◆ nTexAddreW

XMaterialParamDescInfo nTexAddreW = {}

@type XTexAddressType

◆ nTexFilter

XMaterialParamDescInfo nTexFilter = {}

@type XTexFilterType

◆ nWidgetType

@type number

◆ strMatParamName

XMaterialParamDescInfo strMatParamName = ''

@type string

◆ strShowNameOnWidgetUI

XMaterialParamDescInfo__XAnnotation strShowNameOnWidgetUI = ''

@type string

◆ strTexName

@type string

◆ XAnnotation

◆ XMaterialParamDescInfo

◆ XMaterialParamDescInfo__XAnnotation

◆ XWT_COLOR

XMaterialParamDescInfo XWT_COLOR = 0

◆ XWT_INPUT1

XMaterialParamDescInfo XWT_INPUT1 = 0

◆ XWT_INPUT2

XMaterialParamDescInfo XWT_INPUT2 = 0

◆ XWT_INPUT3

XMaterialParamDescInfo XWT_INPUT3 = 0

◆ XWT_INPUT4

XMaterialParamDescInfo XWT_INPUT4 = 0

◆ XWT_NUM

◆ XWT_TEXTURE

XMaterialParamDescInfo XWT_TEXTURE = 0