Jump to content

Where do these lines come from?


Recommended Posts

I've been dabbling with parts modeling again. I decided to make the worlds fanciest fuel tank.

So I created this and noticed weird artifacts when I zoom out beyond a certain distance.

http://i.imgur.com/hgI1zFz.png"]hgI1zFz.png

I'm sorry that's the best picture I can get. If you zoom closer, the lines disappear. They correspond to the edges in the model itself.

Since it's distance related, that makes me think of the word "mipmap", but I really have no clue what that means or how to go about solving this.

Things different from what I've done before are:

  • the game object in unity has two sub objects (top-half and bottom-half) and each of those has three sub objects (cylinder walls, bracing, tank dome)
  • top and bottom halves were two separate .blend files
  • for each "half" there are two different materials (one for the dome, the other for the cylinder and bracing) all the shaders are KSP/diffuse
  • I created the materials in Unity, rather than import from Blender
  • I added mesh colliders only for the cylinder walls
  • unchecked "cast shadows" from renderer for the tank domes
  • the textures used are 2048x2048

Any help will be much appreciated!

Best,

Kurld

Link to comment
Share on other sites

I've been dabbling with parts modeling again. I decided to make the worlds fanciest fuel tank.

So I created this and noticed weird artifacts when I zoom out beyond a certain distance.

http://i.imgur.com/hgI1zFz.png

I'm sorry that's the best picture I can get. If you zoom closer, the lines disappear. They correspond to the edges in the model itself.

Since it's distance related, that makes me think of the word "mipmap", but I really have no clue what that means or how to go about solving this.

Things different from what I've done before are:

  • the game object in unity has two sub objects (top-half and bottom-half) and each of those has three sub objects (cylinder walls, bracing, tank dome)
  • top and bottom halves were two separate .blend files
  • for each "half" there are two different materials (one for the dome, the other for the cylinder and bracing) all the shaders are KSP/diffuse
  • I created the materials in Unity, rather than import from Blender
  • I added mesh colliders only for the cylinder walls
  • unchecked "cast shadows" from renderer for the tank domes
  • the textures used are 2048x2048

Any help will be much appreciated!

Best,

Kurld

Looks like classic mipmap induced blurring/sampling.

What does your UV map and textures look like? From the myriad of vertical lines on the tank sides, it would appear that you UV mapped each face individually as its own island.

Either way, the usual solution to mipmap induced problems is to remember to 'color outside the lines' for your UV map; your texture should extend 4-8 (more?) pixels outside of the UV lines.

Link to comment
Share on other sites

The above or it might be the inside mesh appearing on the outside? I never seen that in KSP but in 3d softwares that's what happens with proximity and distance of display. The closer you get the more precise it is at deciding what is in front ( black inside mesh or white/grey outside mesh)

Link to comment
Share on other sites

could be perhaps z-fighting?

usually it flickers while you pan the view around in such a case - and it would be caused by having an underlying set of faces that is too close to the backside of the surface faces - this would cause the GPU's inherent "rounding errors" to appear visibly in the form of parts of the model seemingly poking through each other...

