Jump to content

Shader Texture Atlas Support


MackeyK24
 Share

Recommended Posts

1 hour ago, Pryme8 said:

https://mtnphil.wordpress.com/2011/09/26/terrain-texture-atlas-construction/

see how it uses a "buffer" of data around the actual texture, its kinda a oddball thing to wrap your head around but this explains it decently.

and here is some discussion on to mip or not to mip
https://blogs.msdn.microsoft.com/shawnhar/2009/09/14/texture-filtering-mipmaps/

So how many mip maps does the GLSL system create when noMipmap = false ... So I can know how big to make the gutter?

And also when swapping the corners... How do only swap left AND right CORNERS or top AND bottom corners?

 How can you swap all 4 corners left and right and top and bottom...

I see how you can take the left gutter of original and make right gutter on scaled down version and make the right gutter on original  the left gutter on scaled down version... Same thing with top and bottom... But how to handle CORNERS ???

Link to comment
Share on other sites

Yo @Pryme8 ... I am trying to under stand the corner swiping when preparing the texture atlas tiles...

it says to take edges from opposite sides of the original image... I get the for the left, right, top and bottom... they just swap...

But what about corners... if that goes swaps left and right and top and bottom I think that just swaps them DIAGONALLY...

Is that high for the edges... The TOP-LEFT corner from source image should go to BOTTOM-RIGHT corner of destination image and

the BOTTOM-LEFT corner should go to the TOP-RIGHT corner ???

 

Link to comment
Share on other sites

Yo @Pryme8 ... Just for debugging the edge seams for now (I am however writing code to do all the border swapping and 9 image 3 x 3 center cropping).

But just for debugging I actually paint ALL sub textures with just a solid color... because within the texture size (512 x 512 for example) the gutter, body and edges ... everything is one solid color.

But I still get edge seams when mip mapping. Here is shot of solid color Texture Atlas:

Terrain_Candyland_Terrain_Atlas.thumb.png.269327adce631d4a58a3d368d93bb60f.png

 

And here is Output:

5a12c84619902_ScreenShot2017-11-20at2_18_59AM.thumb.png.b8a1ca606f29943a91a36cf340dc61a4.png

So mip level selection is off...

I was reading something about manual mip selection and someone about half pixel correction... Any ideals about that ?

 

Link to comment
Share on other sites

With a solid color like that you would never need mips, effectively you could get away with a 4px by 4px image to do what your demonstrating above.

I would recommend just turning off mips for now and continuing development with the NEAREST and no mips method.

The whole point of the mip maps is for getting rid of texture artifacts and sharpness at a distance (and to save memory) but if you use like a fog pass or some secondary pass you can clean up the "choas" on the texture at a distance.  Just move on and worry about it more once your really finishing stuff up.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...