Sign in to follow this  
rob1978

point sprites and BIG screenshots

Recommended Posts

rob1978    122
Hello, I'm trying to implement function, which dumps screenshot of arbitrary size, for example 1024*10 x 768*10. What I'm doing is to modify projection matrix,render small portion of screen, then add this tile to big image stored in memory. Rendering of meshes works fine, I have problems with point sprites only. I have massive particle system which runs on vertex shader that compute position and psize of each particle (I use points sprites). When rendering normally, size is good, but when rendering "tile" of my big screenshot, point sprites are no longer squared, they are stretched like aspect ratio of current tile. Can anyone tell me, why this happens?

Share this post


Link to post
Share on other sites
LeGreg    754
Point sprites are tricky because they are not handled as true polygons by the hardware (same problem occurs when doing irregular supersampling..).

One possible solution : modify the code that draws point sprite to a code that sends screen aligned quads to the 3D engine. You may also gain the ability to rotate them and make them of any arbitrary size as a nice side effect !

Another (maybe trickier) solution is to render everything at your original resolution. Only you modify slightly the position on the screen to some subpixel offset for each one of your N screenshots.
Then recomposite the final image by interleaving the pixels of the serie of screenshots. A potential problem is the LOD of your textures that will be computed too low for the size and resolution of your final image, so you may have to push some negative LOD bias there. Another potential problem is the accuracy of the hardware rasterizer may not be enough for your amount of subpixel resolution. An advantage on the other hand is if you're doing those very big screenshots in order to apply a very high quality supersampling, then you don't necessarily need to align your samples per pixels, you can take any arbitrary position making more interesting sampling patterns as a result.

LeGreg

Share this post


Link to post
Share on other sites
rob1978    122
Thanks for advices.
I disabled point sprites and render particles with 4 vertices and there is no problem. I haven't try reference rasterizer yet but I'm curious why point sprites are not squared. In DirectX documentation I have read that when point sprites are enabled, points are rasterized as screen aligned squares of size in pixels suppiled by vertex shader. Is it not true? Is MVP matrix affect this size different in X and Y dimension ?

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