latest source builds error

Topics: General
May 12, 2007 at 6:56 AM
Hey John, I wanted to check with you on an error i'm getting, you may be aware of it but it's located in the constructor of the framebuffer class during the Formats.Length(3) > RenderTargets(1) check. Also i'm still confused about the difference this would make compared to simply using the .X file format, if you could explain it briefly i'd appreciate it.

Happy coding
May 12, 2007 at 8:27 PM

Do you mean this part: formats.Length > device.GraphicsDeviceCapabilities.NumberSimultaneousRenderTargets? It's probably because you're using a laptop or older video card, I would imagine - something that doesn't support MRT. Right now I'm targeting my dev machine (an HP dv9000 laptop), but one of the to-dos is to make this work for non-SM3.0 (DirectX 9.0c) compatible cards.

The advantage to using my GameLevel classes and content pipeline would be that you could (theoretically) display larger more complicated levels than you could with the X files. I have not completed it yet, and others have let me know where I've messed up and have actually started to help code some, but soon I'll be using a partitioning scheme to break up large levels. The goal is that in the end you could design a city in 3DWS and drag-n-drop it into your game with as little effort as possible and get a decent frame rate out of it.
May 13, 2007 at 4:34 AM
yea you're right my card is vs 2.0, i'll be using build 2187 for now until i upgrade my card or your latest is vs 2.0 friendly (if the later i could simply test the vs 3.0 stuff on the 360) =]

I'll be glad to contribute my findings as well while working with your project.

=] thanks guy
May 13, 2007 at 4:44 AM
I managed to get the entire project working with shader model 2.0, it just takes some work.

I am not sure if I should modify Jonny's code or if I should make my own spin off, which do you think would be best John?
May 13, 2007 at 9:16 PM
Donald, if you want, you can check-in your project. I tried to make the following assemblies:
JohnWells.GameLevel - Should not depend on any shader/gfx cards
JohnWells.GameLevel.ContentPipeline - Ditto
JohnWells.TestGame - A complete waste of code for demo purposes only -> Right now depends on 3.0, but should work with 2.0 as well

I'm not ready to get TestGame working on lower cards because I haven't got it working on higher ones yet :) I've also been slacking because I havn't got BSP working yet either -> Have not played with it yet.

Maybe you could check in your project as DonaldM.TestGame or some other name that lets people know it's not a 'real' game? I took the opportunity to rename my namespaces after CodePlex crashed, I hope they are less confusing now...

May 14, 2007 at 12:10 AM
That might work, I will download your latest source and then see about upgrading it to use some of the code that I wrote.
May 14, 2007 at 3:05 AM
Hey fellas, I also managed to get it working with build 2389 (todays latest build). I believe the only change to get it to work for vs 2.0 cards is changing the following lines in your Standard.fx file...
vertexShader = compile vs30 VertexShader();
pixelShader = compile ps30 PixelShader();
vertexShader = compile vs20 VertexShader();
pixelShader = compile ps20 PixelShader();

I took the liberty of uploading some images of the textures, it's lookin good so far but not perfect.

John could you send me a copy of your highway level? I probably need to read up on your project before i understand how to get lighting to render properly.
May 14, 2007 at 3:18 PM
Hey, looks good!

CodePlex will let you browse through the code all nicely, but it doesn't look like you can download individual binary files anymore, I know you used to be able to do this... Anyways, the Highway Scene.3dw file is in this change set:
You'll have to download the entire change set to get it.

ALL textures are set to my debug texture, 'Debug Grid.png' or something like that.

I had some trouble with sematics not being valid last time I moved it back to vs/ps 2.0 -> If it's that easy I must have removed the offending code long ago! I'll make that change asap.

May 16, 2007 at 3:30 AM
Hey John, apparently there is a bit more to it then changing the Standard.fx file... there are three more parts that need attention.

I have a geforce fx 5200 it has the capabilities of vs/ps 2.0 extended.

1.) An error occurs in the gamelevel's Primitive class of the load content method
Texture texture = manager.Load<Texture>(item.AssetName);
Which gave the following error. "The device does not support creating a texture of the given format with the given ResourceUsage. Parameter name: format". I swapped out your DebugGrid.png file for a bmp file.

2.) The number of RenderTargets my device is capable of is only 1 so in the playscreen class line
SurfaceFormat[] formats = { SurfaceFormat.HalfVector4, SurfaceFormat.HalfVector4, SurfaceFormat.HalfVector4 };
was swapped with
SurfaceFormat[] formats = { SurfaceFormat.HalfVector4 };

3.) In the playscreen class in the draw method
was cut down to
because buffer[] only has one texture.

I didn't really have much time this week to read through your project to help more but after these three changes the map runs but without proper lighting.
Here is a screenshot...
May 18, 2007 at 1:37 PM
Hmmm... I'll have to make the test game work with forward-lighting and not use the fancy multi-render target lighting. Don't worry, atm it's not fancy for me either. Someday! I wonder what format the DebugGrid asset ends up being, it should be a pretty simple one.

Thanks for all the great detail!