XNA Game Development Forums
2012/05/18 06:28:22 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Calendar Login Register  
Pages: [1]
  Print  
Author Topic: Textured Quad Problems?  (Read 2168 times)
Robin Sarac
Newbie
*
Offline Offline

Posts: 9


View Profile
« on: 2007/03/12 11:16:29 »

I've been following the tutorials on The Hazy Mind (time for another donation methinks) and adapting the code slightly for my game engine.  I'm trying to develop casual games for those less coordinated souls (like myself) that can't keep up with the young gamers. Smiley

The best thing a bout this site is the ideas I get from it as far as how things are structured, even more so than the [great] code.

I'm having a problem drawing a textured quad using shaders.  I've stepped through the code many times and looked for errors, but I still see nothing on the screen.  In the code that loads the textured quad, if I set the vertices so that the quad is about 20 units across (from 0.5f left and right of the origin to something like 10.0f) I do see a very pixelated tiny portion of my texture that fills the window.  Moving the camera backwards doesn't seem to help as there doesn't seem to be any movement (although variables confirm that my camera is moving).  Even before I added a camera, I had this same problem.

I didn't post code on purpose because I don't want to suggest that anybody bother debugging my code. Smiley  But if anybody has had a similar problem and figured it out, I would appreciate a push in the right direction.
Logged
EclipsE
Full Member
***
Offline Offline

Posts: 111


View Profile
« Reply #1 on: 2007/03/12 12:10:10 »

I had the same problem. I made a quad, gave it a texture but still i don't see anything. And what did I do?? First, in your shader, where your technique is do this:

technique TransformTexture {
    pass P0 {
         CullMode = none;
         .......
    }
}

the ........ means other code that is there

If you see the quad now that means he is rotated 180 degrees and is pointing in the direction you are looking. And that is why you can't see it... Maybe  Grin
Logged
Robin Sarac
Newbie
*
Offline Offline

Posts: 9


View Profile
« Reply #2 on: 2007/03/12 18:44:34 »

I tried that, but no luck! Smiley

But thanks for the reply. I'll keep at it and post when I figure the problem out.
Logged
Robin Sarac
Newbie
*
Offline Offline

Posts: 9


View Profile
« Reply #3 on: 2007/03/12 22:01:54 »

So I stepped through all of my code and discovered a problem.  I was setting my WorldViewProjection matrix for my shader (Parameter.SetValue()) to my object's world matrix only.  After setting it to the proper World * CameraView * CameraProjection matrix, I can now see models (after way too much brutal debugging) even if mny textured quads still don't display.  It's progress!

Is there a way to debug shader code?  Or is it just a matter of dilligence?  How would you have found a problem like this?
Logged
Pages: [1]
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Having problems with my project Hazy Mind XNA Engine Twanks 10 3678 Last post 2006/11/18 09:51:53
by mikeschuld
Intel GMA900 gfx problems Hazy Mind XNA Engine h4rdc0m 11 3537 Last post 2007/06/20 22:01:41
by zachaller
Problems with dll attempting managed Hazy Mind 3D Engine pjank42 2 2895 Last post 2007/03/11 18:42:00
by mikeschuld
Have some problems... General Discussion EclipsE 6 2431 Last post 2007/03/28 08:23:06
by muchrejoicing
Model & Shader Problems Hazy Mind XNA Engine Themodem 5 2064 Last post 2007/03/26 11:12:53
by Tiago
Problems with HMModel Hazy Mind XNA Engine Hastur 1 1468 Last post 2007/08/03 12:34:48
by mikeschuld
Skybox and Mesh problems Hazy Mind 3D Engine EddyLuten 0 1597 Last post 2007/08/03 12:48:35
by EddyLuten
tutorial 3... where's my quad? Hazy Mind XNA Engine kubatrt 10 3281 Last post 2008/05/20 05:15:38
by kubatrt
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.407 seconds with 19 queries.