Sign in to follow this  

Rendering points

This topic is 3315 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

I'm trying to render a single point to the screen to test some of my code. The point is at 0,0,0. It is to be rendered white on a black background. I have the primitive topology as D3D10_PRIMITIVE_TOPOLOGY_POINTLIST. I can't see the point rendered anywhere in my window. Why isn't this working, and what can I do to fix this? My guess would be that since the point doesn't cover exactly the center of a pixel it isn't rendered. Is this even close to my problem?

Share this post


Link to post
Share on other sites
Quote:
Original post by Diltsman
I'm trying to render a single point to the screen to test some of my code. The point is at 0,0,0. It is to be rendered white on a black background. I have the primitive topology as D3D10_PRIMITIVE_TOPOLOGY_POINTLIST. I can't see the point rendered anywhere in my window.

Why isn't this working, and what can I do to fix this? My guess would be that since the point doesn't cover exactly the center of a pixel it isn't rendered. Is this even close to my problem?
I don't know how pointlist works exactly, but can you test it in PIX. Debug the pixel which should contain your point and look at the mesh view tab to see what happens to your point.

Hope this brings us one step further.

Vertex

Share this post


Link to post
Share on other sites
Quote:
Original post by Diltsman
I'm trying to render a single point to the screen to test some of my code. The point is at 0,0,0. It is to be rendered white on a black background. I have the primitive topology as D3D10_PRIMITIVE_TOPOLOGY_POINTLIST. I can't see the point rendered anywhere in my window.

Why isn't this working, and what can I do to fix this? My guess would be that since the point doesn't cover exactly the center of a pixel it isn't rendered. Is this even close to my problem?


A point rendered can't "disappear" between two pixels, in general. It will be rendered on the closest pixel to its actual position.

That said, if your backbuffer dimensions don't match the client rectangle of the window, DX might apply a point-filtered-scaling that might hide the point. Make sure the window's internal size, without the borders, matches the backbuffer size.

Also, an error in your pixel or vertex shaders might cause the point to fail to appear where you expect it.

In addition, any failure of any call, or you failing to call a required method (for example, if you forgot to set a stream source), would also cause the point to fail to draw correctly.

Make sure no calls are failing, and that you're calling everything you should be (use the tutorials in the SDK documentation as a reference). Also, make sure there is no debug output in VS's output window.

Share this post


Link to post
Share on other sites
PIX looks to be a really useful tool. Thank you for suggesting it.

When I run one of my frames through PIX, it looks like a pixel is drawn where I expect it. I have tabs labeled PreVS, PostVS, and PostGS. I'm not seeing where it is showing the output of the Pixel Shader, though.


struct VS_INPUT
{
float4 pos : SV_Position;
float4 col : Color;
};
struct VS_OUTPUT
{
float4 pos : SV_Position;
float4 col : Color;
};
VS_OUTPUT VS(in VS_INPUT input)
{
VS_OUTPUT output;
output.pos = input.pos;
output.col.x = 1.0;
output.col.y = 1.0;
output.col.z = 1.0;
output.col.a = 1.0;
return output;
}
float4 PS(in VS_OUTPUT input) : SV_Target
{
return input.col;
}

Share this post


Link to post
Share on other sites
So, I changed the resolution to 640x480 so that the rendered point would be larger on the screen, and I don't see it. Any ideas why it doesn't appear to be rendering?

Share this post


Link to post
Share on other sites
There's a mound of possible reasons. However, since you say it is getting past the vertex shader (as you can see it in the correct location using PIX), it's probably either a Zbuffering issue, or an alpha blend/test issue. Make sure both settings are disabled.

Share this post


Link to post
Share on other sites

This topic is 3315 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this