Jump to content

Z-Fighting on Toroidal tank


Fwiffo

Recommended Posts

I scaled up the ROUND-8 Toroidal Tank, and am getting two bands of z-fighting along the seams of my texture polys.  They're about 1/4 from the top and bottom of the tank.  I managed to hide the top one inside another part, but the bottom one is still there and mildly annoying as it flickers when rotating the camera around.  I highlighted it below.

Any suggestions?

I'm pretty sure my graphics settings are reasonably high.

9sDuEst.png

 

Link to comment
Share on other sites

Not exactly.  I manually edited the part to scale the toroid, and did calculations by hand for tweakables, etc.  Interestingly, the stock toroid has a WAY higher fuel density (i.e. fuel per volume) than the other tanks (and sort of seems to hold more than it "should", although for gameplay purposes that's understandable).

Yes there is a bit more clipping than I wanted - I had to do so to get it to look decent and hide the upper z-fighting seam.  But the bulk of the toroid tank simply wraps around the exhaust vent of the poodle (incidentally, real rocket engines pump fuel around the manifold to a) preheat the fuel, and b) cool the nozzle to keep it from melting).  Seen from the bottom there is a reasonable gap between them.  Putting a donut on the nozzle also helps me to lower the CoM to reduce tipsiness on inclines.

rKOfg3q.png

The z-fighting seam has nothing to do with the clipping.  It shows up even if the scaled toroid is the only part.  Still hoping for ideas.

Edited by Fwiffo
Link to comment
Share on other sites

If you overlap two models in any game or 3D program they will flicker like this, note that this is both platform and rendering independent and will happen even on professional 3D programs who render for movies special effects. 
Its not an bug, its that you have two models in the same space. Think it actually get worse as the rendering quality get better. 
And its very common as one useful tricks is to hide one model and then swap with the visual if something happens, 
Solution is to avoid it simply give the fuel tank twice as much fuel. 
 

Link to comment
Share on other sites

Yeah, I noticed long ago that the donut tank has a better fuel to tank mass ratio...  (And my brother still wonders why I go for the tiny engines tech node so early).

I have tweakscale in one of my installations and decided to see if I could replicate the issue...

fy5otN9.jpg

At similar sizes to your rescale, I was definitely seeing a sharp line in the texture, but there wasn't any Z-fighting / flickering.

HGWTBB4.jpg

 

Standard scale donut tank has the same hard line if you look closely.

Assuming this isn't some specific combination of texture options you're using, I'm guessing tweakscale does something extra with the textures?

Link to comment
Share on other sites

2 hours ago, magnemoe said:

If you overlap two models in any game or 3D program they will flicker like this,

@magnemoe I think you may have missed the bit above where I said it occurs even when there is only one part.  To further clarify, that part has only one model.  So there's no model overlap.  It does seem like there might be "texture" overlap at the edges of the poly's?

 

@Kyrt Malthorn Wow, thanks a ton for double-checking this for me on your end!  Yep, that line is exactly where the artifact is.  I'm pretty sure z-fighting is the word for what I'm seeing, but in case I'm not using the term correctly:  Basically I see a sharp line or "gap" that flickers in and out as I rotate the camera view around (depending on the angle I'm looking at it).  When the camera is still, it doesn't flicker.  I don't have TweakScale handy at the moment to compare, but if you're interested, could you do me a favor and save this as FwiffoToroidalFuelTank.cfg, put it into your game, and see if the behavior is the same or different from what you saw above?  (Note you need Module Manager present for this CFG to work).

+PART[toroidalFuelTank]
{
    @name = FwiffoToroidalFuelTank8x
    @author = Fwiffo
    @rescaleFactor = 2 // use cubed root of multiplier.  For 15, use 2.466
    @title = Fwiffo Toroidal Tank 8x
    @cost *= 8
    @description = 'Cause Kerbals like big donuts.
    @mass *= 8
    @tags = donut doughnut fueltank gold ?lfo lifebuoy liquid oxidizer propellant (ring rocket yellow
    @bulkheadProfiles = size2
    @RESOURCE[LiquidFuel] {
        @amount *= 8
        @maxAmount *= 8
    }
    @RESOURCE[Oxidizer] {
        @amount *= 8
        @maxAmount *= 8
    }
}

I suspect this is something to do with the stock part and its textures, but if it turns out TweakScale has some trick to correct it I'd love to know what that is.

 

Edited by Fwiffo
Link to comment
Share on other sites

8 minutes ago, Fwiffo said:
1 minute ago, Fwiffo said:

I DO see it for the stock, unscaled part as well.  The effect is just less pronounced, and you have to zoom in closer to see it:

v2gLNNq.png

 

I was looking for any sign of flickering with the stock part w/o tweakscale and didn't see anything.  Making me think it might be either the graphic / detail settings you're using, or your texture got mangled somehow. If you're on a steam download, you could try deleting the part texture and then verifying files? 

Link to comment
Share on other sites

Thanks for the suggestion, will try it out as well as mucking with graphics settings.  (I've seen issues kind of resembling this before but it only seems to happen for a small number of parts).

Edited by Fwiffo
Link to comment
Share on other sites

BTW here's the model (mu imported into Blender via KSPBlender).  What's up with all the "spikes", vs. the smooth section in one quadrant?  I think the "horizontal" spikes roughly correlate to where the z-fighting is showing up?

HArKVDe.png

0r2H9y7.png

EDIT: Ok, they're the colliders poking through.  Here's what it looks like when I hide the tank object.  Not sure why there's a chunk missing opposite the gauge - maybe the Kraken took a bite out of it?

spBvr5j.png

Edited by Fwiffo
Link to comment
Share on other sites

I don't think it's the collider (because they aren't rendered in-game). It looks like the seam where the faces meet. The texture is probably not matching up perfectly there, and it becomes more obvious when it's enlarged.

I can't promise one way or the other about it changing. It's a defect, but it isn't very visible until expanding to such a size. At that point, it would be better to have a more detailed model...and there are a lot of things competing for dev attention. Plus the little gold tank has quite a following.

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...