Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Ian Ross has just released a book on Anim8or. It's perect for a beginner and a good reference for experienced users. It contains detailed chapters on every aspect, with many examples. Get your own copy here: "Anim8or Tutorial Book"

Author Topic: texture tiling edge issue  (Read 17715 times)

thecolclough

  • Sr. Member
  • ****
  • Posts: 890
  • 3D Ignoramus 1988-2002, Anim8or User 2002-present.
    • View Profile
    • www.mattghc.com
texture tiling edge issue
« on: January 25, 2019, 01:43:18 pm »

i'm working on a few clips of maps as inserts for someone else's documentary project, and trying to use anim8or to let me do a camera move pushing into the map.  to allow for UHD renders, i've had to make the map very high resolution (about 13k x 8.5k pixels!).

anim8or seems to limit texture sizes to 4096 x 4096, so i've had to split up my map into several tiles.  however, despite all the tiles being exactly the right sizes so that there shouldn't be any gaps between them (200 units square, with 200-unit difference in their placement), you can still see grey hairlines in the render where they meet.

i'm using the latest stable release (dated 29 may 2017), with scanline - ART crashes whenever i try to render the scene.

i can't remember if the latest dev builds support higher-res textures, and if not then i'd appreciate any help on eliminating these hairlines because they're a bit of a deal-breaker at present.

sample frame attached - you'll need to expand it to see the problem.

thanks in advance :)
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1482
    • View Profile
Re: texture tiling edge issue
« Reply #1 on: January 25, 2019, 06:32:54 pm »

Are these the same mesh, and did you merge the points?
Logged

thecolclough

  • Sr. Member
  • ****
  • Posts: 890
  • 3D Ignoramus 1988-2002, Anim8or User 2002-present.
    • View Profile
    • www.mattghc.com
Re: texture tiling edge issue
« Reply #2 on: January 25, 2019, 06:39:19 pm »

they started life as separate pieces, but i've merged the solids and then merged the points.  if i made one mesh and then tried to UV the various textures onto it, then i wouldn't know how to align them precisely enough.  texturing isn't my strongest suit :P
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1482
    • View Profile
Re: texture tiling edge issue
« Reply #3 on: January 25, 2019, 08:35:18 pm »

I can replicate the seams. This would be more @Steve than anything else as it has to do with UV border handling.

I can think of one fairly convoluted way to get past it:
  • In an image editor, scale each image down to 4094x4094 without cropping it, and center it on the image.
    • The canvas and entire image remains 4096x4096--basically you should have a 1px border around it
  • Load up the textures into your project, replacing the old ones
  • Slice and delete the 1px border using the knife or retopo tool, and then reassemble the map.
  • You may need to scale the image down further and increase the border pixel size
Logged

AlecJames

  • Full Member
  • ***
  • Posts: 240
    • View Profile
Re: texture tiling edge issue
« Reply #4 on: January 26, 2019, 06:01:27 am »

Not a solution but could you work around by using 2 objects, a large one with a low-resolution image and a smaller one with a high-resolution image. 

Overlay them in the scene and switch the visibility of the large off, small on, when the small image fills the camera frame? (when the camera zooms into it).

 
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 2124
    • View Profile
Re: texture tiling edge issue
« Reply #5 on: January 26, 2019, 07:58:38 am »

As for the visible edges, Anim8or's textures don't support border pixels, which would be one way to fix your problem.

Another way to solve your UHD zoom in is to switch from a 4Kx4K texture with the full imaged scalled down, to a 4Kx4K texture of a smaller region as you zoom in. Depending on what camera movement you use it could be anywhere from easy to difficult to match the view however.
Logged

thecolclough

  • Sr. Member
  • ****
  • Posts: 890
  • 3D Ignoramus 1988-2002, Anim8or User 2002-present.
    • View Profile
    • www.mattghc.com
Re: texture tiling edge issue
« Reply #6 on: January 26, 2019, 12:36:58 pm »

thanks for the feedback, everyone.  i did previously consider the method Alec and Steve mentioned, but i didn't think it'd be effective when doing a UHD render, as there's so little leeway between the 4096 texture limit and the 3840 output width and i'm trying to do a pretty big zoom.

i went for a brute-force solution in the end - since most of my maps are block-colour areas, i was able to set up some little strips of the right colours that masked most of the tile borders, and then did some jiggery-pokery in post-production to recombine everything into a mostly-seamless video.  there are tiny fragments of the seams still visible along the landmass edges, if you know where to look, but they're unobtrusive enough.
Logged

AlecJames

  • Full Member
  • ***
  • Posts: 240
    • View Profile
Re: texture tiling edge issue
« Reply #7 on: January 27, 2019, 06:40:00 am »

I didn't realise the significance of the 4096 texture limit and the 3840 UHD output  :-[

@Steve is 4096x4096 a limitation within some opengl api or could the 4096 be increased? 

I had a play with this and something else that I didn't understand is that when I'm defining a material, in the texture selction diaglog (anim8or_manual_1.01.1318_mark.pdf page 121) there is "texture map".  I expected this to match the size of the image in pixels when I loaded a new texture but sometimes its not.  I had an image 988x4096, the dialog shows the texture map as 512x4096, and changes it back to 512x4096 when I change it.  I place the material on an object 9.88x40.96 and it fills it exactly so I'm not quite sure what the texture map does?  Does this field change the behaviour of the texture / material?

Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 2124
    • View Profile
Re: texture tiling edge issue
« Reply #8 on: January 27, 2019, 10:57:23 am »

Textures are images and are scaled to match the size of their target. This is done by assigning texture "coordinates" to the vertices in an object. They range from (0,0) to (1,1) across the image, and repeat for larger or smaller coordinates. So you can show just a portion of the image or have it repeat horizontally and/or vertically on an object by changing the coordinates.

All OpenGL implementations have limitations on texture sizes, normally set by the graphics chip it uses. Anim8or limits the size to the OpenGL implementation's limit or 4096 whichever is smaller. This is because many users have tried to load dozens of max sized textures which causes Anim8or and/or the graphics card to run out of memory and crash, especially when rendering an image. Limiting the size to 4096 (which you very rarely need anything that big anyway) avoids most of these crashes.
Logged

selden

  • Full Member
  • ***
  • Posts: 221
    • View Profile
    • Modelling for Celestia
Re: texture tiling edge issue
« Reply #9 on: January 28, 2019, 04:36:24 pm »

Some rendering engines (e.g. Celestia's) handle arbitrarily large images by cutting them into pieces which fit into the card's texture buffer. I dunno how they persuade the graphics hardware to merge them into contiguous surface textures, though.
Logged
Selden

thecolclough

  • Sr. Member
  • ****
  • Posts: 890
  • 3D Ignoramus 1988-2002, Anim8or User 2002-present.
    • View Profile
    • www.mattghc.com
Re: texture tiling edge issue
« Reply #10 on: January 29, 2019, 07:15:30 pm »

...very rarely need anything that big...
true.  but for the rare occasions when we do (or maybe less rare, as we move into the Ultra-High-Def era?), would it be possible to have a switch to turn off the inbuilt 4096 limit?  maybe with a checkbox to say 'yes, i'm running this on a monster rig and i understand the risks' or similar :D
Logged