コード例 #1
0
 public override void Process(SceneReaderContext context)
 {
     context.VerifyOptions("WorldBegin");
     context.CurrentState = SceneReaderState.WorldBlock;
     for (var i = 0; i < TransformSet.MaxTransforms; i++)
         context.CurrentTransform[i] = new Transform();
     context.ActiveTransformBits = TransformSet.AllTransformsBits;
     context.NamedCoordinateSystems["world"] = context.CurrentTransform;
 }
コード例 #2
0
 public override void Process(SceneReaderContext context)
 {
     context.VerifyOptions("WorldBegin");
     context.CurrentState = SceneReaderState.WorldBlock;
     for (var i = 0; i < TransformSet.MaxTransforms; i++)
     {
         context.CurrentTransform[i] = new Transform();
     }
     context.ActiveTransformBits             = TransformSet.AllTransformsBits;
     context.NamedCoordinateSystems["world"] = context.CurrentTransform;
 }
コード例 #3
0
 public override void Process(SceneReaderContext context)
 {
     context.VerifyOptions("TransformTimes");
     context.RenderOptions.TransformStartTime = Start;
     context.RenderOptions.TransformEndTime = End;
 }
コード例 #4
0
 public override void Process(SceneReaderContext context)
 {
     context.VerifyOptions("TransformTimes");
     context.RenderOptions.TransformStartTime = Start;
     context.RenderOptions.TransformEndTime   = End;
 }
コード例 #5
0
 public override void Process(SceneReaderContext context)
 {
     switch (DirectiveType)
     {
         case StandardDirectiveType.Accelerator:
             context.VerifyOptions("Accelerator");
             context.RenderOptions.AcceleratorName = ImplementationType;
             context.RenderOptions.AcceleratorParams = Parameters;
             break;
         case StandardDirectiveType.AreaLightSource:
             context.VerifyWorld("AreaLightSource");
             context.GraphicsState.AreaLight = ImplementationType;
             context.GraphicsState.AreaLightParams = Parameters;
             break;
         case StandardDirectiveType.Camera:
             context.VerifyOptions("Camera");
             context.RenderOptions.CameraName = ImplementationType;
             context.RenderOptions.CameraParams = Parameters;
             context.RenderOptions.CameraToWorld = TransformSet.Invert(context.CurrentTransform);
             context.NamedCoordinateSystems["camera"] = context.RenderOptions.CameraToWorld;
             break;
         case StandardDirectiveType.Film:
             context.VerifyOptions("Film");
             context.RenderOptions.FilmName = ImplementationType;
             context.RenderOptions.FilmParams = Parameters;
             break;
         case StandardDirectiveType.LightSource:
             context.VerifyWorld("LightSource");
             context.RenderOptions.Lights.Add(Factories.MakeLight(
                 ImplementationType, context.CurrentTransform[0], Parameters));
             break;
         case StandardDirectiveType.Material:
             context.VerifyWorld("Material");
             context.GraphicsState.Material = ImplementationType;
             context.GraphicsState.MaterialParams = Parameters;
             context.GraphicsState.CurrentNamedMaterial = "";
             break;
         case StandardDirectiveType.PixelFilter:
             context.VerifyOptions("PixelFilter");
             context.RenderOptions.FilterName = ImplementationType;
             context.RenderOptions.FilterParams = Parameters;
             break;
         case StandardDirectiveType.Renderer:
             context.VerifyOptions("Renderer");
             context.RenderOptions.RendererName = ImplementationType;
             context.RenderOptions.RendererParams = Parameters;
             break;
         case StandardDirectiveType.Sampler:
             context.VerifyOptions("Sampler");
             context.RenderOptions.SamplerName = ImplementationType;
             context.RenderOptions.SamplerParams = Parameters;
             break;
         case StandardDirectiveType.Shape:
             context.VerifyWorld("Shape");
             ProcessShape(context);
             break;
         case StandardDirectiveType.SurfaceIntegrator:
             context.VerifyOptions("SurfaceIntegrator");
             context.RenderOptions.SurfaceIntegratorName = ImplementationType;
             context.RenderOptions.SurfaceIntegratorParams = Parameters;
             break;
         case StandardDirectiveType.Volume:
             context.VerifyWorld("Volume");
             context.RenderOptions.VolumeRegions.Add(Factories.MakeVolumeRegion(
                 ImplementationType, context.CurrentTransform[0], Parameters));
             break;
         case StandardDirectiveType.VolumeIntegrator:
             context.VerifyOptions("VolumeIntegrator");
             context.RenderOptions.VolumeIntegratorName = ImplementationType;
             context.RenderOptions.VolumeIntegratorParams = Parameters;
             break;
         default:
             throw new ArgumentOutOfRangeException();
     }
 }
