當前位置: 首頁>>代碼示例>>C#>>正文


C# RenderTexture.GetNativeTexturePtr方法代碼示例

本文整理匯總了C#中UnityEngine.RenderTexture.GetNativeTexturePtr方法的典型用法代碼示例。如果您正苦於以下問題:C# RenderTexture.GetNativeTexturePtr方法的具體用法?C# RenderTexture.GetNativeTexturePtr怎麽用?C# RenderTexture.GetNativeTexturePtr使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UnityEngine.RenderTexture的用法示例。


在下文中一共展示了RenderTexture.GetNativeTexturePtr方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SFMovieCreationParams

// Allows a rendertexture to be passed in
    public SFMovieCreationParams(String name, int ox, int oy, int width, int height,
        IntPtr pdata, int length, bool initFirstFrame, RenderTexture texture, Color32 bgColor, 
		bool useBackgroundColor = false, ScaleModeType scaleModeType = ScaleModeType.SM_ShowAll, bool bAutoManageVP = true):
       this(name, ox, oy, width, height, pdata, length, initFirstFrame, bgColor, useBackgroundColor, scaleModeType, bAutoManageVP)
	   {
        IsRenderToTexture    = (texture != null);
        TexWidth            = ((texture != null) ? (UInt32)texture.width : 0);
        TexHeight           = ((texture != null) ? (UInt32)texture.height : 0);

#if (UNITY_4_0) || (UNITY_4_1)
        if (texture)
        {
#if UNITY_IPHONE
            TextureId = (uint)texture.GetNativeTextureID();
#else
            IntPtr texPtr = texture.GetNativeTexturePtr();
            TextureId = (uint)(texPtr);
#endif //UNITY_IPHONE
        }
        else
        {
            TextureId = 0;
        }
#else
        TextureId = ((texture != null) ? (UInt32)texture.GetNativeTextureID() : 0);
#if UNITY_STANDALONE_WIN
        if (SystemInfo.graphicsDeviceVersion[0] == 'D')
        {
            // SystemInfo.graphicsDeviceVersion starts with either "Direct3D" or "OpenGL".
            // We need to disable RTT on D3D+Windows because GetNativeTextureID() returns 
            // a garbage value in D3D mode instead of zero, even though 
            // GetNativeTextureID() is only supported in OpenGL mode.
            TextureId = 0;
            IsRenderToTexture = false;
            TexWidth = 0;
            TexHeight = 0;
        }
#endif //UNITY_STANDALONE_WIN
#endif //(UNITY_4_0) || (UNITY_4_1)

    //  pData = Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(System.IntPtr)));
    //  Marshal.WriteIntPtr(pData, pdata);
    }
開發者ID:BiDuc,項目名稱:Stereoscopic_Scatterplot,代碼行數:44,代碼來源:SFManager.cs

示例2: PostRender

 public override void PostRender(RenderTexture stereoScreen) {
   SetTextureId((int)stereoScreen.GetNativeTexturePtr());
   GL.IssuePluginEvent(kRenderEvent);
 }
開發者ID:seasiainfotech,項目名稱:Unity,代碼行數:4,代碼來源:GvrDevice.cs

示例3: GetFrameData

 public override void GetFrameData(RenderTexture rt, int frame)
 {
     fcAPI.fcGifGetFrameData(m_ctx, rt.GetNativeTexturePtr(), frame);
 }
開發者ID:ClintChil,項目名稱:FrameCapturer,代碼行數:4,代碼來源:GifRecorder.cs

示例4: OnRenderImage

        void OnRenderImage(RenderTexture source, RenderTexture destination)
        {
            var linear = QualitySettings.activeColorSpace == ColorSpace.Linear;

            // Screen blit
            if (_renderMode == RenderMode.PreviewOnGameView && linear)
                Graphics.Blit(source, destination, gammaMaterial, 0);
            else if (_renderMode != RenderMode.SendOnly)
                Graphics.Blit(source, destination);

            // Publish the content of the source buffer.
            SetSourceFrame(
                _slotIndex, gameObject.name,
                source.GetNativeTexturePtr(), source.width, source.height,
                linear, _discardAlpha);

            InvokePublishEvent(_slotIndex);
        }
開發者ID:reactify,項目名稱:themusicalperiscope,代碼行數:18,代碼來源:Funnel.cs

