Prevent Tile Texture in Terrain

Поделиться
HTML-код
  • Опубликовано: 15 сен 2024

Комментарии • 46

  • @delphicdescant
    @delphicdescant 7 месяцев назад +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  7 месяцев назад +9

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

    • @GreenBlueClouds
      @GreenBlueClouds 6 месяцев назад +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 6 месяцев назад +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 7 месяцев назад +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😂).

  • @mad_circuits
    @mad_circuits 7 месяцев назад +21

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

    • @mohsenzare2511
      @mohsenzare2511  7 месяцев назад +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!

  • @nangld
    @nangld 7 месяцев назад +5

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

    • @mohsenzare2511
      @mohsenzare2511  7 месяцев назад

      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 7 месяцев назад +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.

  • @kebrus
    @kebrus 6 месяцев назад +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

  • @Lucas-gg9yb
    @Lucas-gg9yb 7 месяцев назад +4

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

  • @OzirV1000
    @OzirV1000 6 месяцев назад

    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.

  • @vitormachado813
    @vitormachado813 7 месяцев назад +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  7 месяцев назад +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!

  • @nikbivation
    @nikbivation 7 месяцев назад +4

    very very useful, thank you!!

  • @MikkoRantalainen
    @MikkoRantalainen 6 месяцев назад +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 6 месяцев назад +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.

  • @MustacheMerlin
    @MustacheMerlin 6 месяцев назад +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  6 месяцев назад

      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!

  • @ThankYouESM
    @ThankYouESM 7 месяцев назад

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

  • @user-zo1kn8ob7h
    @user-zo1kn8ob7h 7 месяцев назад +2

    great idea. excited for the video

  • @llllllXllllll
    @llllllXllllll 7 месяцев назад

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

  • @Sylfa
    @Sylfa 6 месяцев назад

    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.

  • @user-zo1kn8ob7h
    @user-zo1kn8ob7h 7 месяцев назад +1

    i enjoy your presending thank you

  • @Lucas-gg9yb
    @Lucas-gg9yb 7 месяцев назад +1

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

  • @picodrift
    @picodrift 7 месяцев назад +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  7 месяцев назад

      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!

  • @RoyaltyInTraining.
    @RoyaltyInTraining. 7 месяцев назад +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  7 месяцев назад

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

  • @jiinkC
    @jiinkC 7 месяцев назад +1

    Well done!

  • @vitaliyjuterbog8912
    @vitaliyjuterbog8912 7 месяцев назад +1

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

  • @firerunnew
    @firerunnew 7 месяцев назад +1

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

    • @merlinperlin
      @merlinperlin 7 месяцев назад

      Do you mean the whole engine?

    • @firerunnew
      @firerunnew 7 месяцев назад

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

    • @mohsenzare2511
      @mohsenzare2511  7 месяцев назад +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 7 месяцев назад

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

  • @newbossbro3180
    @newbossbro3180 7 месяцев назад

    Are you gonna start discord server?

  • @alekon2253
    @alekon2253 3 месяца назад

    its very bad plugin! textures cannot be loaded!

    • @timepass6972
      @timepass6972 3 месяца назад

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