コード例 #6
0
ファイル: StandardDirective.cs プロジェクト: MassVOiD/aether
        public override void Process(SceneReaderContext context)
        {
            switch (DirectiveType)
            {
            case StandardDirectiveType.Accelerator:
                context.VerifyOptions("Accelerator");
                context.RenderOptions.AcceleratorName   = ImplementationType;
                context.RenderOptions.AcceleratorParams = Parameters;
                break;

            case StandardDirectiveType.AreaLightSource:
                context.VerifyWorld("AreaLightSource");
                context.GraphicsState.AreaLight       = ImplementationType;
                context.GraphicsState.AreaLightParams = Parameters;
                break;

            case StandardDirectiveType.Camera:
                context.VerifyOptions("Camera");
                context.RenderOptions.CameraName         = ImplementationType;
                context.RenderOptions.CameraParams       = Parameters;
                context.RenderOptions.CameraToWorld      = TransformSet.Invert(context.CurrentTransform);
                context.NamedCoordinateSystems["camera"] = context.RenderOptions.CameraToWorld;
                break;

            case StandardDirectiveType.Film:
                context.VerifyOptions("Film");
                context.RenderOptions.FilmName   = ImplementationType;
                context.RenderOptions.FilmParams = Parameters;
                break;

            case StandardDirectiveType.LightSource:
                context.VerifyWorld("LightSource");
                context.RenderOptions.Lights.Add(Factories.MakeLight(
                                                     ImplementationType, context.CurrentTransform[0], Parameters));
                break;

            case StandardDirectiveType.Material:
                context.VerifyWorld("Material");
                context.GraphicsState.Material             = ImplementationType;
                context.GraphicsState.MaterialParams       = Parameters;
                context.GraphicsState.CurrentNamedMaterial = "";
                break;

            case StandardDirectiveType.PixelFilter:
                context.VerifyOptions("PixelFilter");
                context.RenderOptions.FilterName   = ImplementationType;
                context.RenderOptions.FilterParams = Parameters;
                break;

            case StandardDirectiveType.Renderer:
                context.VerifyOptions("Renderer");
                context.RenderOptions.RendererName   = ImplementationType;
                context.RenderOptions.RendererParams = Parameters;
                break;

            case StandardDirectiveType.Sampler:
                context.VerifyOptions("Sampler");
                context.RenderOptions.SamplerName   = ImplementationType;
                context.RenderOptions.SamplerParams = Parameters;
                break;

            case StandardDirectiveType.Shape:
                context.VerifyWorld("Shape");
                ProcessShape(context);
                break;

            case StandardDirectiveType.SurfaceIntegrator:
                context.VerifyOptions("SurfaceIntegrator");
                context.RenderOptions.SurfaceIntegratorName   = ImplementationType;
                context.RenderOptions.SurfaceIntegratorParams = Parameters;
                break;

            case StandardDirectiveType.Volume:
                context.VerifyWorld("Volume");
                context.RenderOptions.VolumeRegions.Add(Factories.MakeVolumeRegion(
                                                            ImplementationType, context.CurrentTransform[0], Parameters));
                break;

            case StandardDirectiveType.VolumeIntegrator:
                context.VerifyOptions("VolumeIntegrator");
                context.RenderOptions.VolumeIntegratorName   = ImplementationType;
                context.RenderOptions.VolumeIntegratorParams = Parameters;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }