XNA Game Development Forums
2012/05/21 20:40:35 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Calendar Login Register  
Pages: 1 2 3 [4]
  Print  
Author Topic: Tutorial 3 :: More Rendering Complexity - Shaders and Cameras  (Read 17445 times)
3VilJay
Newbie
*
Offline Offline

Posts: 1


View Profile
« Reply #45 on: 2009/04/27 17:21:27 »

Here are the settings for the shader file:

Build Action: Content
Content Importer: Effect - XNA Framework
Content Processor: Effect - XNA Framework
Copy to Output Directory: Do Not Copy
XNA Framework Content: True

OK Total N00B here, but I can read and type, so that is a start; however, I am running XNA3.0, and I don't have a means to change XNA Framework Content to true, and I am getting an error that reads:

I get: "Warning 2 Project item 'Shaders\TransformColorTexture.fx' was not built with the XNA Framework Content Pipeline. Set its Build Action property to Compile to build it.   SFEngine"


Is this issue going to fix itself further on in the tutorial?
« Last Edit: 2009/04/27 17:29:34 by 3VilJay » Logged
Chr0n1x
Global Moderator
Sr. Member
*****
Offline Offline

Posts: 307


View Profile WWW
« Reply #46 on: 2009/04/29 04:37:17 »

That option does not need to be set anymore, just change the Build Action to "Compile".

For XNA 3.0 the settings are:

Build Action: Compile
Content Importer: Effect - XNA Framework
Content Processor: Effect - XNA Framework
Copy to output directory: Do Not Copy
Logged

tourist.tam
Newbie
*
Offline Offline

Posts: 2


View Profile
« Reply #47 on: 2009/07/14 00:33:58 »

Hi,

Thanks for sharing all your work on this engine. I have walked my way through the tutorials 1 to 3, but I am having an error at run-time over the last bit of tutorial 3:

on line 39 of the HMEngine.HMObjects.HMQuad:

Code:
36        public override void Render(GraphicsDevice myDevice)
37        {
38            myDevice.Textures[0] = Texture;
39  ->        myDevice.DrawUserIndexedPrimitives(PrimitiveType.TriangleList, Vertices, 0, 4, Indexes, 0, 2);
40        }

the program stops and return the following error:

Quote
System.InvalidOperationException was unhandled
  Message="An unexpected error has occurred."
  Source="Microsoft.Xna.Framework"
  StackTrace:
       at Microsoft.Xna.Framework.Graphics.GraphicsDevice.RawDrawUserIndexedPrimitives(PrimitiveType primitiveType, Int32 numVertices, Int32 primitiveCount, Void* pIndexData, _D3DFORMAT indexFormat, Void* pVertexData, Int32 vertexStride)
       at Microsoft.Xna.Framework.Graphics.GraphicsDevice.DrawUserIndexedPrimitives[T](PrimitiveType primitiveType, T[] vertexData, Int32 vertexOffset, Int32 numVertices, Array indexData, Int32 indexOffset, Int32 primitiveCount, _D3DFORMAT indexFormat)
       at Microsoft.Xna.Framework.Graphics.GraphicsDevice.DrawUserIndexedPrimitives[T](PrimitiveType primitiveType, T[] vertexData, Int32 vertexOffset, Int32 numVertices, Int32[] indexData, Int32 indexOffset, Int32 primitiveCount)
       at HMEngine.HMObjects.HMQuad.Render(GraphicsDevice myDevice) in E:\source\VisualStudio2008\HMEngine\HMEngine\HMObjects\HMQuad.cs:line 39
       at HMEngine.HMComponents.HMComponentManager.Draw(GameTime gameTime) in E:\source\VisualStudio2008\HMEngine\HMEngine\HMComponents\HMComponentManager.cs:line 97
       at Microsoft.Xna.Framework.Game.Draw(GameTime gameTime)
       at HMEngine.HMGame.Draw(GameTime gameTime) in E:\source\VisualStudio2008\HMEngine\HMEngine\HMGame.cs:line 47
       at Microsoft.Xna.Framework.Game.DrawFrame()
       at Microsoft.Xna.Framework.Game.Tick()
       at Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e)
       at Microsoft.Xna.Framework.GameHost.OnIdle()
       at Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e)
       at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(Form mainForm)
       at Microsoft.Xna.Framework.WindowsGameHost.Run()
       at Microsoft.Xna.Framework.Game.Run()
       at HMDemo.HMDemo.Main() in E:\source\VisualStudio2008\HMEngine\HMDemo\HMDemo.cs:line 20
  InnerException:

