Пример #1
0
 public static void AddTransparentModel(string modelName, TransparentModelRenderer model)
 {
     if (mAssetLibrary[TransparentModelKey].ContainsKey(modelName))
     {
         throw new Exception("Duplicate transparent model key: " + modelName);
     }
     mAssetLibrary[TransparentModelKey].Add(modelName, model);
 }
Пример #2
0
        public static void EnqueueTransparentRenderable(TransparentModelRenderer.TransparentModelParameters instance)
        {
            if (!mCanRender)
            {
                throw new Exception("Unable to render transparent renderer " + instance.Name + " before calling BeginRendering() or after FinishRendering().\n");
            }

            ModelRenderer renderer = AssetLibrary.LookupTransparentModel(instance.Name);
            if (!(renderer is TransparentModelRenderer))
            {
                renderer = new TransparentModelRenderer(renderer.Model);
            }

            if (!mTransparentRenderQueue.Contains(renderer))
            {
                mTransparentRenderQueue.Add(renderer);
            }

            renderer.AddInstance(instance);

            UpdateSceneExtents(instance);
        }