Home > 未分类 > PointSprite in Shader

PointSprite in Shader

I am trying to use a pixel shader to add depth information to point sprites.
I’m using DirectX 9.0c, and debugging using the reference device with
software vertex processing so that I can set breakpoints in the shaders.
The vertex shader is vs.1.1 and the pixel shader ps.1.4 so that I can use
the texdepth instruction.
Everything works as expected on some systems, but not on others.
I’ve set breakpoints in both the vertex and pixel shader and the problem
seems to boil down to this:
I can see that I’m setting texture coordinates oT1 correctly in the vertex
shader (texture coordinates for oT0 are automatically set by D3D as expected
when point sprites are enabled).
On some systems, the texture coordinates for oT0 and oT1 are passed properly
to the pixel shader (I can see them by looking at t0 and t1 in the pixel
shader) and everything works as expected.
On other systems, the oT0 texture coordinates show up in BOTH t0 AND t1 in
the pixel shader, and the texture coordinates that I placed in the oT1
register are simply lost.
My question:  Is this a known bug, and if so is there any known work-around?
I assume I can avoid using point sprites but I’ve sunk a lot of work in
creating a robust framework around the point sprites and I don’t want to
re-do everything as triangle quads.
Thanks for any help –
Categories: 未分类
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: