Announcement

Collapse
No announcement yet.

How to set specular of all materials to 0 easy ?

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

    How to set specular of all materials to 0 easy ?

    Hi,

    Is it possible to set the specular of all materials to 0 in an easier way than opening every each material ?
    I have a lot of materials and opening every each material is very inefficient and time consuming.

    Thank you !
    Last edited by flobv; 02-10-2017, 09:39 PM.

    #2
    Material parameter collections: https://docs.unrealengine.com/latest...erCollections/

    Comment


      #3
      That's not what I meant.

      I have many objects imported from another program. Every object has many textures. When these objects are imported in Unreal there are many materials created. By default every material has specular 0.5. I need to set the specular to 0 to all these materials and leave it to 0. I don't need to change the specular afterwards (i.e. at runtime). So what I need is a way to set the specular to 0 without opening all these materials manually. Is this possible ?

      One alternative would be to make the default specular to 0 at import. Is this possible ?

      Thank you !

      Comment


        #4
        I think there is some way to set all your materials to Full rough.

        But editing BasePassPixelShader is probably easiest way.
        https://github.com/EpicGames/UnrealE...hader.usf#L795

        Just add these lines there.
        Code:
        GBuffer.SpecularColor = 0;
        GBuffer.Roughness = 1;

        Comment


          #5
          Generally, for adherence to PBR standards, you actually want to set your specular to 0.5 universally.
          Trent Polack (@mittense)
          Personal Site | Development Blog | Joy Machine

          Comment


            #6
            Originally posted by flobv View Post
            That's not what I meant.

            I have many objects imported from another program. Every object has many textures. When these objects are imported in Unreal there are many materials created. By default every material has specular 0.5. I need to set the specular to 0 to all these materials and leave it to 0. I don't need to change the specular afterwards (i.e. at runtime). So what I need is a way to set the specular to 0 without opening all these materials manually. Is this possible ?

            One alternative would be to make the default specular to 0 at import. Is this possible ?

            Thank you !
            Import them with materials and choose a material in the Base Material Name during import (under materials) that you want to copy the settings from. If the name of the material of the model is the same as the one you choose here they will use that material, if they are different a new one will be created. You can try creating a master material and an instance from that and choose the instance as the Base Material Name.

            Also material parameter collections are not only used for runtime things.

            Comment


              #7
              Thanks Kalle_H and cyaoeu. Both methods worked.

              One more question: is it possible to define a parent material for an object after it has been imported ? I want to avoid a reimport.

              Thank you !

              Comment


                #8
                Actually I checked more closely and the Base Material Method doesn't change anything.

                Comment


                  #9
                  How does it not change anything? You should get new material instances with the values you want.

                  You can test this by exporting some meshes (a cube/sphere with a material) from your modeling software. Create a new material in the editor and create parameters for color/roughness/specular and set the defaults to whatever you like (specular 0). Import the meshes and set the material you created to be the Base Material. You don't need to change the dropdown values, they can be blank. If you click import all new material instances will be created with the names you chose in your modeling software and applied to the meshes. This is a new feature added in 4.14.

                  Comment


                    #10
                    Sorry to bump an old thread, but I have the same problem.

                    The solution suggested by cyaoeu does not work for me. Is there another way to accomplish this?

                    Comment


                      #11
                      Bump, would also love to know if there is a way to do this.

                      Comment

                      Working...
                      X