World Triplanar do nothing

MagicLordMagicLord Posts: 578Unconfirmed
in 3D

Hi there,

I have a model , when i check or uncheck World Triplanar on flags it does nothing and texture keeps stretched.
This looks like another bug.

Answers

  • CalinouCalinou Posts: 176Admin Godot Developer

    You need to enable Triplanar in Uv 1 and/or Uv 2 (depending on your use case). World Triplanar is an additional property that effects whether the triplanar mapping uses local coordinates (i.e. it is locked to the object) or global coordinates (i.e. it does not follow the object when it moves), but it won't have any effect if neither of the UV maps have triplanar mapping enabled.

  • MagicLordMagicLord Posts: 578Unconfirmed
    edited May 14

    @Calinou said:
    You need to enable Triplanar in Uv 1 and/or Uv 2 (depending on your use case). World Triplanar is an additional property that effects whether the triplanar mapping uses local coordinates (i.e. it is locked to the object) or global coordinates (i.e. it does not follow the object when it moves), but it won't have any effect if neither of the UV maps have triplanar mapping enabled.

    Why two checkboxes ? One on flags and one on UV, would not one be sufficient ?

    I tried, but it's worse the texture disappears whatever is UV resolution.
    Triplanar does not work, should i re open a bug on GitHub ?

  • TwistedTwiglegTwistedTwigleg Posts: 701Admin

    I think the UV map scale needs to be something fairly small (like 0.5) for the textures to be visible. The default triplanar scale (a scale of 1) makes the texture repeat a lot and the texture is pretty small on the mesh.

    It could be in your case the textures are being applied at such a small size that it looks like a solid color.

  • MagicLordMagicLord Posts: 578Unconfirmed
    edited May 14

    @TwistedTwigleg said:
    I think the UV map scale needs to be something fairly small (like 0.5) for the textures to be visible. The default triplanar scale (a scale of 1) makes the texture repeat a lot and the texture is pretty small on the mesh.

    It could be in your case the textures are being applied at such a small size that it looks like a solid color.

    The triplanar UV multiplier works inverse how we code in shaders , bigger numbers means texture less detailled, that's not good.
    It doesn't work, the texturing is buggy drawing lines and texture doesn't show up, should i use values like 0.05 or 0.5.

    I submitted another bug on GitHub, i really hope they check things instead of saying it works and just closing bugs.

  • Ace DragonAce Dragon Posts: 193Member
    edited May 14

    Triplanar textures do have issues (detail textures break everything), but they are not broken altogether. Still, that is an issue that should be reported (please note that the more precise and detailed you can make a report, the better).

    I would also make sure that if this is for a terrain, that you apply the object scale in the asset creation tool before exporting (as it could produce adverse effects otherwise). In addition, I do agree that the scale out of the box is a bit small (even though you can just scale it up to where you need it).

  • TwistedTwiglegTwistedTwigleg Posts: 701Admin

    @MagicLord said:
    The triplanar UV multiplier works inverse how we code in shaders , bigger numbers means texture less detailled, that's not good.
    It doesn't work, the texturing is buggy drawing lines and texture doesn't show up, should i use values like 0.05 or 0.5.

    Ah, okay. My apologizes then. I couldn't remember whether larger numbers in the scale meant larger textures, or if it meant smaller textures :lol:


    Can you provide a example project/mesh for testing on the Github issue? That way the developers can test and will have a better chance at fixing the problem, and then we can also see if we can reproduce the issue.

  • MagicLordMagicLord Posts: 578Unconfirmed
    edited May 14

    @TwistedTwigleg said:

    @MagicLord said:
    The triplanar UV multiplier works inverse how we code in shaders , bigger numbers means texture less detailled, that's not good.
    It doesn't work, the texturing is buggy drawing lines and texture doesn't show up, should i use values like 0.05 or 0.5.

    Ah, okay. My apologizes then. I couldn't remember whether larger numbers in the scale meant larger textures, or if it meant smaller textures :lol:


    Can you provide a example project/mesh for testing on the Github issue? That way the developers can test and will have a better chance at fixing the problem, and then we can also see if we can reproduce the issue.

    Don't apolologize, i find it strange low values in triplanar UV settings scales up textures.

    I don't plan to use triplanar in Godot , so i don't mind a lot but it's sad it doesn't work like Gltf2 and animations :/

    I thought people had their own test project where they can drop textures or models and make some tests, this is usefull.
    But i made a test project you can download
    https://github.com/DevMagicLord/Godot3/blob/master/bugs/triplanar.zip

    You should get the same texture lines glitch with scale values = 0.1

  • TwistedTwiglegTwistedTwigleg Posts: 701Admin
    Answer ✓

    Okay, I figured it out!

    The problem is because your triplanar scale is/was (0.1, 0.1, 1), and that was making the texture projected unevenly on the Z axis, which was leading to those lines.

    However, I found while it does fix the line problems, it does not blend very nicely around the bumps. Changing the sharpness value to something higher seems to help fix the problem, and especially from a distance you can hardly see the lines.

  • MagicLordMagicLord Posts: 578Unconfirmed
    edited May 14

    Triplanar looks strange, we can see the blending, is this a bug ? (i updated github issue with your picture if you don't mind)
    However good find about the Z value, this should complete Godot manual.

  • Ace DragonAce Dragon Posts: 193Member

    @MagicLord said:
    Triplanar looks strange, we can see the blending, is this a bug ? (i updated github issue with your picture if you don't mind)
    However good find about the Z value, this should complete Godot manual.

    This is how triplanar mapping works in every application that can make use of it.

    It's not a bug, triplanar is not intended to be a super complex algorithm that can intelligently detect image features and stitch them together in a convincing way. The mapping type is more useful with textures like grass and rock where the blending might not be a major deal.

  • TwistedTwiglegTwistedTwigleg Posts: 701Admin
    edited May 14

    @MagicLord said:
    Triplanar looks strange, we can see the blending, is this a bug?

    I’m not sure, maybe? It seems to be based on how Godot’s triplanar shader works. I read this great article showing how to make triplanar in Unity, and learned a lot about how triplanar works. After reading that article I think I may have to try converting the shader code in the article to Godot, because it seems to be much more customizable (and also seems to have better blending support).

    Edit: Just saw Ace Dragon’s post (we most have been writing at the same time!). It seems in some triplanar shaders you can make the blending between textures more or less aprupt, but as Ace Dragon said, it appears that’s just how triplanar mapping works.

    (I updated github issue with your picture if you don’t mind)

    I have no problem with that :smile:

  • MagicLordMagicLord Posts: 578Unconfirmed
    edited May 14

    @TwistedTwigleg said:

    @MagicLord said:
    Triplanar looks strange, we can see the blending, is this a bug?

    I’m not sure, maybe? It seems to be based on how Godot’s triplanar shader works. I read this great article showing how to make triplanar in Unity, and learned a lot about how triplanar works. After reading that article I think I may have to try converting the shader code in the article to Godot, because it seems to be much more customizable (and also seems to have better blending support).

    Edit: Just saw Ace Dragon’s post (we most have been writing at the same time!). It seems in some triplanar shaders you can make the blending between textures more or less aprupt, but as Ace Dragon said, it appears that’s just how triplanar mapping works.

    (I updated github issue with your picture if you don’t mind)

    I have no problem with that :smile:

    Your article triplanar seems to have better blending but it can cost more, Godot triplanar is perhaps a good balance between cost and visual.
    It looks like some shaders algorithms are better at blending surfaces.

  • TwistedTwiglegTwistedTwigleg Posts: 701Admin

    @MagicLord said:
    Your article triplanar seems to have better blending but it can cost more, Godot triplanar is perhaps a good balance between cost and visual.

    Yeah, I didn’t think about performance. I’d be interested to see what the performance difference is, since for things like terrain it may (or may not) be worth the extra cost.

  • MagicLordMagicLord Posts: 578Unconfirmed
    edited May 14

    @TwistedTwigleg said:

    @MagicLord said:
    Your article triplanar seems to have better blending but it can cost more, Godot triplanar is perhaps a good balance between cost and visual.

    Yeah, I didn’t think about performance. I’d be interested to see what the performance difference is, since for things like terrain it may (or may not) be worth the extra cost.

    I think impact should be visible on a whole terrain mesh when the triplanar quality increases.
    Some terrain shaders use triplanar only on terrain slopes, and switches to normal when there is no slope.
    Or do like Skyrim and put rocks and cliffs models to hide it :D

  • MegalomaniakMegalomaniak Posts: 887Admin

    I think the default built-in SpatialMaterial should be more conservative for the sake of performance. If you have specific needs then that is where custom ShaderMaterials come in.

  • MagicLordMagicLord Posts: 578Unconfirmed

    @Megalomaniak said:
    I think the default built-in SpatialMaterial should be more conservative for the sake of performance. If you have specific needs then that is where custom ShaderMaterials come in.

    It will look okay for long distance objects, but it is not good enough if your object is for example a moutain you are climbing in close view, you'll need to UV Map or try to find some triplanar shader.

  • MegalomaniakMegalomaniak Posts: 887Admin

    Or, you know, you could have higher detail/LOD object for close by situations such as climbing that mountain side. ;)

Sign In or Register to comment.