public PPixelLightEffect(Device device, HashTableSettings settings, ushort lod) : base("Adv. Lighting", device, settings, 0, 1, lod) { efxType = EffectType.Shading; oReqs[0] = new OutputRequirements(DeviceType.Hardware, true, new Version(1, 1), new Version(1, 1)); oReqs[1] = new OutputRequirements(DeviceType.Hardware, true, new Version(1, 1), new Version(2, 0)); }
// Texture testTexture; public BloomEffect(Device device, HashTableSettings settings) : base("Bloom", device, settings, 0, 0, 0) { efxType = EffectType.Shading; oReqs[0] = new OutputRequirements(DeviceType.Hardware, true, new Version(2, 0), new Version(1, 1)); this.numPasses = 4; }
public OutputCapsCompatibility CheckCompatibility(OutputRequirements req) { OutputCapsCompatibility comp = new OutputCapsCompatibility(); comp.supportDeviceType = Manager.CheckDeviceType(adapter, req.DeviceType, req.DeviceFormat, req.DeviceFormat, req.Windowed); comp.supportDeviceFormat = true;// Manager.CheckDeviceFormat(adapter, req.DeviceType, req.DeviceFormat, Usage.RenderTarget, ResourceType.Surface, DepthFormat.D16); comp.supportDepthFormat = Manager.CheckDepthStencilMatch(adapter, req.DeviceType, req.DeviceFormat, req.DeviceFormat, req.DepthFormat); return(comp); }
public RequirementsCompatibility CheckCapabilities(OutputRequirements reqs) { RequirementsCompatibility rComp = new RequirementsCompatibility(); // check shaders Version buildZero = new Version(); rComp.PS = !(reqs.PixelShader != null && reqs.PixelShader.CompareTo(this.pShaderVersion) > 0); rComp.VS = !(reqs.VertexShader != null && reqs.VertexShader.CompareTo(this.vShaderVersion) > 0); rComp.Mark(); return(rComp); }
public CommonDeviceInterface(int adapter, OutputRequirements baseReq, OutputRequirements minReq, string base_path) { this.adapter = adapter; this.outCaps = OutputCaps.GetAdapterCaps(adapter, baseReq.DeviceType, baseReq.DeviceFormat); this.minSettings = OutputSettings.CreateFromRequirements(baseReq, outCaps, minReq); rzManager = new NuGenSVisualLib.Resources.ResourceManager(); rzManager.AddSet(new NuGenSVisualLib.Resources.ResourceSet(GlobalResources)); log = new DirectFileLog(base_path + "general.log"); rzLoader = new RzLoader(); rzLoader.RegisterContentLoader(new ImageContentLoader()); }
public CommonDeviceInterface(int adapter, OutputRequirements baseReq, OutputRequirements minReq, string base_path) { this.adapter = adapter; this.outCaps = OutputCaps.GetAdapterCaps(adapter, baseReq.DeviceType, baseReq.DeviceFormat); this.minSettings = OutputSettings.CreateFromRequirements(baseReq, outCaps, minReq); rzManager = new NuGenSVisualLib.Resources.ResourceManager(); rzManager.AddSet(new NuGenSVisualLib.Resources.ResourceSet(GlobalResources)); log = new DirectFileLog(base_path + "general.log"); rzLoader = new RzLoader(); rzLoader.RegisterContentLoader(new ImageContentLoader()); }
public RenderingContext3DDX9(Control targetRenderArea, OutputRequirements oRequirements, OutputRequirements oMinReqs, CommonDeviceInterface cdi) { isDeviceLost = false; isActive = false; hasFocus = false; this.targetRenderArea = targetRenderArea; outReqs = oRequirements; outMinReqs = oMinReqs; log = cdi.GeneralLog; presentParams = new PresentParameters(); outCaps = cdi.DeviceCaps; layers = new LayerStack(); InitializeEnvironment(cdi); view3D = new RenderingView3DPer(Matrix.Identity, Matrix.Identity); }
public static OutputCaps GetDefaultAdapterCaps(OutputRequirements req) { return(GetAdapterCaps(Manager.Adapters.Default.Adapter, req.DeviceType, req.DeviceFormat)); }
public PerlinImprovedNoiseEffect(Device device, HashTableSettings settings) : base("Perlin Noise", device, settings, 0, 0, 0) { efxType = EffectType.Shading; oReqs[0] = new OutputRequirements(DeviceType.Hardware, true, new Version(1, 1), new Version(2, 1)); }
public static OutputSettings CreateFromRequirements(OutputRequirements requirements, OutputCaps caps, OutputRequirements fallbacks) { if (caps == null) caps = OutputCaps.GetDefaultAdapterCaps(requirements); OutputSettings settings = new OutputSettings(); settings.adapter = caps.Adapter; Type type = typeof(OutputSettings); OutputCaps.OutputCapsCompatibility reqComp = caps.CheckCompatibility(requirements); OutputCaps.OutputCapsCompatibility fallbackComp = caps.CheckCompatibility(fallbacks); // check reqs against caps if (reqComp.SupportDeviceType) settings.devType = requirements.DeviceType; else if (fallbackComp.SupportDeviceType) settings.devType = fallbacks.DeviceType; else throw new OutputSettingsException(type.GetProperty("DeviceType"), requirements.DeviceType, null); if (reqComp.SupportDeviceFormat) settings.devFormat = requirements.DeviceFormat; else if (fallbackComp.SupportDeviceFormat) settings.devFormat = fallbacks.DeviceFormat; else throw new OutputSettingsException(type.GetProperty("DeviceFormat"), requirements.DeviceFormat, null); if (reqComp.SupportDepthFormat) settings.depthFormat = requirements.DepthFormat; else if (fallbackComp.SupportDepthFormat) settings.depthFormat = fallbacks.DepthFormat; else throw new OutputSettingsException(type.GetProperty("DepthFormat"), requirements.DepthFormat, null); if (caps.HardwareTnL && requirements.HardwareTnL) settings.createFlags = CreateFlags.HardwareVertexProcessing; else if (!requirements.HardwareTnL) settings.createFlags = CreateFlags.SoftwareVertexProcessing; else if (!fallbacks.HardwareTnL) settings.createFlags = CreateFlags.SoftwareVertexProcessing; else throw new OutputSettingsException(type.GetProperty("CreateFlags"), requirements.HardwareTnL, null); if (requirements.AntiAliasing <= caps.AntiAliasing.MaxSupported) settings.antiAliasing = requirements.AntiAliasing; else if (fallbacks.AntiAliasing <= caps.AntiAliasing.MaxSupported) settings.antiAliasing = fallbacks.AntiAliasing; else throw new OutputSettingsException(type.GetProperty("AntiAliasing"), requirements.AntiAliasing, caps.AntiAliasing.MaxSupported); return settings; }
public static OutputSettings CreateFromRequirements(OutputRequirements requirements, OutputCaps caps, OutputRequirements fallbacks) { if (caps == null) { caps = OutputCaps.GetDefaultAdapterCaps(requirements); } OutputSettings settings = new OutputSettings(); settings.adapter = caps.Adapter; Type type = typeof(OutputSettings); OutputCaps.OutputCapsCompatibility reqComp = caps.CheckCompatibility(requirements); OutputCaps.OutputCapsCompatibility fallbackComp = caps.CheckCompatibility(fallbacks); // check reqs against caps if (reqComp.SupportDeviceType) { settings.devType = requirements.DeviceType; } else if (fallbackComp.SupportDeviceType) { settings.devType = fallbacks.DeviceType; } else { throw new OutputSettingsException(type.GetProperty("DeviceType"), requirements.DeviceType, null); } if (reqComp.SupportDeviceFormat) { settings.devFormat = requirements.DeviceFormat; } else if (fallbackComp.SupportDeviceFormat) { settings.devFormat = fallbacks.DeviceFormat; } else { throw new OutputSettingsException(type.GetProperty("DeviceFormat"), requirements.DeviceFormat, null); } if (reqComp.SupportDepthFormat) { settings.depthFormat = requirements.DepthFormat; } else if (fallbackComp.SupportDepthFormat) { settings.depthFormat = fallbacks.DepthFormat; } else { throw new OutputSettingsException(type.GetProperty("DepthFormat"), requirements.DepthFormat, null); } if (caps.HardwareTnL && requirements.HardwareTnL) { settings.createFlags = CreateFlags.HardwareVertexProcessing; } else if (!requirements.HardwareTnL) { settings.createFlags = CreateFlags.SoftwareVertexProcessing; } else if (!fallbacks.HardwareTnL) { settings.createFlags = CreateFlags.SoftwareVertexProcessing; } else { throw new OutputSettingsException(type.GetProperty("CreateFlags"), requirements.HardwareTnL, null); } if (requirements.AntiAliasing <= caps.AntiAliasing.MaxSupported) { settings.antiAliasing = requirements.AntiAliasing; } else if (fallbacks.AntiAliasing <= caps.AntiAliasing.MaxSupported) { settings.antiAliasing = fallbacks.AntiAliasing; } else { throw new OutputSettingsException(type.GetProperty("AntiAliasing"), requirements.AntiAliasing, caps.AntiAliasing.MaxSupported); } return(settings); }