Sign in to follow this  

best way to draw a rounded rectangle with tiled pattern..

This topic is 2846 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 need to draw a rounded rectangle with a striped pattern inside it. My current strategy is to have a circle .gif and stretch it appropriately (as in, stretch the middle part long so the edges retain the original size). Those look like this: http://imgur.com/6Mjwx Now, after drawing that with alpha testing, we'd have a rounded rectanglish shape on the depth buffer. I then would print a square with tiles to cover the whole area and by utilising the depth buffer I can confine the drawn area to the shape inside that rectangle. Does this sound good, or is there a better way? alpha testing is actually a bit slow in the platform I'm developing for (iPhone) so yeah..

Share this post


Link to post
Share on other sites
You could use multitexturing to achieve this result in a single pass. Simply bind your tiled square as your second texture and use secondary texture coordinates. If you are not using shaders, I believe these will be automatically modulated (i.e. the values are multiplied at range [0, 1]) to produce the result you are loooking for.

Share this post


Link to post
Share on other sites

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