Sign in to follow this  
jesse121

Point Sprite Texture Mapping

Recommended Posts

jesse121    122
Hello everyone. I was wondering if it is possible to change the default texture coordinates on point sprites. The Point Sprite Implementation in Microsoft DirectX 8 Document has the following to say regarding texture co-ordinates: How do I render point sprites when the vertex data contains no texture co-ordinates? • True for D3DRS_POINTSPRITENABLE The texture co-ordinates for the corners of the point sprite should be generated as follows, starting from the top left corner and proceeding clockwise: (0.0f, 0.0f) (1.0f, 0.0f) (0.0f, 1.0f) (1.0f, 1.0f) • False for D3DRS_POINTSPRITENABLE The texture co-ordinates should be set to the defaults at each corner of the sprite: (0.0f, 0.0f, 0.0f, 1.0f) See “Rendering Point Sprites” in the Windows DDK. Above it states that if D3DRS_POINTSPRITENABLE is false then, the texture co-ordinates should be set to the defaults at each corner of the sprite. However when I set D3DRS_POINTSPRITENABLE to false, add D3DFVF_TEX4 to the FVF and add 4 sets of UV's I get no rendering output. In fact the only time I do get rendering output is when D3DRS_POINTSPRITENABLE = true and the FVF either has D3DFVF_TEX1 or no D3DFVF_TEX value at all. So I am wondering if anyone knows a way to set the UV's on a point sprite so half the texture is mapped to the point sprite instead of the entire texture. UV's: (0.0f, 0.0f) (0.5f, 0.0f) (0.0f, 0.5f) (0.5f, 0.5f)

Share this post


Link to post
Share on other sites
sirob    1181
You can use a texture transform matrix to transform the texcoords before sampling the texture.

Alternatively, you can use shaders and have full control over the texcoords in the pixelshader, and manipulate them any way you want.

Hope this helps.

Share this post


Link to post
Share on other sites

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