the way to solve that (in case this turns out to be the problem) would then be to give it a bit more room in between any co-planar faces there may be in there (can't tell from a picture that size)

also, make sure you smooth out the normals on your mesh - not sure how blender works that out, (3dsMax has a modifier called "Smooth" and/or a button on the mesh editor panel that "merges" the normals of selected adjacent faces) -- but I'm sure there's some tool that does this for you... the result is a mesh that has a soft gradient of shading to it, instead of a clunky flat-faced "3D animation in the '80s" type appearance...

and as said before -- make sure your texture has a few pixels to "breathe" around the mapped sections of the mesh

queer things tend to happen otherwise, especially after squeezing your model through any file format conversions

Good luck!

Link to comment
Share on other sites

The uv map actually maps the majority of those faces so that they overlap. I thought maybe I hadn't colored far enough "outside the lines" so I moved the UV borders for those faces so that there was what I would consider a ridiculous amount of overlap. (almost more texture outside the UV boundary as inside it). I'm not at my workstation so I can't give you a number. I'd guess > 10 and maybe even > 20. No difference.

The "inside" of the cylinder is not any closer than I have modeled it before. It's a 2.5m cylinder and the walls are 5cm at their thinnest.

I have not noticed any flickering.

I selected all the faces in Blender and applied the "smooth shading" command.

The top and bottom edges of the cylinder have an edge split applied, but I do that for everything and have not seen this.

In case I hosed something in Blender, I may delete the cylinder and recreate its mesh and use a separate and vastly simplified UV map to see if the problem goes away.

Link to comment
Share on other sites

  • 2 weeks later...

I'm still confinced that you need more bleed padding on the textures. Depending on the size of the texture and the layout of the UVmap you need quite a LOT of padding. See this post over at polycount that states:

"Here are suggested amounts of edge padding to use for different size textures:

  • 128 = 2px
  • 256 = 2px
  • 512 = 4px
  • 1024 = 8px
  • 2048 = 16px "

I learned the hard way that you need these values in KSP.

Link to comment
Share on other sites

  • 7 months later...

This thread is old, but for anybody who is looking for an answer... I never found one. When I loaded these same parts up in 1.1.2 recently, the effect is no longer present. I used to notice a lot of sparklys around the edges of the fine details and those have gone away as well.

Link to comment
Share on other sites

On 5/27/2016 at 2:59 PM, Kurld said:

This thread is old, but for anybody who is looking for an answer... I never found one. When I loaded these same parts up in 1.1.2 recently, the effect is no longer present. I used to notice a lot of sparklys around the edges of the fine details and those have gone away as well.

 

The vertical lines around the outer surface also look to me like just a mipmap bleed issue, as others had suggested. The fix is usually to make sure the color extends outside of the UV polygon for some distance in the texture. Usually at least 5 pixels, if not more, in my textures these days. When you zoom in, the mapping is more precise and the effect goes away. When you zoom out, it uses resolution-reduced copies of the texture (the mipmaps), and you can get some averaging of those pixels with nearby parts of the texture (not nearby parts of the model).

 

For the sparklies, do you mean white dots that appear and disappear around the edges of the meshes? Yeah, sometimes I wasn't able to eliminate those completely either. I think it was a flaw in the pre-1.1 version of the KSP shaders. Usually it would happen at a transition between different mesh objects within the same part, but sometimes I would see it at the edges of a single-mesh part as well.

 

Link to comment
Share on other sites

On 9/27/2015 at 9:30 PM, InsaneDruid said:

I'm still confinced that you need more bleed padding on the textures. Depending on the size of the texture and the layout of the UVmap you need quite a LOT of padding. See this post over at polycount that states:

"Here are suggested amounts of edge padding to use for different size textures:

  • 128 = 2px
  • 256 = 2px
  • 512 = 4px
  • 1024 = 8px
  • 2048 = 16px "

 

I learned the hard way that you need these values in KSP.

Interesting, I have always used 5px on 1024 without any visible issue.
I do wonder accumulated difference between 5 and 8 pixels across an entire texture sheet, there could be a lot of lost space.

Here's a full texture for reference.

27f26debef.png

Edited by Beale
Link to comment
Share on other sites

Depends on the UV layout. A perfect square will need less, a rather "wild" polygon might need more. Also, visibility of the artefacts depends on the color of the different UV isles. A rather monochromatic texture is less prone than a texture where you have very dark and very bright uv isles.

I also use the solidify filter from http://www.flamingpear.com/freebies.html to blend the unused texture space, giving additional padding.

Link to comment
Share on other sites

I think in this case, it was either the old rendering engine or perhaps more likely something with my nVidia drivers or settings at the time since that was a new PC build for me at that time. Anyway, I'm not seeing the lines when I load these parts in 1.1.2

Trying to sort this, I went crazy extreme with UV layout and tried leaving a few dozens of pixels around the quads and it didn't help any. I'd made other models, using less overlap (I usually use 10 pixels) that didn't have these issues.  The ones I'm working on now don't have them either.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

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.

×
×
  • Create New...