Reference rasterizer
XNA supports reference rasterizer in addition to the HAL rasterizer?
If you are using the GraphicsDevice directly (not using the XNA appmodel's GraphicsComponent), then you can just pass in DeviceType.Reference.
If you would like to use the GraphicsComponent (or the starter kits), the default graphics device enumeration does not include refrast. You can override the default behavior by adding a ModifyDevice event handler to force the device type to DeviceType.Reference.
In either case, you'll need to an appropriate DXSDK installed.
Paul
I can't find how to make the GraphicsComponent GraphicsDeviceService to be a DeviceType.Reference.
Thanks in advance and continue with the great job!
Haha...
Finally i got some time (beside my job... so dont say it my boss
) and get it up running...
I just took my own class wich inherits from the standard GraphicsComponent and override the FindBestDevice Method in wich the Exception is thrown... then create your own GraphicsDeviceInformation and return it... an you got your reference rasterizer...
public
partial class myGraphics : Microsoft.Xna.Framework.Components.GraphicsComponent{
protected override GraphicsDeviceInformation FindBestDevice(bool anySuitableDevice)
{
try
{
return base.FindBestDevice(anySuitableDevice);}
catch (NoSuitableGraphicsDeviceException){
GraphicsDeviceInformation info = new GraphicsDeviceInformation();info.CreateParameters =
new GraphicsDeviceCreationParameters(GraphicsAdapter.DefaultAdapter,DeviceType.Reference,Game.Window.Handle,
CreateOptions.SoftwareVertexProcessing);PresentationParameters pp = new PresentationParameters();pp.BackBufferWidth =
this.BackBufferWidth;pp.BackBufferHeight =
this.BackBufferHeight;pp.BackBufferFormat =
this.BackBufferFormat;pp.AutoDepthStencilFormat =
this.DepthStencilFormat;pp.EnableAutoDepthStencil =
true;pp.IsFullScreen =
this.IsFullScreen;info.PresentationParameters =
new PresentationParameters[1] { pp };return info;}
catch (Exception ex){
throw ex;}
}
}
In my enviroment
CreateOptions.SoftwareVertexProcessing
does not work.
I changed it to
CreateOptions.HardwareVertexProcessing
It worked. But I don't know what it means.
HardwareVertexProcessing means, that your Graphicscard supporting T&L wich most of the DX9 supporting adapters do... with SoftwareVertexProcessing it all ist done by your CPU.
Try to install the DirectX SDK and look in the Help files there. It's a big download but helping out not only with XNA...
I was looking at the doc's for XNA and it says you can use
PreparingDeviceSettings event found in the GraphicsDeviceManager
so I did this
graphics =
new GraphicsDeviceManager(this);graphics.PreparingDeviceSettings +=
new EventHandler<PreparingDeviceSettingsEventArgs>(graphics_PreparingDeviceSettings);then in graphics_PreparingDeviceSettings
void
graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e){
e.GraphicsDeviceInformation.CreationOptions =
CreateOptions.SoftwareVertexProcessing;e.GraphicsDeviceInformation.DeviceType =
DeviceType.Reference;e.GraphicsDeviceInformation.PresentationParameters.MultiSampleType =
MultiSampleType.None;}
now the problem with this is that when you call
game.Run();
it will still throw a exception
Could not find a Direct3D device that has a Direct3D9-level driver and supports pixel shader 1.1 or greater.
now this use to work in beta 2 but in the release 1.0 it doesent work, though I have a comp with a gfx card thats compatible I like to program on my laptop witch does not have a compatable card.
is there a reason why this worked in beta 2.0 and not in 1.0?
regards,
j