Any pointer would be very welcome.

Tam
Logged
mikeschuld
Administrator
Sr. Member
*****
Offline Offline

Posts: 389


View Profile WWW
« Reply #48 on: 2009/07/15 15:14:47 »

tourist.tam,

have you tried setting the shaders to a lower version in the .fx file?

ex: ps_2_0 instead of ps_3_0?

What kind of computer (specifically video card) are you developing on?
Logged
tourist.tam
Newbie
*
Offline Offline

Posts: 2


View Profile
« Reply #49 on: 2009/08/12 15:20:42 »

I am stuck with an intel GMA 950 at the moment, but I believe it to have support for Shader Model 2. I have double checked the vertex and pixel shader in the .fx files and there are both set to 2.

Regards,

Tam
Logged
Nemo Krad
Global Moderator
Hero Member
*****
Offline Offline

Posts: 512


I have seen the fnords


View Profile WWW
« Reply #50 on: 2009/08/13 00:43:31 »

I have had similar errors when I have a miss match in data between the vertex element I am passing to the draw call and the vertex structure set up in the shader, are you 100% sure they match?
Logged
Chr0n1x
Global Moderator
Sr. Member
*****
Offline Offline

Posts: 307


View Profile WWW
« Reply #51 on: 2009/08/23 15:55:48 »

One small thing, even though the type is inferred by the compiler, you may want to specify the type of the VertexData since that is a generic method.

The GMA 950 has PS 2.0, and uses Intel's slightly dodgy Vertex Transform and Lighting system on the CPU for the Vertex Shader. (So VS 3.0)

It most likely is what Nemo mentioned, check that the Vertex input structure in your shader matches the structure in C#, assuming you are using a custom structure - otherwise ensure it matches what other tutorials have in the shader for it.
You want to ensure your order matches, and the types match up with equivalent  HLSL types.
Logged

Mikeske
Newbie
*
Offline Offline

Posts: 33


View Profile
« Reply #52 on: 2009/12/12 17:04:40 »

Hi Mike,

finally got back to the programming part (birth of baby snuck into it) Wink
as I'm running over the tutorials, I must say nice work, they are really evolving!

but... I got an error

when I run your code it always gives me 


ArgumentOutOfRangeException
You should specify positive value for nearPlaneDistance.
Parameter name: nearPlaneDistance


on

Code:
Projection = Matrix.CreatePerspectiveFieldOfView( FieldOfView, Viewport.AspectRatio, Viewport.MinDepth, Viewport.MaxDepth );

I know what the error is and how to solve it, but if I check my code (debug) the grpahicsdevice.viewport is being set to 0.0f for mindepth and 1.0f for maxdepth...

Have you/or the other brady bunch Wink ever encountered this error?

greetz
Logged
Pages: 1 2 3 [4]
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Tutorial 4 :: Moving Cameras and a Simple Input Component Tutorial Discussion « 1 2 » mikeschuld 21 8463 Last post 2008/12/11 10:42:13
by mikeschuld
World (Mesh) orientation and cameras Hazy Mind XNA Engine letsrock 4 2000 Last post 2007/03/13 11:09:49
by Robin Sarac
Shaders and rotating models.... General Discussion Nemo Krad 3 2827 Last post 2007/03/03 17:42:12
by Nemo Krad
Depth buffering and order of rendering??? Hazy Mind XNA Engine 5parrowhawk 1 1439 Last post 2007/02/28 08:02:01
by mikeschuld
I can't see anything on tutorial 4 More Rendering, Vertices and Indexes Hazy Mind 3D Engine moonsvista 5 2906 Last post 2007/03/30 14:37:05
by moonsvista
How can I speed up shaders?? General Discussion EclipsE 7 2808 Last post 2007/04/27 00:26:21
by Chr0n1x
Multiple postscreen shaders Hazy Mind XNA Engine EclipsE 2 1671 Last post 2007/04/29 21:50:58
by Chr0n1x
Effectively Rendering Point Sprites General Discussion DaphydTheBard 11 4318 Last post 2007/08/05 11:37:33
by Nemo Krad
Rendering to Background General Discussion inbreed 1 1599 Last post 2007/05/02 00:13:17
by Chr0n1x
Switching shaders. Motion Blur. Shadows. Hazy Mind XNA Engine amartinez1660 0 977 Last post 2007/05/07 00:01:25
by amartinez1660
Powered by MySQL Powered by PHP Powered by SMF 1.1.12 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.169 seconds with 19 queries.