示例5: OnRenderImage

        void OnRenderImage(RenderTexture source, RenderTexture destination)
        {
            if (_slotIndex >= 0 && _renderTexture)
            {
            if (Application.isEditor || _renderMode != RenderMode.SendOnly)
            {
                // Blit and publish.
                Graphics.Blit(source, destination);
                FunnelSetFrameTexture(
                    _slotIndex,
                    gameObject.name,
                    (int)destination.GetNativeTexturePtr(),
                    screenWidth, screenHeight,
                    _renderTexture.sRGB, !_alphaChannel
                );
            }
            else
            {
                // Publish only.
                FunnelSetFrameTexture(
                    _slotIndex,
                    gameObject.name,
                    (int)source.GetNativeTexturePtr(),
                    screenWidth, screenHeight,
                    _renderTexture.sRGB, !_alphaChannel
                );
            }

            // Push a plugin event to publish the screen.
            GL.IssuePluginEvent(PublishEventID + _slotIndex);
            }
            else
            {
            // Resources are not ready: just blit.
            Graphics.Blit(source, destination);
            }
        }
開發者ID:silky,項目名稱:Funnel,代碼行數:37,代碼來源:Funnel.cs

示例6: SetRenderTexture

 //set the render texture that this camera will render into
 //pass the native hardware pointer to the UnityRenderingPlugin for use in RenderManager
 public void SetRenderTexture(RenderTexture rt)
 {
     RenderToTexture = rt;
     Camera.targetTexture = RenderToTexture;
     RenderTexture.active = RenderToTexture;
     
     //Set the native texture pointer so we can access this texture from the plugin
     Eye.Viewer.DisplayController.RenderManager.SetEyeColorBuffer(RenderToTexture.GetNativeTexturePtr(), (int)Eye.EyeIndex);
 }
開發者ID:SKikuta,項目名稱:OSVR-Unity-Palace-Demo,代碼行數:11,代碼來源:VRSurface.cs

示例7: Write

 public static bool Write(RenderTexture dst_tex, IntPtr src, int src_num, tDataFormat src_fmt)
 {
     return tWriteTexture(
         dst_tex.GetNativeTexturePtr(), dst_tex.width, dst_tex.height,
         GetTextureFormat(dst_tex), src, src_num, src_fmt) != 0;
 }
開發者ID:22Turn,項目名稱:AlembicImporter,代碼行數:6,代碼來源:TextureWriter.cs

示例8: fcExrAddLayerTexture

 public static int fcExrAddLayerTexture(fcEXRContext ctx, RenderTexture tex, int ch, string name, int id)
 {
     return fcExrAddLayerTextureDeferred(ctx, tex.GetNativeTexturePtr(), fcGetPixelFormat(tex.format), ch, name, false, id);
 }
開發者ID:ClintChil,項目名稱:FrameCapturer,代碼行數:4,代碼來源:fcAPI.cs

示例9: fcPngExportTexture

 public static int fcPngExportTexture(fcPNGContext ctx, string path, RenderTexture tex, int pos)
 {
     return fcPngExportTextureDeferred(ctx, path,
         tex.GetNativeTexturePtr(), tex.width, tex.height, fcGetPixelFormat(tex.format), false, pos);
 }
開發者ID:ClintChil,項目名稱:FrameCapturer,代碼行數:5,代碼來源:fcAPI.cs

示例10: fcMP4AddVideoFrameTexture

 public static int fcMP4AddVideoFrameTexture(fcMP4Context ctx, RenderTexture tex, double time, int id)
 {
     return fcMP4AddVideoFrameTextureDeferred(ctx, tex.GetNativeTexturePtr(), fcGetPixelFormat(tex.format), time, id);
 }
開發者ID:ClintChil,項目名稱:FrameCapturer,代碼行數:4,代碼來源:fcAPI.cs

示例11: fcGifAddFrameTexture

 public static int fcGifAddFrameTexture(fcGIFContext ctx, RenderTexture tex, bool keyframe, double timestamp, int id)
 {
     return fcGifAddFrameTextureDeferred(ctx, tex.GetNativeTexturePtr(), fcGetPixelFormat(tex.format), keyframe, timestamp, id);
 }
開發者ID:ClintChil,項目名稱:FrameCapturer,代碼行數:4,代碼來源:fcAPI.cs


注:本文中的UnityEngine.RenderTexture.GetNativeTexturePtr方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。