Announcement

Collapse
No announcement yet.

Modular Showroom, Random Mesh, random Material or Random Texture?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Modular Showroom, Random Mesh, random Material or Random Texture?

    Hi everyone!
    I'm Working on a modular showroom as you can see here:

    Click image for larger version

Name:	anim_showroom.gif
Views:	1
Size:	749.5 KB
ID:	1221535

    Click image for larger version

Name:	modular_showroom.png
Views:	1
Size:	360.7 KB
ID:	1221525

    As you can It works! (Thanks to the udemy courses). It consist of A start and a end object, and in the middle several instance of the same objetc. The problem is the texture repeat.
    I thought 3 solutions
    1 randomly offset the texture. as it's a tilable texture it shouldn't be a problem
    2 create several material with different textures and randomly apply them
    3 create several middle modular block and asign them randomly

    I think the first solution is the easiest but I didn't manage to do it. And for the two other, I really love to know how to do that.

    I tried to use a per Instance Radom to offset the texture, but it seems that the duplicate part in the blueprint are considered as the same instance
    Click image for larger version

Name:	woodshader.PNG
Views:	1
Size:	218.9 KB
ID:	1221541
    Attached Files
    Last edited by kald; 06-06-2017, 09:13 AM.

    #2
    One question first: Do you tick the checkbox called "Used with instanced static meshes" on the left panel in the material properties?
    As I recall, perInstanceRandom needs it ticked. Might be the reason, why the tiling doesn't work correctly.

    Main channel:
    https://www.youtube.com/channel/UCGC...o9s3YcA/videos

    Comment


      #3
      Thank tou DarkGodsLair. I didn't know this option. I checked the box, but it didn't change, the repeat is still there. Maybe, the add mesh create with blueprint isn't considered as an instance?

      Comment


        #4
        I had a look over your blueprint today, because I was too tired yesterday. What you actually only use are static meshes and not instances.
        If you want to have instances, I modified your blueprint graph with two nodes, "Add Hierarchical StaticMesh Component" and "Add Instance":

        Click image for larger version

Name:	9cc3d001bbbb44e29cfea5cd3d3cc376.png
Views:	1
Size:	331.3 KB
ID:	1129212

        If you still want to use static meshes and no instances with alternating materials, you can use this:

        Click image for larger version

Name:	35c73375f4744471a78a53e7864b5548.png
Views:	1
Size:	209.5 KB
ID:	1129214

        Hopefully that helps you .
        Main channel:
        https://www.youtube.com/channel/UCGC...o9s3YcA/videos

        Comment


          #5
          Good Evening!
          Thank you so much DarkGodsLair, you made my day!!! That's a lot. Thanks for taking time to make those explanations! Hope it will hep other users too!
          Here's the first test
          Click image for larger version

Name:	RANDOM MAT.PNG
Views:	1
Size:	526.0 KB
ID:	1129265
          And the new version of the BP
          Click image for larger version

Name:	Modular showroom BP.PNG
Views:	1
Size:	426.2 KB
ID:	1129262

          I don't know if it's normal, but nom I have a lot of lag. Does this require à lot of performance?

          By the way thak you again, I even managed to make random meshes with the same method:
          Click image for larger version

Name:	RANDOM Meshes.PNG
Views:	1
Size:	566.0 KB
ID:	1129266
          Attached Files

          Comment


            #6
            Glad to be of help.

            And yes, spawning lots of static meshes uses a good amount of performance. That's why instances are a way to generate a lot of objects without the downside of tearing your performance down. Instances are however more difficult to set up, because they have limited options to modify an instance. The downside of instances are that you can't use different materials on individual instances. Because instances are basicly just a copy of the main mesh it was copied from, they share the same material and the same properties.

            Multiple colliders can also mean a slow down of your performance. If you continue to use static meshes, try to make them less complex and more efficient. Make lesser sessions and generally optimize your blueprint. You are also running it in the construction script with two for loops, which are executed on a frame by frame timing. So it is pretty normal that you get lags. If you don't want the sections to be generated every time you move your blueprint, you can create a bool and set a branch right after your "Construction Script" node. Call it "Generate meshes?" or whatever you want. Then expose the bool to the editor (click on the closed eye icon on the left side of your bool variable). Set the initial bool value to false and plug your newly created bool variable into your "branch" red condition pin.

            In the details panel of your blueprint in the world outliner will appear a bool called "Generate meshes?" or whatever you called the bool. If you then tick the box of the bool, it will then first generate your meshes. And if you want to move it again just untick the bool.

            Have fun with your project! .
            Main channel:
            https://www.youtube.com/channel/UCGC...o9s3YcA/videos

            Comment


              #7
              OK! Understand! Thank You for being so helpfull!!!!!

              Comment

              Working...
              X