4 using SiliconStudio.Paradox.Effects.Modules;
5 using SiliconStudio.Paradox.Effects.Yebis;
6 using SiliconStudio.Paradox.Graphics;
8 namespace SiliconStudio.
Paradox.Effects
12 private Manager yebis;
43 yebis =
new Manager();
44 ToneMap = yebis.Config.ToneMap;
45 Glare = yebis.Config.Glare;
46 ColorCorrection = yebis.Config.ColorCorrection;
47 Lens = yebis.Config.Lens;
48 DepthOfField = yebis.Config.DepthOfField;
49 HeatShimmer = yebis.Config.HeatShimmer;
50 LightShaft = yebis.Config.LightShaft;
51 PreferredFormat = PixelFormat.R16G16B16A16_Float;
54 Tags.Set(RenderTargetKeys.RequireDepthStencilShaderResource,
true);
67 private void CopyParametersToYebis()
70 if (ViewParameters != null)
72 yebis.Config.Camera.NearClipPlane = ViewParameters.Get(CameraKeys.NearClipPlane);
73 yebis.Config.Camera.FarClipPlane = ViewParameters.Get(CameraKeys.FarClipPlane);
74 yebis.Config.Camera.FieldOfView = ViewParameters.Get(CameraKeys.FieldOfView);
75 ViewParameters.Get(TransformationKeys.View, out yebis.Config.Camera.View);
78 yebis.Config.Camera.IsZReverse = yebis.Config.Camera.NearClipPlane > yebis.Config.Camera.FarClipPlane;
79 float nearClipPlane = yebis.Config.Camera.IsZReverse ? yebis.Config.Camera.FarClipPlane : yebis.Config.Camera.NearClipPlane;
80 float farClipPlane = yebis.Config.Camera.IsZReverse ? yebis.Config.Camera.NearClipPlane : yebis.Config.Camera.FarClipPlane;
81 yebis.Config.Camera.NearClipPlane = nearClipPlane;
82 yebis.Config.Camera.FarClipPlane = farClipPlane;
84 var focusDistance = ViewParameters.Get(CameraKeys.FocusDistance);
85 DepthOfField.AutoFocus = (focusDistance < 0.01);
86 if (!DepthOfField.AutoFocus)
88 DepthOfField.FocusDistance = focusDistance;
92 yebis.Config.AntiAlias = AntiAlias;
93 yebis.Config.ToneMap = ToneMap;
94 yebis.Config.Glare = Glare;
95 yebis.Config.ColorCorrection = ColorCorrection;
96 yebis.Config.Lens = Lens;
97 yebis.Config.DepthOfField = DepthOfField;
98 yebis.Config.HeatShimmer = HeatShimmer;
99 yebis.Config.LightShaft = LightShaft;
106 if (OfflineCompilation)
109 RenderPass.StartPass += (context) =>
111 CopyParametersToYebis();
114 if (ToneMap.AutoExposure.Enable)
115 ToneMap.Exposure = yebis.Config.ToneMap.Exposure;
117 DepthOfField.FocusDistance = yebis.Config.DepthOfField.FocusDistance;
125 yebis.SetSource(RenderSource, SourceDepth.Texture);
DepthOfField DepthOfField
A renderable texture view.
YebisPlugin()
Initializes a new instance of the YebisPlugin class.
Performs primitive-based rendering, creates resources, handles system-level variables, adjusts gamma ramp levels, and creates shaders. See The+GraphicsDevice+class to learn more about the class.
A Texture 2D frontend to SharpDX.Direct3D11.Texture2D.
YebisPlugin(string name)
Initializes a new instance of the YebisPlugin class.
ColorCorrection ColorCorrection
PixelFormat
Defines various types of pixel formats.
A container to handle a hierarchical collection of effect variables.