Painting a Terrain in Blender

Поділитися
Вставка
  • Опубліковано 12 вер 2024
  • Have a terrain mesh and need to apply textures to it? This video walks you through using multiple masks to blend textures together to make a complex textured terrain without using an overly huge texture.
    Help support the channel:
    Patreon: / markmckay
    Blender Market: blendermarket....

КОМЕНТАРІ • 77

  • @inodedentry8887
    @inodedentry8887 14 днів тому

    Small piece of advice for saving even more memory. You don't need multiple mask textures. You can use the RGBA channels of one texture. Have each channel control a different mixer node and paint everything onto one texture.
    Further, you should probably change the data type on the mask textures from sRGB to linear. Linear is more appropriate for this use case.

  • @vixiliannebrightsun81
    @vixiliannebrightsun81 Рік тому +7

    This tutorial is EXCELLENT, very detailed and easy to follow and you’ve got an excellent voice as well, very Bob Ross like! I love it, thank you so much

  • @crystaltigeranimations4949
    @crystaltigeranimations4949 Рік тому +3

    You're a godsend! I'm making a TF2-Themed map for my friends, and I really needed to figure out how to texture stuff in Blender and this tutorial was extremely helpful. You don't ramble on about stuff that doesn't matter, and you actually explain what you need to, and the instructions are clear and concise. I was easily able to extrapolate the information I needed as I'm not doing quite the same thing as you, since I need a few more textures to blend, but you taught it well enough that I was able to understand exactly how I should do it without needing another tutorial for it. Your teaching made it make sense! Thank you so much.

  • @Grandalf3004
    @Grandalf3004 2 місяці тому

    This still works for terrains with overhangs and holes too!! it just means your final texture will be more slightly more bloated in size from unwrapping and flattening, but in modern systems that have so much memory its barely noticeable, even phones.

  • @nobanan838
    @nobanan838 Рік тому +3

    I've been looking for a tutorial like this for a very long time, thanks !

  • @jernejcebasek8369
    @jernejcebasek8369 6 місяців тому

    You don't know how much you have helped me with further understanding how to create better ground terrain. Thank you so much for this tutorial and i wish you all the best in life! :)

  • @NEERAJKUMAR-iy9kn
    @NEERAJKUMAR-iy9kn 18 днів тому

    Excellent, thank you Sir...

  • @jarrodlondt9746
    @jarrodlondt9746 10 днів тому

    Perfect! Thank you

  • @IndigoArcadia
    @IndigoArcadia Рік тому

    This is exactly the video I was looking for. thank you!

  • @theshadowgamedev61
    @theshadowgamedev61 Рік тому +1

    You helped me a lot. Thanks!

  • @rakdos5371
    @rakdos5371 Рік тому

    Fantastic tutorial, thank you so much!!!

  • @danielvillalba5375
    @danielvillalba5375 Рік тому

    This helps a lot.

  • @AlexValder
    @AlexValder Рік тому +1

    I had trouble with exporting my terrain into Godot Engine, but it turns out you can save mask images as separate files, and then you can recreate with VisualShader all the setup. Some nodes are named differently, but as long as you remember that colors and textures and also vectors, you'll figure it out. There has to be similar solution for Unity and/or Unreal (though they should be having built-in terrain editing tools)

  • @Cris-Alencar
    @Cris-Alencar Рік тому

    Awesome and very useful tutorial, thank you very much for sharing your knowledge! :) Would you know please if it's possible to paint in real time in the rendered preview too?

    • @GalaxyPedlar
      @GalaxyPedlar  Рік тому +1

      In Blender the interactive texture paint doesn't update in real time in Cycles. It does work in Eevee, though. You can try painting in either hardware renderer or Eevee to get realtime feedback.

    • @Cris-Alencar
      @Cris-Alencar Рік тому +1

      @@GalaxyPedlar thank you very much for answering. :)

  • @oCycleb-co1cl
    @oCycleb-co1cl Місяць тому

    🎉🎉

  • @maschlarea5172
    @maschlarea5172 Рік тому

    Excellent, I can't add anything what hasn't been already stated.
    Since I never really made friends with nodes: I have a large Terrain with several different types of ground, among which is grass, so I need an underlying grass material, since it'll be rendered from the top.
    I have 3 ready made materials I want to use - I copied & pasted them all into 1 new material (mixed BSDF & Displacement also in a mix node), added the mix nodes between the materials (after the BSDF/Disp mix nodes) , masks, but I can't seem to get the masks to work. It seems like I'm always painting on the wrong image, even though I select the appropriate image node. Nothing ever happens 😅 When I switch to shaded mode, I see the white strokes, but they don't have an influence.
    Going into the Texture slots, I saw I was actually painting a scattering mask. Weird!

    • @GalaxyPedlar
      @GalaxyPedlar  Рік тому

      Blender's system is not the easiest to use and it can be easy to select the wrong mask to panit into. You might want to go through the tutorial a second time just to be sure you got everything.

    • @maschlarea5172
      @maschlarea5172 Рік тому

      @@GalaxyPedlar The mask was correct, I had the UV scale way up, so the area was tiny and tiled all over the mesh, so I couldn't see it. Most of the time, the following day and fresh eyes bring the solution 😀

  • @DAST_3D
    @DAST_3D 2 роки тому +1

    how do you export this to the game engine? baking the texture or is there some other way?
    Nice video. Thanks for sharing this content

    • @GalaxyPedlar
      @GalaxyPedlar  2 роки тому

      You could bake it, but that's not recommended because you'll end up with a huge texture. A better way will involve writing a custom shader that can load all your texture and mask images individually and mix them in the game engine. Some game engines have a shader node system similar to Blender, so you can build the same network in the game engine and load your textures in that way.

    • @ninikiki7039
      @ninikiki7039 Рік тому +1

      @@GalaxyPedlar how to write texture and mask info to mesh fle like fbx?

    • @GalaxyPedlar
      @GalaxyPedlar  Рік тому +2

      @@ninikiki7039 I don't know about fbx. However, this is a custom node setup and you will need most likely need to create a custom shader for it in whichever program you are importing it into. So you should probably be importing the map files themselves instead of relying on fbx to do it for you.

  • @UraniumDeba1
    @UraniumDeba1 2 місяці тому

    How to export because when exporting the texture is not showing?...

    • @GalaxyPedlar
      @GalaxyPedlar  2 місяці тому

      You can't export it directly. You will need to recreate the shader in whatever game engine you're using and then add the different texture maps to that.

  • @Alchemyofcolor
    @Alchemyofcolor 2 місяці тому

    How to save it? I closed my blender and when I opened it again, everything disappeared!

    • @GalaxyPedlar
      @GalaxyPedlar  2 місяці тому +1

      If you mean saving the textures that you're painting, you need to either save it as an image before you close Blender. You could also try packing it which will cause it to be saved as part of the Blender file. Blender requires you to take special steps to save any textures that you create or paint, and I'd recommend reading up on that.

    • @Alchemyofcolor
      @Alchemyofcolor 2 місяці тому

      @@GalaxyPedlar Thank you very much! But it would be great to mention this in the video before I closed and lost everything 🥲 By the way, thank you so much for this tutorial, you are thee only one who really doing it easy and understandable!

    • @GalaxyPedlar
      @GalaxyPedlar  2 місяці тому

      @@Alchemyofcolor Unfortunately, UA-cam doesn't let you update a video once it's published. Sorry about this - but I'm glad you found the rest of the video helpful.

  • @AleksandarPopovic
    @AleksandarPopovic Рік тому

    Nice idea, ans ypu can bake difuse textture, an,go with more texture....

    • @GalaxyPedlar
      @GalaxyPedlar  Рік тому

      I've put together another tutorial which shows a more advanced version of this technique. ua-cam.com/video/miUAc_cDmAo/v-deo.html

  • @ryandracuscodesgames8418
    @ryandracuscodesgames8418 Рік тому +1

    After applying the scaling and the other transforms, how do I save that image texture as an image file? The UVs don't translate to the original image used once we scale it. Is there a way to save the new one?

    • @GalaxyPedlar
      @GalaxyPedlar  Рік тому

      You can save both the mask and terrain texture as separate images. The two images are using different UVs. When you import your model to your game engine, make sure you're using a shader that uses one uv set for the mask and the other uv set for the texture.

    • @ryandracuscodesgames8418
      @ryandracuscodesgames8418 Рік тому

      @@GalaxyPedlar Hmm. How would I go about saving that file? I'm not using a game engine. I'm using my own 3d software renderer where I just read the vertex, uv, and face values from the obj file as a text file, and I import it to my own classes for use.

    • @ryandracuscodesgames8418
      @ryandracuscodesgames8418 Рік тому +1

      @@GalaxyPedlar A better question for me to ask is, is the scaling applying to the uv's where it will divide or multiply all the uv's by that set scale or the image size itself? If it's the uv's is it dividing? I'm not sure what transformation is being done in blender.

    • @GalaxyPedlar
      @GalaxyPedlar  Рік тому

      @@ryandracuscodesgames8418 The obj file won't save the details of the shader's Mapping node, so you won't see it in the file. You'll need to find another way to export this data or maybe even just copy it by hand. Then in your program you'll need to create a matrix which does the same transform as the Mapping node and then for every uv coordinate, multiply it by this matrix (or perhaps the inverse of this matrix - I don't recall which at the moment).

    • @ryandracuscodesgames8418
      @ryandracuscodesgames8418 Рік тому

      @@GalaxyPedlar I appreciate the assistance to a stranger. I created and applied a scale matrix, it didn't have to be inverse luckily enough, to all the uv's by my factor, and it came out like it did in blender in my software renderer. Thanks!

  • @underscoremavis
    @underscoremavis Рік тому +1

    super helpful, ive referenced this video a few times now. would you or anyone else that stumbles on this comment know of a shader that supports this for unity that isn't the built in terrain system? or maybe something similar. preferably free if possible

    • @GalaxyPedlar
      @GalaxyPedlar  Рік тому +2

      I haven't used Unity in a while, but maybe I could do that in a future video.

    • @underscoremavis
      @underscoremavis Рік тому

      @@GalaxyPedlar woah i didn't expect a response, thank you!! that'd be awesome in the future. im still looking for one someone else made but im mostly an art/graphics person than a techy/coding type so ive been lost on where to search haha. i appreciate your reply a lot though!

  • @GIOCONNO
    @GIOCONNO 6 місяців тому

    Is it possible to bake all the painted textures in one texture to export as image texture? i'm trying it but i get always black images :(

    • @GalaxyPedlar
      @GalaxyPedlar  6 місяців тому

      It is possible, but you'll probably get a huge texture. Setting up texture baking can be tricky - practice on a smaller model before trying with the terrain shader.

    • @GIOCONNO
      @GIOCONNO 6 місяців тому

      i reealy need to learn how to bake and export terrain shader, i don't mind if it's a huge texture, because it a single texture only for terrain :D @@GalaxyPedlar

    • @GalaxyPedlar
      @GalaxyPedlar  6 місяців тому

      @@GIOCONNOThere are lots of baking tutorials on UA-cam. They should give you a good idea of how to set this up.

    • @GalaxyPedlar
      @GalaxyPedlar  6 місяців тому +1

      @@GIOCONNOI've put together a video that goes over the basics. ua-cam.com/video/d7QZ3xHC478/v-deo.html

  • @Awtsmoos
    @Awtsmoos 10 місяців тому

    B"H
    Hi the problem is when exporting to GLB it doesn't keep the mix shader info I need to bake it to a UV map. How can I do that, or how can I get it to work in an exported model (GLB ideally)?

    • @GalaxyPedlar
      @GalaxyPedlar  10 місяців тому

      You can't export the shader directly. You'll need to create a new shader in your game engine and copy the parameters across by hand. I have another video that goes through the process. ua-cam.com/video/hpfxUDPxVZ8/v-deo.html

    • @Awtsmoos
      @Awtsmoos 10 місяців тому

      @@GalaxyPedlar cool. Tried just making a basic mix shader using shader material in three.js. problem is it didn't preserve any of the other standard shader options (say for meshlambertmaterial). I could remake them all from scratch in the shader (like fog shadows lighting etc.) But do you know if there a way to do mix shader effect with built in three.js?
      In terms of storage also if we are just using the entire texture for black and white for each overlay there should be a better way to store it rather than like png that saves every pixel at least between 0 to 255 for rgba

    • @GalaxyPedlar
      @GalaxyPedlar  10 місяців тому

      @@Awtsmoos I'm not that familiar with three.js, but I think it's based on OpenGL ES, so you should be able to use GLSL shaders with it. I'm sure three.js will have some documentation on making your own shaders. And it you watch the other video, I think it goes through using the different channels of the mask if you want to store all the masks in a single RGB texture. Although you can also use pure black and while images in OpenGL ES. Just make sure to set your image format type to THREE.LuminanceFormat and the mask image should only use one byte per pixel.

    • @Awtsmoos
      @Awtsmoos 10 місяців тому

      @@GalaxyPedlar interesting, thanks. Is there a way to use more than the 4 channels, like one hex value per color?

    • @GalaxyPedlar
      @GalaxyPedlar  10 місяців тому

      @@AwtsmoosYou could, but shaders aren't really built to handle indexed colors. And I don't know how you'd get that to work in Blender. I'd suggest just using single channel black and white images for the masks.

  • @julliannur2717
    @julliannur2717 Рік тому

    Bingo thankyou

  • @dorex2007
    @dorex2007 Рік тому

    I like the concept, but you're missing displacements, normal, AO, etc. etc. All the things that make the end result look good.

    • @GalaxyPedlar
      @GalaxyPedlar  Рік тому

      You're right. I skipped those things because I was using hand painted textures, but maybe I can make another video that shows how to use more complicated shaders. If you need extra features like normal maps, you can use most of what's shown in this video, but mix shader nodes together instead of texture nodes.

  • @DarkMaglc123
    @DarkMaglc123 Рік тому

    Can you do this with more than two textures?

    • @GalaxyPedlar
      @GalaxyPedlar  Рік тому

      Yes. You can repeat the process of adding a new layer and layer mask as many times as you want.

    • @DarkMaglc123
      @DarkMaglc123 Рік тому

      @@GalaxyPedlar Awesome, thanks for the quick reply!

  • @GIOCONNO
    @GIOCONNO 10 місяців тому

    how do you apply normal maps in those shaders??? please i need it D:

    • @GalaxyPedlar
      @GalaxyPedlar  10 місяців тому

      It might be tricky to say in a you tube comment, but basically you st up a network for combining your normal color maps together similar to the way you st one up for the diffuse colors. Then you create a normal map node and send the normal map color data into it. Then you create a Vector Math node, set it to Normalize and run the output through that. Finally you send the output to the normal input of your BDSF shader. The setup in your game engine should be similar.

    • @GalaxyPedlar
      @GalaxyPedlar  10 місяців тому +1

      I don't know what you're referring to. Just feed the mixed normal map into the normal channel of your shader.

    • @GIOCONNO
      @GIOCONNO 10 місяців тому

      @@GalaxyPedlar thanks, at the end i manage it :D now the big problem is import my texurated terrain from blender to unity.....it's always white without textures :(

    • @GalaxyPedlar
      @GalaxyPedlar  10 місяців тому

      @@GIOCONNO Blender won't export complex shader networks. You'll need to create a similar shader in Unity and then then set it's parameters to the same values that they were in Blender.

    • @GIOCONNO
      @GIOCONNO 10 місяців тому

      Could you please make a video tutorial for that?

  • @H1tARun
    @H1tARun 6 місяців тому

    Does not work. It repeats changes in other areas that it repeats.

    • @GalaxyPedlar
      @GalaxyPedlar  6 місяців тому

      I think you may have set the UVs for your masks layer incorrectly. Make sure your mask layer is set up so that everything fits within the 0 - 1 UV square.
      You might want to go through the tutorial again.

  • @savenxrth
    @savenxrth Рік тому

    how would i export this with the textures as well?

    • @GalaxyPedlar
      @GalaxyPedlar  Рік тому

      Most importers won't be able to handle custom shaders like this. You'll probably need to copy the texture parameters by hand into your game's shader.

    • @savenxrth
      @savenxrth Рік тому

      @@GalaxyPedlar im trying to import them into roblox, which is kinda limited, is there any way i could export the texture image or something?

    • @GalaxyPedlar
      @GalaxyPedlar  Рік тому

      @@savenxrth You could bake the whole thing to a single texture, but that texture would be enormous and probably too big for Roblox. I've not used Roblox before. Does it let you make your own shaders?

    • @savenxrth
      @savenxrth Рік тому

      @@GalaxyPedlar unfortunately not, i found a way around it tho, i split the different materials into different models and then textured every model differently, gets the job done 👍