当前位置: 首页>>代码示例>>C#>>正文


C# Library.Get方法代码示例

本文整理汇总了C#中Library.Get方法的典型用法代码示例。如果您正苦于以下问题:C# Library.Get方法的具体用法?C# Library.Get怎么用?C# Library.Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Library的用法示例。


在下文中一共展示了Library.Get方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OpenFrame

        public void OpenFrame(Library.Entity.Frames.FrameDescription frame)
        {
            this.CurrentFrame = new FrameConfiguration();

            this.config.Merge(frame);
            this.OutputSettings = new OutputSettingsInfo(frame);
            this.QualitySettings = new QualitySettingsInfo(frame);

            this.FrameName = frame.FrameName;

            if (!string.IsNullOrWhiteSpace(frame.WorkingDir))
                Directory.SetCurrentDirectory(frame.WorkingDir);
            /*
            foreach (var frameElement in frame.Elements.Where(frameElement => frameParsers.ContainsKey(frameElement.GetType()))) {
                frameParsers[frameElement.GetType()](frameElement);
            }*/

            if (Scene == null)
            {
                SceneGraphService svc = new SceneGraphService();
                svc.Populate(
                    //new ObjLoader(),
                    new GlobalIndexObjLoader(),
                    new MaterialLoader());

                //svc.OpenFrame(frame);
                _builder = new SceneBuilder() { SGService = svc };
                _builder.Setup();
                this.SceneGraph = _builder.SGService.SceneGraph;
                this.Scene = _builder.OpenFrame(frame, this.AreaLightAsMeshLight);

                this.Scene.DefaultLightGain = config.Get("LightGain", new RgbSpectrum(1.0f));
                this.Scene.MaxPathDepth = config.Get("MaxPathDepth", 10);
                this.Scene.RussianRuletteImportanceCap = config.Get("RRImportanceCap", 0.75f);
                this.Scene.MaxPaths = config.Get("PathBufferSize", 65536);
                this.Scene.ShadowRayCount = config.Get("ShadowRayCount", 1);
                this.Scene.TextureSamplingQuality = this.QualitySettings.TextureSamplingQuality;
                this.Scene.LightSamplingStrategy = this.QualitySettings.LightSamplingStrategy;
                RgbSpectrum.Gamma = true;
                /*
                if (GlobalConfiguration.Instance.SpectralRendering)
                {
                    this.Scene.SpectralMats = new BxDFLibrary(new LambertianBrdf(new[] { 0.5f, 0.5f, 0.5f }));
                    this.Scene.SpectralMats.Populate(_builder.MaterialInfos.ToArray());
                }
                else*/

                {
                    this.Scene.MatLib = this.dependencyManager.GetMaterialPlugin(_builder.MaterialInfos.ToArray());
                    if (_builder.FrameMaterialBuilder != null)
                    {
                        this.Scene.MatLib.Add(_builder.FrameMaterialBuilder.Materials);
                        _builder.FrameMaterialBuilder.CreateRayEngineMaterials(this.Scene);
                    }
                    //if (EnableMaterialOverrides) FrameMaterialBuilder.ApplyMaterialOverrides((this.Scene.MatLib as OptimizedBsdfLibrary).Materials, Scene);
                }


                RenderThreadsCount = config.Get("RenderThreadsCount", 1);
                this.scene = _builder.SceneGeo;

                var sceneBound = new AABB(scene.BoundingSphereCenter - scene.BoundingSphereRadius,
                                          scene.BoundingSphereCenter + scene.BoundingSphereRadius);
                sceneBound.Expand(1f);

                //var viewBound = new AABB(Scene.Camera.Target - 5f, Scene.Camera.Target + 5f);
                var c = new Point(Scene.Camera.Target);
                var bb = new AABB(c - 1f, c + 1f);
                var volumeBound = sceneBound;

                Scene.VolumeIntegrator = new SingleScatteringIntegrator(volumeBound,
                                                                         volumeBound.Size.Length / 10f, //step
                                                                         0.05f, //Probability
                                                                         RgbSpectrum.UnitSpectrum() * 0.05f,  //Inscatering
                                                                         new RgbSpectrum(0.000f)             //Emission

                                                                       );
                new RayEngineMaterialBuilder().BuildMaterials(this.Scene);
            }
            this.CurrentFrame.Width = frame.Get<int>("ImageWidth");
            this.CurrentFrame.Height = frame.Get<int>("ImageHeight");
            this.CurrentFrame.ImageSavePath = this.SavePath;
            this.CurrentFrame.LowLatency = lowLatency;
            this.CurrentFrame.MaxSamplesPerPixel = this.QualitySettings.SamplesPerPixel;

            this.Initialize();
            this.Scene.BuildPrimitives();
        }
开发者ID:HungryBear,项目名称:rayden,代码行数:88,代码来源:CorrectorEngineConfiguration.cs


注:本文中的Library.Get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。