Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6
This is the forum to discuss the Wrox book Professional XNA Game Programming: For Xbox 360 and Windows by Benjamin Nitschke; ISBN: 9780470126776
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old May 3rd, 2007, 06:48 PM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 11: XNA Shooter - black screen

I installed the XNA shooter project (using the installer provided in the download), and although I can hear sounds, I get nothing but a black screen when I enter a mission - the main menu is fine.

My laptop exceeds the minimum requirements, and I have all relevant software installed.

Anything to do with monitor refresh rates maybe?

There is a log file saying:

[22:49:18] Creating RenderToTexture failed: System.InvalidOperationException: The method call is invalid.
   at Microsoft.Xna.Framework.Graphics.RenderTarget..cto r(GraphicsDevice graphicsDevice, Int32 width, Int32 height, Int32 numberLevels, SurfaceFormat format, MultiSampleType multiSampleType, Int32 multiSampleQuality, Boolean isTexture2D)
   at Microsoft.Xna.Framework.Graphics.RenderTarget2D..c tor(GraphicsDevice graphicsDevice, Int32 width, Int32 height, Int32 numberLevels, SurfaceFormat format, MultiSampleType multiSampleType, Int32 multiSampleQuality)
   at XnaShooter.Shaders.RenderToTexture.Create()
[22:49:37] Failed to execute Mission
Error: System.Exception: You can't call Resolve without first setting the render target!
   at XnaShooter.Shaders.RenderToTexture.Resolve()
   at XnaShooter.Shaders.ShadowMapShader.GenerateShadows (RenderDelegate renderObjects)
   at XnaShooter.GameScreens.Mission.RenderLevelBackgrou nd(Single levelPosition)
   at XnaShooter.GameScreens.Mission.Run(XnaShooterGame game)
   at XnaShooter.XnaShooterGame.Draw(GameTime gameTime) .......

  #2 (permalink)  
Old May 3rd, 2007, 07:34 PM
Wrox Author
 
Join Date: May 2007
Location: Hannover, , Germany.
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to abi.exdream.com
Default

It looks like your graphic card is refusing to render the shadow map render target texture because the multi sample type is not supported. Try using MultiSampleType.None in the BaseGame constructor or try to disable the shadow mapping all together. I will try to add a few more options to the GameSettings xml file in order to disable these advanced effects without having to edit the source code.

http://abi.exdream.com
  #3 (permalink)  
Old May 11th, 2007, 01:46 AM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Abi,

I too also had the problem;
Changing
// Always turn on multisampling, looks much nice, especially on the Xbox360
this.graphics.PreferMultiSampling = true;

to
this.graphics.PreferMultiSampling = false;
In the BaseGame.cs made it work on the PC


  #4 (permalink)  
Old August 4th, 2007, 08:32 AM
Registered User
 
Join Date: Jul 2007
Location: Swansea, , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Great! Thanks for this! I was having problems with the mission. What does multi sampling do exactly? And why does my graphics card refuse to render it?



Similar Threads
Thread Thread Starter Forum Replies Last Post
chapter 11 figure 11-7 relative positioning pelopito BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 2 November 29th, 2007 06:11 AM
XNA shooter problem alexmbr BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 0 August 10th, 2007 06:26 PM
XNA Shooter - Black Screen DMP_HERE BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 4 August 5th, 2007 06:04 AM
XNA Shooter not working... savagesoft BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 7 May 11th, 2007 02:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.