danskcarvalho

My graphics card doesn't support Pixel and Vertex shader so i won't be able to do anything interesting with XNA, it's what i have heard. So i started thinking: will i be able to utilize the reference rasterizer (only to learn XNA)
XNA supports reference rasterizer in addition to the HAL rasterizer


Re: XNA Framework Reference rasterizer

Paul Bleisch

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






Re: XNA Framework Reference rasterizer

Naicigam

Can you be more specific on this Maybe a code example

I can't find how to make the GraphicsComponent GraphicsDeviceService to be a DeviceType.Reference.

Thanks in advance and continue with the great job!





Re: XNA Framework Reference rasterizer

rock.aut

I tried to add the ModifyDevice event, but it never was fired... in fact not before the device is created and the exception thrown...





Re: XNA Framework Reference rasterizer

rock.aut

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;

}

}

}






Re: XNA Framework Reference rasterizer

yoda dip jp

In my enviroment
CreateOptions.SoftwareVertexProcessing
does not work.
I changed it to
CreateOptions.HardwareVertexProcessing
It worked. But I don't know what it means.





Re: XNA Framework Reference rasterizer

rock.aut

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...






Re: XNA Framework Reference rasterizer

Smacker

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





Re: XNA Framework Reference rasterizer

Paul Bleisch

We added an explicit check for a SM 1.1 hardware device with DDI9 drivers for v1.0. So you need to have hardware (even if you are using the reference rasterizer) in order to create the GraphicsDevice.




Re: XNA Framework Reference rasterizer

danskcarvalho

Why What's the reason behind this Anyway my new graphics card with support for SM 3.0 is on the way... This doesn't matter for me anymore... Anyway it's a bit odd for me!



Re: XNA Framework Reference rasterizer

JR-MDX

It seems bizarre to force SM 1.1+ compliance when using the reference rasterizer... Here is a good workaround http://www.nuclex.org/articles/using-the-reference-rasterizer-in-xna



Re: XNA Framework Reference rasterizer

spongman

you didn't answer the question: why

chalk up another one for the wtf brigade...