/// <summary> /// 利用材质实例的特定通道,将指定纹理渲染至目标RenderToTexture /// </summary> /// <param name="source">指定的纹理</param> /// <param name="destination">目标RenderToTexture</param> /// <param name="material">材质实例</param> /// <param name="passIndex">材质实例的通道</param> public static void BlitImage(Texture source, RenderToTexture destination, MaterialInstance material, int passIndex) { if (null == source) { ICall_GraphicSystem_BlitImage(IntPtr.Zero, destination, material, passIndex); } else { ICall_GraphicSystem_BlitImage(source.GetTextureHandlePtr(), destination, material, passIndex); } }
extern private static void ICall_RenderComponent_StandaloneRender(RenderComponent self, MaterialInstance customMat);
/// <summary> /// 单独渲染组件 /// </summary> /// <param name="customMaterial">单独渲染组件使用的材质</param> public void StandaloneRender(MaterialInstance customMaterial) { ICall_RenderComponent_StandaloneRender(this, customMaterial); }
private static extern void ICall_Material_SetValueMatrix44(MaterialInstance self, String paramName, ref Matrix44 value);
private static extern void ICall_Material_SetTextureResource(MaterialInstance self, String paramName, String id, int priority);
private static extern void ICall_Material_Release(MaterialInstance self);
/// <summary> /// 设置材质实例到指定的材质索引 /// </summary> /// <param name="index">渲染相关组件的材质索引</param> /// <param name="pMonoObj">要设置的材质实例</param> /// <param name="bCopy">是否要拷贝材质,默认是使用内存中的同一份材质</param> public void SetMaterialInstance(int index, MaterialInstance pMonoObj) { ICall_RenderComponent_SetMaterialInstance(this, index, pMonoObj, false); }
/// <summary> /// 设置材质实例到指定的材质索引 /// </summary> /// <param name="index">渲染相关组件的材质索引</param> /// <param name="pMonoObj">要设置的材质实例</param> /// <param name="bCopy">是否要拷贝材质,默认是使用内存中的同一份材质</param> public void SetMaterialInstance(int index, MaterialInstance pMonoObj, bool bCopy) { ICall_RenderComponent_SetMaterialInstance(this, index, pMonoObj, bCopy); }
extern private static void ICall_Material_Release(MaterialInstance self);
extern private static void ICall_Material_Bind(MaterialInstance self);
private static extern void ICall_RenderComponent_StandaloneRender(RenderComponent self, MaterialInstance customMat);
private static extern void ICall_RenderComponent_SetMaterialInstance(RenderComponent self, int iSubMesh, MaterialInstance pMonoStr, bool bCopy = false);
private static extern void ICall_GraphicSystem_BlitImage(IntPtr textureHandlePtr, RenderToTexture destination, MaterialInstance material, int passIndex);
extern private static void ICall_Material_SetTexture(MaterialInstance self, String paramName, IntPtr textureHandlePtr);
extern private static void ICall_GraphicSystem_BlitImage(IntPtr textureHandlePtr, RenderToTexture destination, MaterialInstance material, int passIndex);
extern private static void ICall_Material_SetValueFloat(MaterialInstance self, String paramName, float value);
extern private static void ICall_Material_SetValueVector4(MaterialInstance self, String paramName, ref Vector4 value);
private static extern void ICall_Material_Bind(MaterialInstance self);
extern private static void ICall_Material_SetValueMatrix44(MaterialInstance self, String paramName, ref Matrix44 value);
private static extern void ICall_Material_SetTexture(MaterialInstance self, String paramName, IntPtr textureHandlePtr);
extern private static void ICall_Material_SetTextureResource(MaterialInstance self, String paramName, String id, int priority);
private static extern void ICall_Material_SetValueFloat(MaterialInstance self, String paramName, float value);
extern private static void ICall_RenderComponent_SetMaterialInstance(RenderComponent self, int iSubMesh, MaterialInstance pMonoStr, bool bCopy = false);
private static extern void ICall_Material_SetValueVector4(MaterialInstance self, String paramName, ref Vector4 value);
/// <summary> /// 设置材质实例到指定的材质索引 /// </summary> /// <param name="index">渲染相关组件的材质索引</param> /// <param name="pMonoObj">要设置的材质实例</param> /// <param name="bCopy">是否要拷贝材质,默认是使用内存中的同一份材质</param> public void SetMaterialInstance(int index, MaterialInstance pMonoObj, bool bCopy = false) { ICall_RenderComponent_SetMaterialInstance(this, index, pMonoObj, bCopy); }