Sign in to follow this  

gui rendering

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

Use only power-of-two textures, and put your gui graphics into pow2 texture atlasses. The easiest way to render GUI is by using ID3DXSprite9 interface - it takes care of batching for you. However, it's difficult to get it to work along side vertex and pixel shaders (because you need to figure out what projection matrix it uses in order to correctly transform verts in the vertex shader), so it may be less suitable for anything besides GUI rendering. Certain effects, such as per-vertex color blend/alpha blend, are impossible to achieve directly with D3DXSprite.

Share this post


Link to post
Share on other sites
If you don't need any special effects for the GUI just paste all your odd sized textures into one power of two sized texture then when using D3DXSprite you can specify which parts of the texture go where.

Share this post


Link to post
Share on other sites
You can just set the mag/min filters to point, in which case extra pixels surrounding edges will not get sampled. This will also cause a pixellated look.

Why do you think alpha blending to the backbuffer will solve any of your problems?

Share this post


Link to post
Share on other sites
actually found my issue with the quad the bottom left uv was wrong. So I am using quads and 1/tan(fov/2) to find the distance where the screen is +-aspect ratio in x and +-1 in height to make screen coordinate translation easy. I am using textures that are nearest power of 2 and let the unused space be transparent. Its working nicely actually finally I have a vector based GUI that I wanted so I can easily create custom controls like I do with a regular windows app.

Share this post


Link to post
Share on other sites

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