Prevent Tile Texture in Terrain

Поділитися
Вставка
  • Опубліковано 4 сер 2024
  • In this video we are looking at possible solution to prevent tile texture or texture repetition
    Video for Texture Rotation:
    • Hiding texture repetit...
    Video for splatmap:
    • Splatmap in M Terrain ...
    Chapters:
    intro - 00:00
    artistic solutions - 01:00
    texture mixing - 01:28
    color variation - 01:50
    detail texture - 02:18
    texture rotation - 03:23
    distance base blending - 03:44

КОМЕНТАРІ • 46

  • @delphicdescant
    @delphicdescant 5 місяців тому +35

    One downside of scaling the texture up for distant mountains is that it makes the mountains look smaller than they are, imo.
    So it kind of gives an underwhelming effect to the scale of the scene. But it's a matter of taste at that point, too, probably.

    • @mohsenzare2511
      @mohsenzare2511  5 місяців тому +9

      Yeah, that also is true! I thinks for each type of terrain you need to use one of these!

    • @GreenBlueClouds
      @GreenBlueClouds 5 місяців тому +1

      Maybe so, but you can mitigate it by using other techniques to sell scale. Atmospheric scattering repeated objects at different distances etc.

    • @SoulGuitarMetal
      @SoulGuitarMetal 5 місяців тому +1

      Just like LODs, have different versions based on camera distance. For far away I use these basic texture masks/colors you often get from terrain generators based on the geometry and detailed materials only for close view.

  • @monicde4570
    @monicde4570 5 місяців тому +3

    Choosing the best result yourself is a great thing that means you are more accurate in knowing what you want.
    A general engine(provided for everyone) using a texture rotation-based solution is suitable for most cases I think.
    Personally use a rotation-based blending way for my project(most scenes are cities and buildings) and it has variants for doing rotation and blending of course costs different but it can be optimized and is easy to implement.
    Bty, recently also research on this provides some similar tech like Texture Bombing(Unreal Using), Procedural Stochastic Texture((Unity)), Hex-Tiling(Unity), and Wang Tiles...(Yeah so much😂).

  • @user-zo1kn8ob7h
    @user-zo1kn8ob7h 5 місяців тому +2

    great idea. excited for the video

  • @user-zo1kn8ob7h
    @user-zo1kn8ob7h 5 місяців тому +1

    i enjoy your presending thank you

  • @llllllXllllll
    @llllllXllllll 5 місяців тому

    What if we apply some random lens like distortion in post processing of texture? Resource expensive maybe....

  • @nikbivation
    @nikbivation 5 місяців тому +4

    very very useful, thank you!!

  • @jiinkC
    @jiinkC 5 місяців тому +1

    Well done!

  • @kebrus
    @kebrus 5 місяців тому +1

    you forgot the best one of them all, stochastic sampling, it generates 3 triangle pattern uvs that interpolate between each other where you sample the same texture with random rotation and offsets for each triangle, create a completely unique and infinite texture without repetition, the caveat is being more expensive because it requires sampling 3 times and blending, but if the extra performance is not an issue it's the best approach

  • @nangld
    @nangld 5 місяців тому +5

    If you do software rendering, you can hack the mipmap generation function, so it will use different textures for different distances

    • @mohsenzare2511
      @mohsenzare2511  5 місяців тому

      Yeah I heard about that! that is also cool, but I doubt Godot will let you do it! I am not sure about that!

    • @SillyOrb
      @SillyOrb 5 місяців тому +2

      That's actually also possible with hardware accelerated rendering to a certain extent. In fact, you can supply every level of MIP yourself (at the most low-level of common APIs). So, you don't have to rely on runtime utilities that generate MIPs every time a texture is loaded. It's also (with a few API adjustments) the mechanism that allows for effective texture streaming, if you have all MIPs precomputed.
      Engines also use this to support features like custom MIP filtering and fading-out MIPs. Unfortunately I know nothing about Godot in this regard, yet, but given its open source nature, custom / packed MIPs should be rather easy to implement.
      Nintendo (among others) use this trick for "packed", "custom" or "arbitrary MIPs" (as they are sometimes called) on occasion. You can read about it in e.g. 🐬's progress report of October 2017 as well as the collective report for November and December 2023, January 2024.

  • @OzirV1000
    @OzirV1000 5 місяців тому

    Lol I was looking for information to solve this, but didn't know the name distance based blending, then youtube magic algorithm suggested this video and it's exactly what I needed.

  • @Lucas-gg9yb
    @Lucas-gg9yb 5 місяців тому +4

    Gamefreak and the zelda tears of the kingdom devteam should watch this tutorial

  • @mad_circuits
    @mad_circuits 5 місяців тому +21

    Thanks, but: Sorry, but the end result looks tiled, too. Awefully. 😢

    • @mohsenzare2511
      @mohsenzare2511  5 місяців тому +10

      As I told in video, we need to adjust the constant which I defined! if you adjust that, it will look better, In this video I did not do that! as I just explained about the algorithm!

  • @MustacheMerlin
    @MustacheMerlin 5 місяців тому +1

    The best solution is distance blending but NOT using the same tiling texture. You want to have a near texture and a far texture. The far texture will be specially made to represent the terrain from far away, and it doesn't have to be very high resolution since it's intended to have a very low texel density. A good way to make such a texture is to export your terrain as a mesh, then import it into a powerful procedural texturing tool along the vein of Substance Painter/Designer, then from there it's all art direction and your creative skills. You definitely want to use procedural texturing, because you'll have to remake this texture every time you change the terrain. It's best for it to be automatic.
    Things you may consider authoring into the far texture might be ambient occlusion of the heightmap, or aerial/atmospheric perspective (distant objects in real life experience more atmospheric scattering from the air in between, reducing the contrast of their colors and mixing in the blue sky color). Eg, Disneyland paints the tops of things they want to appear big bluer and less saturated, creating an illusion that the top is much farther away/Cinderella's castle is much taller. You could do something similar on mountain tops in your far texture to make them appear larger and more epic. A good far texture is probably dominated by solid colors with maybe a little bit of perlin noise to mess with the brightness and break them up, then ambient occlusion.
    In terms of shader performance, the fastest way I know to implement distance blending is to not do it in a shader at all. Use two different heightmap objects. You have a near version that uses the near texture and only extends a few dozen meters, and then a much larger far heightmap that only uses the far texture. Then you use some means to ensure that the near heightmap always renders in front of the far heightmap. A simple way is to lower the far heightmap so it's underneath the near one, probably in the vertex shader based on the distance to the player. If you have more control of your rendering engine you could just carefully control the ordering of things, so that the heightmaps are the first things rendered and the near one just draws over the far one, ignoring the depth test. Or a clipping mask/scissor thing, tbh I haven't actually learned how to use those graphics api features yet so IDK quite how that'd work. You could also feather the near heightmap mesh, so it becomes transparent around the edges and makes a nice smooth transition.

    • @mohsenzare2511
      @mohsenzare2511  5 місяців тому

      Thanks man these are some good suggestions!
      I don't have too much artistic skill but yeah it would be better if your far texture will be designed for being far texture!
      About using two different terrain for near and far texture, I divide my terrain to different region, I could assign a different shader to further regions, maybe I add this feature later down the road!

  • @vitormachado813
    @vitormachado813 5 місяців тому +7

    An improvement to your plugin would be to spawn objects on the map (trees, rocks, grass) using a mask texture. I develop terrains using Gaea, where there's the possibility to simulate and export the mask of the regions where the (trees, rocks, grass) are located. It would be very interesting to be able to use this mask. By the way, congratulations on the work! I used your plugin on a 4K height map and it stayed locked at 60 FPS.

    • @mohsenzare2511
      @mohsenzare2511  5 місяців тому +2

      Thanks man
      You know all of this stuff you are saying is possible with a few line of GDScript code, in terrain also in grass system there is a set_pixel function and save_grass function which you can use (you should save grass data to this work), I know I need to add more documentation, But take a look at functions which grass a terrain offer, you may understand something!

  • @MikkoRantalainen
    @MikkoRantalainen 5 місяців тому +1

    How about thinking the whole problem has having one single texture for the whole scene and then multiple layers of detail textures?

    • @igorthelight
      @igorthelight 5 місяців тому +1

      Maximum resolution of one texture can't be more that 8192x8192 pixels or it wouldn't fit in one texture page so that's not a great solution, sadly.

  • @ThankYouESM
    @ThankYouESM 5 місяців тому

    "Distance Blending by Size" seems to be the most efficient solution whereas the largest tile should also be the additive height map, but... it might look better with 3 tile sizes.

  • @Lucas-gg9yb
    @Lucas-gg9yb 5 місяців тому +1

    Everything you're showing on this tutorials here are on your mterrain plugin?

  • @Sylfa
    @Sylfa 5 місяців тому

    Adding grass/trees on top to hide tiling is fine and all, especially since you'll probably want to add those details anyway. But it's certainly a heavier solution than using a shader for just the terrain.
    I think you missed mentioning things like wang tiling which can be very useful technique, and given your channel image I assumed there would be more Godot specific advice about it.

  • @newbossbro3180
    @newbossbro3180 5 місяців тому

    Are you gonna start discord server?

  • @picodrift
    @picodrift 5 місяців тому +1

    The texture rotation method in your reference is the only reference of godot yet the guy's algorithm is flawed, if you played with his shader a bit you would found that the texture repeats in a spiral shape and you cant really fix it, nonetheless of the processing power it would consume, its just a bad way to do that for most game

    • @mohsenzare2511
      @mohsenzare2511  5 місяців тому

      I personally never used Texture rotation! As I prefer the last method which is distance base blending! For huge landscape that is the best method!

  • @firerunnew
    @firerunnew 5 місяців тому +1

    I'm still waiting for a NORMAL interface update, at the moment it looks terrible)

    • @merlinperlin
      @merlinperlin 5 місяців тому

      Do you mean the whole engine?

    • @firerunnew
      @firerunnew 5 місяців тому

      no, the user interface, at the top, the icons look like they were drawn by a five year old)@@merlinperlin

    • @mohsenzare2511
      @mohsenzare2511  5 місяців тому +1

      First I thought you are talking about a bug or performance issue, But no worry man, I will try to make some better UI in future!

    • @firerunnew
      @firerunnew 5 місяців тому

      Thank you! this is what I'm missing)@@mohsenzare2511

  • @vitaliyjuterbog8912
    @vitaliyjuterbog8912 5 місяців тому +1

    Good video but every moment I felt OP was going to inform me that my car warranty was expired.

  • @RoyaltyInTraining.
    @RoyaltyInTraining. 5 місяців тому +5

    To me it looks like your video has incredibly low bitrate. I know youtube generally has low quality, but this is noticeably worse than anything else I've seen here. The texture in the distance just looks like a blurry mess when you move around in the beginning.

    • @mohsenzare2511
      @mohsenzare2511  5 місяців тому

      Yeah you are right, I think I need to adjust the bitrate in OBS recoder

  • @alekon2253
    @alekon2253 Місяць тому

    its very bad plugin! textures cannot be loaded!

    • @timepass6972
      @timepass6972 Місяць тому

      try reading the docs, you have to write your own shader for textures to appear