Jump to content
  • Advertisement
Sign in to follow this  
albinopapa

Nothing displaying on screen.

This topic is 846 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

New to the forum, not sure what the gamedev community is like, but hopefully gentle and understanding :).

 

I have been wracking my brain trying to figure out why my d3d11 framework won't work.  I have tried debugging the best I can, there are no compilation errors, no debug errors using the debug flag in device creation.  I've checked the Graphics analysis tool in Visual Studio 2015 and everything seems to be initialized and set.  It isn't showing a pixel shader in the pipeline tab, but in the state tab, it shows a pixel shader has been set.

 

If someone could help me out by pointing me in the right direction I would appreciate it.

 

https://github.com/albinopapa/Direct3D-11

Share this post


Link to post
Share on other sites
Advertisement


It isn't showing a pixel shader in the pipeline tab, but in the state tab, it shows a pixel shader has been set.

 

I didn't look at your code, but based on this line I'm going to assume that your mesh isn't in view.  Maybe you're looking down the wrong axis, or in the wrong direction down the right axis?  That's a semi-common early problem.  The pixel shader is never used, despite being properly set, if no meshes get transformed into viewable screenspace for the frame.  You should be able to easily confirm this with the data VS2015 is giving you.

Share this post


Link to post
Share on other sites

I've considered this and haven't fully investigated.  I believe the mesh should be in view though, because in the vertex shader on the pipeline tab, the thumbnail does show a wire mesh of the plane I want to use as a sprite.  I've tried putting the plane at a negative position, like (0, 0, -10) and the camera at (0, 0, 5), and when viewed like that the wireframe isn't shown in the thumbnail of the vertex shader.  

Share this post


Link to post
Share on other sites

How far is your mesh from the camera? Your near/far distances look like they are set to 0.1 and 1. So anything further than 1 unit away (or closer than 0.1) won't be visible.

Edited by phil_t

Share this post


Link to post
Share on other sites

Lol, thank you so much.  That what it was.  That was driving me crazy.  

 

I get confused when to set the far to 1.0 or more.  The viewport I guess is where I set far to 1.0f and projection is higher.

 

Thanks again.

Share this post


Link to post
Share on other sites

i typically use values like 1 and 1000 for most things.   sometimes 0.1 for near plane.  far plane should be no bigger than necessary for accuracy's sake, but a far plane of 1 seems a bit extreme.   Caveman uses a three pass method with 400 and 10000, 1 and 1000, and 0.1 and 10.  Airships! uses 1 and 1000000 as i recall. it doesn't need a whole lot of long range accuracy, it just needs a whole lot of range.

Share this post


Link to post
Share on other sites

i typically use values like 1 and 1000 for most things.   sometimes 0.1 for near plane.  far plane should be no bigger than necessary for accuracy's sake, but a far plane of 1 seems a bit extreme.   Caveman uses a three pass method with 400 and 10000, 1 and 1000, and 0.1 and 10.  Airships! uses 1 and 1000000 as i recall. it doesn't need a whole lot of long range accuracy, it just needs a whole lot of range.

Thanks for the extended info.  I just got confused, about which needed the normalized range, viewport or projection matrix.

 

I haven't actually made anything with Direct3D yet.  I just keep rewriting frameworks from memory every couple of months thinking I'll get something done, but by the time I get to the point of displaying models on screen, I always run into a problem.  This time it was the viewing range, last time I made a Index buffer use DXGI_FORMAT_R32_FLOAT instead of the _SINT version.  Other frameworks I never figured out why it wouldn't work.  After a while I just get so tired of trying, I just go back to 2D using SSE.

 

This time I have some 2D stuff I want to port for an acquaintance.  

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!