A case where everything is rendered when depth is disabled, but nothing when enabled is suggestive to me, as in Kaptein's case that the pixels are being rejected because the depth test is working and either the depth testing setup is wrong, or you're getting the wrong output because of either the wrong input or some meddling going on between (your depth value is not what you are expecting, or is not within the range you've configured to expect).
I notice you haven't set your depthrange...nothing wrong with that, it just means that you're expecting the default of between 0.0 and 1.0. Is either your projection not set up to deliver a value in this range, or are you doing something else in the shader that might overwrite or otherwise corrupt the depth output to be not within this?
It might be a good idea to post your projection matrix code and your shaders, then people can look how your projection is set up and confirm that's okay and nothing is meddling with the expected result in the shader.
I would also look at your depth output by putting it into the shader output rgb and therefore viewing it (depth tests disabled to make sure the results aren't rejected). Make sure you're not always writing 1.0 or something, or at least it's always as you expect showing a depth between 0.0 and 1.0.
Another test you can do is force the depth output to 0.0...which if the depth testing is on should see everything pass. This will not solve the problem, but would at least add more weight to the idea the depth testing is working even if the result is correct. I would do this before the above actually. Don't be worried about the value of doing tests like this, sometimes you have to beat all the info to the surface before the problem/solution is obvious.
With that in mind, also have a look at http://www.mvps.org/...r_z/linearz.htm...it's not a solution for your problems but there is a discussion in there on z and w values...some knowledge of what they are and how they relate should also allow you to force them to other specific values and undertake more specific tests, making sure that you always get the expected results. There is also some knowledge in there that might otherwise highlight an error.
Show differencesHistory of post edits
#7freakchild
Posted 07 November 2012 - 06:02 PM
A case where everything is rendered when depth is disabled, but nothing when enabled is suggestive to me, as in Kaptein's case that the pixels are being rejected because the depth test is working and either the depth testing setup is wrong, or you're getting the wrong output because of either the wrong input or some meddling going on between (your depth value is not what you are expecting, or is not within the range you've configured to expect).
I notice you haven't set your depthrange...nothing wrong with that, it just means that you're expecting the default of between 0.0 and 1.0. Is either your projection not set up to deliver a value in this range, or are you doing something else in the shader that might overwrite or otherwise corrupt the depth output to be not within this?
It might be a good idea to post your projection matrix code and your shaders, then people can look how your projection is set up and confirm that's okay and nothing is meddling with the expected result in the shader.
I would also look at your depth output by putting it into the shader output rgb and therefore viewing it (depth tests disabled to make sure the results aren't rejected). Make sure you're not always writing 1.0 or something, or at least it's always as you expect showing a depth between 0.0 and 1.0.
Another test you can do is force the depth output to 0.0...which if the depth testing is on should see everything pass. This will not solve the problem, but would at least add more weight to the idea the depth testing is working even if the result is correct. I would do this before the above actually. Don't be worried about the value of doing tests like this, sometimes you have to beat all the info to the surface before the problem/solution is obvious.
With that in mind, also have a look at http://www.mvps.org/...r_z/linearz.htm...it's not a solution for your problems but there is a discussion in there on z and w values...some knowledge of what they are and how they relate should also allow you to force them to other specific values and undertake more specific tests, making sure that you always get the expected results. There is also some knowledge in there that might otherwise highlight and error.
I notice you haven't set your depthrange...nothing wrong with that, it just means that you're expecting the default of between 0.0 and 1.0. Is either your projection not set up to deliver a value in this range, or are you doing something else in the shader that might overwrite or otherwise corrupt the depth output to be not within this?
It might be a good idea to post your projection matrix code and your shaders, then people can look how your projection is set up and confirm that's okay and nothing is meddling with the expected result in the shader.
I would also look at your depth output by putting it into the shader output rgb and therefore viewing it (depth tests disabled to make sure the results aren't rejected). Make sure you're not always writing 1.0 or something, or at least it's always as you expect showing a depth between 0.0 and 1.0.
Another test you can do is force the depth output to 0.0...which if the depth testing is on should see everything pass. This will not solve the problem, but would at least add more weight to the idea the depth testing is working even if the result is correct. I would do this before the above actually. Don't be worried about the value of doing tests like this, sometimes you have to beat all the info to the surface before the problem/solution is obvious.
With that in mind, also have a look at http://www.mvps.org/...r_z/linearz.htm...it's not a solution for your problems but there is a discussion in there on z and w values...some knowledge of what they are and how they relate should also allow you to force them to other specific values and undertake more specific tests, making sure that you always get the expected results. There is also some knowledge in there that might otherwise highlight and error.
#6freakchild
Posted 07 November 2012 - 06:02 PM
A case where everything is rendered when depth is disabled, but nothing when enabled is suggestive to me, as in Kaptein's case that the pixels are being rejected because the depth test is working and either the depth testing setup is wrong, or you're getting the wrong output because of either the wrong input or some meddling going on between (your depth value is not what you are expecting, or is not within the range you've configured to expect).
I notice you haven't set your depthrange...nothing wrong with that, it just means that you're expecting the default of between 0.0 and 1.0. Is either your projection not set up to deliver a value in this range, or are you doing something else in the shader that might overwrite or otherwise corrupt the depth output to be not within this?
It might be a good idea to post your projection matrix code and your shaders, then people can look how your projection is set up and confirm that's okay and nothing is meddling with the expected result in the shader.
I would also look at your depth output by putting it into the shader output rgb and therefore viewing it (depth tests disabled to make sure the results aren't rejected). Make sure you're not always writing 1.0 or something, or at least it's always as you expect showing a depth between 0.0 and 1.0.
Another test you can do is force the depth output to 0.0...which if the depth testing is on should see everything pass. This will not solve the problem, but would at least add more weight to the idea the depth testing is working even if the result is correct. I would do this before the above actually. Don't be worried about the value of doing tests like this, sometimes you have to beat all the info to the surface before the problem/solution is obvious.
Also have a look at http://www.mvps.org/...r_z/linearz.htm...it's not a solution for your problems but there is a discussion in there on z and w values...some knowledge of what they are and how they relate should also allow you to force them to other specific values and undertake more specific tests, making sure that you always get the expected results. There is also some knowledge in there that might otherwise highlight and error.
I notice you haven't set your depthrange...nothing wrong with that, it just means that you're expecting the default of between 0.0 and 1.0. Is either your projection not set up to deliver a value in this range, or are you doing something else in the shader that might overwrite or otherwise corrupt the depth output to be not within this?
It might be a good idea to post your projection matrix code and your shaders, then people can look how your projection is set up and confirm that's okay and nothing is meddling with the expected result in the shader.
I would also look at your depth output by putting it into the shader output rgb and therefore viewing it (depth tests disabled to make sure the results aren't rejected). Make sure you're not always writing 1.0 or something, or at least it's always as you expect showing a depth between 0.0 and 1.0.
Another test you can do is force the depth output to 0.0...which if the depth testing is on should see everything pass. This will not solve the problem, but would at least add more weight to the idea the depth testing is working even if the result is correct. I would do this before the above actually. Don't be worried about the value of doing tests like this, sometimes you have to beat all the info to the surface before the problem/solution is obvious.
Also have a look at http://www.mvps.org/...r_z/linearz.htm...it's not a solution for your problems but there is a discussion in there on z and w values...some knowledge of what they are and how they relate should also allow you to force them to other specific values and undertake more specific tests, making sure that you always get the expected results. There is also some knowledge in there that might otherwise highlight and error.
#5freakchild
Posted 07 November 2012 - 06:01 PM
A case where everything is rendered when depth is disabled, but nothing when enabled is suggestive to me, as in Kaptein's case that the pixels are being rejected because the depth test is working and either the depth testing setup is wrong, or you're getting the wrong output because of either the wrong input or some meddling going on between (your depth value is not what you are expecting, or is not within the range you've configured to expect).
I notice you haven't set your depthrange...nothing wrong with that, it just means that you're expecting the default of between 0.0 and 1.0. Is either your projection not set up to deliver a value in this range, or are you doing something else in the shader that might overwrite or otherwise corrupt the depth output to be not within this?
It might be a good idea to post your projection matrix code and your shaders, then people can look how your projection is set up and confirm that's okay and nothing is meddling with the expected result in the shader.
I would also look at your depth output by putting it into the shader output rgb and therefore viewing it (depth tests disabled to make sure the results aren't rejected). Make sure you're not always writing 1.0 or something, or at least it's always as you expect showing a depth between 0.0 and 1.0.
Another test you can do is force the depth output to 0.0...which if the depth testing is on should see everything pass. This will not solve the problem, but would at least add more weight to the idea the depth testing is working even if the result is correct. I would do this before the above actually. Don't be worried about the value of doing tests like this, sometimes you have to beat all the info to the surface before the solution is obvious.
Also have a look at http://www.mvps.org/...r_z/linearz.htm...it's not a solution for your problems but there is a discussion in there on z and w values...some knowledge of what they are and how they relate should also allow you to force them to other specific values and undertake more specific tests, making sure that you always get the expected results. There is also some knowledge in there that might otherwise highlight and error.
I notice you haven't set your depthrange...nothing wrong with that, it just means that you're expecting the default of between 0.0 and 1.0. Is either your projection not set up to deliver a value in this range, or are you doing something else in the shader that might overwrite or otherwise corrupt the depth output to be not within this?
It might be a good idea to post your projection matrix code and your shaders, then people can look how your projection is set up and confirm that's okay and nothing is meddling with the expected result in the shader.
I would also look at your depth output by putting it into the shader output rgb and therefore viewing it (depth tests disabled to make sure the results aren't rejected). Make sure you're not always writing 1.0 or something, or at least it's always as you expect showing a depth between 0.0 and 1.0.
Another test you can do is force the depth output to 0.0...which if the depth testing is on should see everything pass. This will not solve the problem, but would at least add more weight to the idea the depth testing is working even if the result is correct. I would do this before the above actually. Don't be worried about the value of doing tests like this, sometimes you have to beat all the info to the surface before the solution is obvious.
Also have a look at http://www.mvps.org/...r_z/linearz.htm...it's not a solution for your problems but there is a discussion in there on z and w values...some knowledge of what they are and how they relate should also allow you to force them to other specific values and undertake more specific tests, making sure that you always get the expected results. There is also some knowledge in there that might otherwise highlight and error.
#4freakchild
Posted 07 November 2012 - 06:01 PM
A case where everything is rendered when depth is disabled, but nothing when enabled is suggestive to me, as in Kaptein's case that the pixels are being rejected because the depth test is working and either the depth testing setup is wrong, or you're getting the wrong output because of either the wrong input or some meddling going on between (your depth value is not what you are expecting, or is not within the range you've configured to expect).
I notice you haven't set your depthrange...nothing wrong with that, it just means that you're expecting the default of between 0.0 and 1.0. Is either your projection not set up to deliver a value in this range, or are you doing something else in the shader that might overwrite or otherwise corrupt the depth output to be not within this?
It might be a good idea to post your projection matrix code and your shaders, then people can look how your projection is set up and confirm that's okay and nothing is meddling with the expected result in the shader.
I would also look at your depth output by putting it into the shader output rgb and therefore viewing it (depth tests disabled to make sure the results aren't rejected). Make sure you're not always writing 1.0 or something, or at least it's always as you expect showing a depth between 0.0 and 1.0.
Another test you can do is force the depth output to 0.0...which if the depth testing is on should see everything pass. This will not solve the problem, but would at least add more weight to the idea the depth testing is working even if the result is correct. I would do this before the above actually.
Also have a look at http://www.mvps.org/...r_z/linearz.htm...it's not a solution for your problems but there is a discussion in there on z and w values...some knowledge of what they are and how they relate should also allow you to force them to other specific values and undertake more specific tests, making sure that you always get the expected results. There is also some knowledge in there that might otherwise highlight and error.
I notice you haven't set your depthrange...nothing wrong with that, it just means that you're expecting the default of between 0.0 and 1.0. Is either your projection not set up to deliver a value in this range, or are you doing something else in the shader that might overwrite or otherwise corrupt the depth output to be not within this?
It might be a good idea to post your projection matrix code and your shaders, then people can look how your projection is set up and confirm that's okay and nothing is meddling with the expected result in the shader.
I would also look at your depth output by putting it into the shader output rgb and therefore viewing it (depth tests disabled to make sure the results aren't rejected). Make sure you're not always writing 1.0 or something, or at least it's always as you expect showing a depth between 0.0 and 1.0.
Another test you can do is force the depth output to 0.0...which if the depth testing is on should see everything pass. This will not solve the problem, but would at least add more weight to the idea the depth testing is working even if the result is correct. I would do this before the above actually.
Also have a look at http://www.mvps.org/...r_z/linearz.htm...it's not a solution for your problems but there is a discussion in there on z and w values...some knowledge of what they are and how they relate should also allow you to force them to other specific values and undertake more specific tests, making sure that you always get the expected results. There is also some knowledge in there that might otherwise highlight and error.
#3freakchild
Posted 07 November 2012 - 05:59 PM
A case where everything is rendered when depth is disabled, but nothing when enabled is suggestive to me, as in Kaptein's case that the pixels are being rejected because the depth test is working and either the depth testing setup is wrong, or you're getting the wrong output because of either the wrong input or some meddling going on between (your depth value is not what you are expecting, or is not within the range you've configured to expect).
I notice you haven't set your depthrange...nothing wrong with that, it just means that you're expecting the default of between 0.0 and 1.0. Is either your projection not set up to deliver a value in this range, or are you doing something else in the shader that might overwrite or otherwise corrupt the depth output to be not within this?
It might be a good idea to post your projection matrix code and your shaders, then people can look how your projection is set up and confirm that's okay and nothing is meddling with the expected result in the shader.
I would also look at your depth output by putting it into the shader output rgb and therefore viewing it (depth tests disabled to make sure the results aren't rejected). Make sure you're not always writing 1.0 or something, or at least it's always as you expect showing a depth between 0.0 and 1.0.
Another test you can do is force the depth output to 0.0...which if the depth testing is on should see everything pass. That would at least add more weight to the idea the depth testing is working even if the result is correct. I would do this before the above actually.
Also have a look at http://www.mvps.org/...r_z/linearz.htm...it's not a solution for your problems but there is a discussion in there on z and w values...some knowledge of what they are and how they relate should also allow you to force them to other specific values and undertake more specific tests, making sure that you always get the expected results. There is also some knowledge in there that might otherwise highlight and error.
I notice you haven't set your depthrange...nothing wrong with that, it just means that you're expecting the default of between 0.0 and 1.0. Is either your projection not set up to deliver a value in this range, or are you doing something else in the shader that might overwrite or otherwise corrupt the depth output to be not within this?
It might be a good idea to post your projection matrix code and your shaders, then people can look how your projection is set up and confirm that's okay and nothing is meddling with the expected result in the shader.
I would also look at your depth output by putting it into the shader output rgb and therefore viewing it (depth tests disabled to make sure the results aren't rejected). Make sure you're not always writing 1.0 or something, or at least it's always as you expect showing a depth between 0.0 and 1.0.
Another test you can do is force the depth output to 0.0...which if the depth testing is on should see everything pass. That would at least add more weight to the idea the depth testing is working even if the result is correct. I would do this before the above actually.
Also have a look at http://www.mvps.org/...r_z/linearz.htm...it's not a solution for your problems but there is a discussion in there on z and w values...some knowledge of what they are and how they relate should also allow you to force them to other specific values and undertake more specific tests, making sure that you always get the expected results. There is also some knowledge in there that might otherwise highlight and error.