Example #1
0
        public bool Load()
        {
            if(!s_initialized)
            {
                OpenVDBAPI.oiInitialize();
                s_initialized = true;
            }
            var context = oiContext.Create(m_go.GetInstanceID());
            var settings = m_streamDescriptor.settings;

            var config = new oiConfig();
            config.SetDefaults();
            config.scaleFactor = settings.scaleFactor;
            config.textureMaxSize = settings.textureMaxSize;

            context.SetConfig(ref config);
            var path = Path.Combine(Application.streamingAssetsPath, m_streamDescriptor.pathToVDB);
            var loaded = context.Load(path);
            if(loaded)
            {
                UpdateVDB(context);
                s_streams.Add(this);
            }
            else
            {
                Debug.LogError("failed to load openvdb at " + path);
                return false;
            }
            return true;
        }
Example #2
0
 [DllImport("openvdbi")] static extern void oiContextSetConfig(IntPtr ctx, ref oiConfig conf);
Example #3
0
 public void SetConfig(ref oiConfig conf)
 {
     oiContextSetConfig(self, ref conf);
 }