Blender - Mapping and Baking - Primer

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • scottb613
    2500 Post Veteran


    • Apr 2003
    • 2848
    • Downeast Maine (soon)
    • ORTS

    #16
    Originally posted by pwillard
    Yeah, the UV MAPPING probably sealed the deal with me on Blender. I hated that part of 3D Canvas due to its gross inaccuracy and low level of control. And honestly... I stayed with 3D Canvas 7.120 because anything after that was either weird, unreliable or didn't work the way my 'muscle memory' worked. Version 10 was just wrong.

    While not everything needs to be UV mapped using "seams," it sure does help with complex shapes if you select your seams carefully. Some things actually do work quite well with "project from view." Provided you are careful with 1) VIEW and 2) keeping your distance constant so you don't have huge UV ISLAND size variations. (You CAN fix that after the fact; it is just more work)
    Originally posted by superheatedsteam
    Great topic Scott. I've been on 3.6 till I saw your screen shots, so I downloaded 4.3.0 this evening and been having a play.

    Note that glTF has been removed from the unstable version and I have a suspicion it is not going to make the Open Rails 1.6 release.

    Looking forward to your further posts.
    ​
    Hi Pete,

    Yeah - I was planning to cover "Project from View" and "Baking" as two more chapters - anything else?

    Hi Marek,

    Very cool - I've got 50 or so exports and a bunch of model work under 4.3 - no issues to report.

    Regards,
    Scott
    <a href=https://www.trainsim.com/forums/filedata/fetch?filedataid=80663&type=full title=thumb_80663.png >thumb_80663.png</a>​ My Blender Models

    Comment

    • scottb613
      2500 Post Veteran


      • Apr 2003
      • 2848
      • Downeast Maine (soon)
      • ORTS

      #17
      Originally posted by superheatedsteam
      Great topic Scott. I've been on 3.6 till I saw your screen shots, so I downloaded 4.3.0 this evening and been having a play.

      Note that glTF has been removed from the unstable version and I have a suspicion it is not going to make the Open Rails 1.6 release.

      Looking forward to your further posts.
      ​
      Hi Marek,

      Noticed my first issue with 4.3 - the [Alignment Tool] advanced functions no longer work properly…


      Regards,
      Scott

      <a href=https://www.trainsim.com/forums/filedata/fetch?filedataid=80663&type=full title=thumb_80663.png >thumb_80663.png</a>​ My Blender Models

      Comment

      • superheatedsteam
        Senior Member


        • Jun 2004
        • 764
        • Perth, WA, Australia.

        #18
        Hi Scott,

        I'm not familiar with that tool, but on closer inspection of my models, maybe I should be.

        Cheers,

        Marek.



        ​

        Comment

        • pwillard
          3000 Post Veteran



          • Nov 1999
          • 3070
          • Cumming Ga
          • ORTS

          #19
          Several alignment-related add-ons are also available. As usual, Blender.org changed enough things in 4.3 to disrupt my comfortable workflow.
          I think I will still recommend that people start with 3.6 LTS unless we can show V4.0 features that train modeling can't live without. I already need to consider V4.0-ifying my Blender Notebook Document.

          Grid Snapping behavior in V4.x is actually kind of a showstopper for me... as I feel it's broken (at least the way I use it).
          Last edited by pwillard; 12-06-2024, 07:01.
          http://www.railsimstuff.com
          Just Blender now, 3DCrafter only when I have to.
          Formerly The Keystone Works (All Permissions Granted)
          Things I work on: https://github.com/pwillard

          Comment

          • scottb613
            2500 Post Veteran


            • Apr 2003
            • 2848
            • Downeast Maine (soon)
            • ORTS

            #20
            Hi Folks,

            Yeah - the one thing I truly miss from 3DC is "Butt Objects" - you could easily align objects to minimum, maximum, or center bounds - on any axis. The Blender [Align Tool] advanced mode did similar but nowhere near as well.

            This is a Python Script that needs to be written...


            Regards,
            Scott
            <a href=https://www.trainsim.com/forums/filedata/fetch?filedataid=80663&type=full title=thumb_80663.png >thumb_80663.png</a>​ My Blender Models

            Comment

            • pwillard
              3000 Post Veteran



              • Nov 1999
              • 3070
              • Cumming Ga
              • ORTS

              #21
              Actually... I have add-ons that do roughly the equivalent of BUTT-OBJECTS. You might want to move addons and code discussions to a separate thread.

              http://www.railsimstuff.com
              Just Blender now, 3DCrafter only when I have to.
              Formerly The Keystone Works (All Permissions Granted)
              Things I work on: https://github.com/pwillard

              Comment

              • superheatedsteam
                Senior Member


                • Jun 2004
                • 764
                • Perth, WA, Australia.

                #22
                I thought I would share how I bake an Ambient Occlusion for my models using Blender and GIMP. This is probably not the right way but it works for my current workflow.

                Here are the settings I use in the shading menu when I perform an AO bake.

                AO_Bake_Blender.jpg

                Firstly, ignore the Metallic and Roughness texture nodes connected to the Principled BSDF shader. These are used for glTF exports and will not impact on AO baking or .S export.

                This model uses a single 4K texture for the external model called generic_sd40-2_4096.png. Each object on the model has had its faces UV Mapped to a unique location where I want it on the texture file.

                When ready to bake, I create a new 4K image texture node called AO_BAKE_4096.png. You can see this node below the principled BSDF but it is not connected to anything. I leave it below and to the right of the Principled BSDF so that it is easy to find and to remind me not to connect it to anything.

                In the Render Properties tab I have set the samples to 2048 which is high but gives a fine high resolution AO. Denosie is ticked as it improves the quality of the bake. I use the OptiX Denoiser as this is faster on my graphics card. Bake type is set to Ambient Occlusion. Device is set to GPU compute because Nvidia 2070 is considerably faster at baking than CPU. Version 4 of Blender can use the Vulkan engine which is supposed to be faster than OpenGL which is limited to being single threaded as I understand it. Test both to see which is faster for you using Edit > Preferences > System > Display Graphics > Backend > Vulkan or OpenGL

                I always bake at least 2 objects at the same time. If I bake a single object I get a black background for some reason. If I have 2 or more objects selected when baking, I get a transparent background which is what I want when importing into my 2D graphics program.

                Also before baking, I unplug the Alpha noodle between the Base Colour and Principled BSDF. If the alpha noodle is connected, and the UV Map of the object being baked is over an untextured/alpha area of the base colour, the resultant bake will be all black. Took me ages to work this one out.

                When the objects I want to bake are UV Mapped over a unique area of the texture file, I again ensure that the alpha noodle is not connected. I confirm I have 2 or more objects selected. I then left click to highlight the AO_BAKE_4096.png texture in the Shader Editor. This is important as Blender will now render the bake to the selected texture. In the UV editor on the left hand side I have the target AO_BAKE_4096.png texture selected so I can see the progress of the baking process.

                I then click on the 'Bake' button in the 'Render Properties' tab. The progress bar along the bottom of the screen shows how slowly it is going. The denoising does not show in the progress bar and makes Blender look like it has frozen. Baking objects with a small number of faces does not take long. For large parts with many triangles 10-15 minutes at 2048 samples is the norm with my models on my computer.

                Once the bake has completed, I use the Image > Save As drop down menu in the UV Editor and I save the file as AO_BAKE_4096.png.

                In the Blender screen shot you can see the AO for the fuel tank on the bottom left of the texture with the rest of the area being transparent/alpha.

                I then go into GIMP and then import the AO_BAKE_4096.png file as a layer on top of my already present AO layer which is a combination of all the other objects that have baked the AO for over time.


                AO_Bake_GIMP1.jpg

                I then merge that imported AO layer into the existing AO layer so I have a single AO layer. Below this AO layer I have the diffuse colours. I then apply the 'Multiply' mode to the AO layer that blends it with the underlying coloured layers.

                AO_Bake_GIMP2.jpg


                I then export this from GIMP as the texture file that is applied to the model in Blender, in this model it is generic_SD40-2_4096.png and export it as generic_SD40-2_4096.dds for use directly in OpenRails.

                The next object/s that need to have their AO baked, are unwrapped to another unique location on the texture file, selected and baked to the AO_BAKE_4096.png file as described above. This same file is used to transfer the AO bake from Blender to be combined with the AO layer in GIMP.

                If you are using texture files with different resolutions then make the texture file you are going to bake the AO to the same size.

                If you get unexpected black areas in your bake then that can be caused by different things. Having the alpha noodle connected when baking has already been mentioned above. Flipped normals are another common cause. Other geometry overlapping the baked surface is another common cause. These can be hard to find, especially if you have hidden some objects, they still mask the baking process.

                Hope this helps.

                Cheers,

                Marek.


                Comment

                • wacampbell
                  Senior Member
                  • Jun 2002
                  • 492
                  • BC, Canada

                  #23
                  Excellent tutorial! I picked up a few tips from this. Thanks!

                  Comment

                  • pwillard
                    3000 Post Veteran



                    • Nov 1999
                    • 3070
                    • Cumming Ga
                    • ORTS

                    #24

                    This is why AO Baking chaps my butt.

                    Screenshot 2025-10-07 081513.png I'm adding this to the Content Creation Notebook.

                    Last edited by pwillard; 10-07-2025, 06:16.
                    http://www.railsimstuff.com
                    Just Blender now, 3DCrafter only when I have to.
                    Formerly The Keystone Works (All Permissions Granted)
                    Things I work on: https://github.com/pwillard

                    Comment

                    Working...