Exemple #1
0
        // this is used for unity 5.6
        //public IntPtr GetEyeTexturePtr56(dpncEYE eye) { return _texture_ptrs[(_current_texture_index + _texture_count + (int)eye - 2) % _texture_count]; }

        private void ConfigureEyeTexture
            (int buffer_index, dpncEYE eye
            , TEXTURE_DEPTH texture_depth
            , RenderTextureFormat texture_format
            , int texture_w, int texture_h
            )
        {
            int tex_index = buffer_index + (int)eye;

            _textures[tex_index] = new RenderTexture
                                       (texture_w, texture_h
                                       , (int)texture_depth, texture_format);

            if (QualitySettings.antiAliasing != 0)
            {
                _textures[tex_index].antiAliasing = QualitySettings.antiAliasing;
            }
            else
            {
                        #if UNITY_ANDROID && !UNITY_EDITOR
                _textures[tex_index].antiAliasing = 4;
                        #else
                _textures[tex_index].antiAliasing = 1;
                        #endif
            }

            _textures[tex_index].Create();

            _texture_ptrs[tex_index] = _textures[tex_index].GetNativeTexturePtr();
        }
Exemple #2
0
 /// <summary>
 /// Initialization Buffers. Called by DpnManager.
 /// </summary>
 public void Init
     (TEXTURE_DEPTH texture_depth
     , RenderTextureFormat texture_format
     , int texture_w, int texture_h
     )
 {
     for (int i = 0; i < _texture_count; i += 2)
     {
         ConfigureEyeTexture(i, dpncEYE.LEFT
                             , texture_depth
                             , texture_format
                             , texture_w, texture_h);
         ConfigureEyeTexture(i, dpncEYE.RIGHT
                             , texture_depth
                             , texture_format
                             , texture_w, texture_h);
     }
 }