Jump to content
  • Advertisement
Sign in to follow this  
soumya_iiitc

Texturing Problem

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

Hi All, I am facing a texturing problem as explained in the image below. Here is a brief description of why i am doing this. 1. I want to display any size image not greater than 4096 x 4096 into a quad as shown in the image below. 2. I have created rendering context using createDIBSection(). 3. MS renderer has limitation of 1024 x 1024 texture size so i can't load images greater than 1024 x 1024 4. So i am creating 4 blocks from the image. 5. Now i want to texture the 4 blocks into my quad. I have used 0 padding to make my images POT image Thanks, Soumaydipta De

Share this post


Link to post
Share on other sites
Advertisement
You can (a) split the quad into 4 quads, one for each partial texture. The partial textures should show a border made from the neighbouring textures, or else the appearance of seams will be likely.
Or (b) use a single quad but use an internal texture format without repetition and such but with transparent environment, and use texture co-ordinates outside [0,1] to place and size the partial textures accordingly (e.g. u=[0,2], v=[-1,1] for the 3rd quadrant).

I would prefer method (a) since it allows seamless texturing. I think (but am unsure) that (b) will not allow seamless texturing.

However, you have to adapt the co-ordinates to display only the wanted portion in any of the 2 ways. This is to be done as usual by computing the fraction of u,v corresponding to the size of the portion to the total size. The exact method depends on which of the 2 ways above you'll choose.

Share this post


Link to post
Share on other sites
Hi,

You are right and i am also doing the texturing in the same manner.But i am facing the problem as below.

1. If you consider IMAGE_BLOCK_3 from the above image and want to place this image as a texture into Render area block3 you don't need to recalculate the u,v coordinates.

2. But if you want to use IMAGE_BLOCK_1 as a texture for render area block1 you have to recalculate the texture coordinates.

3. So in the current case my image will be stretched in one direction and this will destroy the aspect ratio of the image.


So how can i solve this particular problem.

Stretch To
IMAGE_BLOCK1 -------------> Only Vertical direction.

Stretch To
IMAGE_BLOCK2 -------------> Vertical and Horizontal direction

Stretch To
IMAGE_BLOCK3 -------------> No stretch in any direction

Stretch To
IMAGE_BLOCK4 -------------> Only Horizontal direction

I hope i have clearly explained my problem.


Regards,
Soumyadipta De

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!