Announcement

Collapse
No announcement yet.

changing materials on cue

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

    changing materials on cue

    Hi all

    Firstly, i'm not a programmer(yet) but i believe this involves some coding.
    Anyway, i'd like to a bit about calling/making material changes(like a ship cloaking, first a distortion effect and then the material changes to a mostly invisible one)
    I have made plenty of materials already so i know how to use the editor, and finally i'd like to know how to go about making some kind of in-game colour selection system that will colour pieces of the materials.

    Thanks

    #2
    For both you would be using material instances--this doesn't require any coding, all it is is that in your material you create a parameter that has a value--this value can be used as a color or say you want to use it to switch between textures or opacity you can use that value as a mask. Then you would create a material instance of it in your level, from there you can modify the material instance in Kismet to whatever value you want, so if you want to trigger the change or whatever you can do it that way.

    Comment


      #3
      cool, would i be able to use this to make a part of the material light up when hit by a weapon?

      Comment


        #4
        Originally posted by ShadowWraith View Post
        cool, would i be able to use this to make a part of the material light up when hit by a weapon?
        Yes, you can use a lerp (linear interpolation) in conjunction with a scalar parameter to do this. Basically you would create your emissive map and add it it to the material. Add a linear interpolation node to the material as well. Plug the scalar parameter (with a default value of 0) into the alpha of the lerp node and use a constant set to black (a value of 0) in the "B" input of the lerp, and plug your emissive into the "A" value of the lerp. Plug the output of the lerp into your emissive channel.

        Using kismet, set up a take damage event that will trigger the change of the scalar parameter from black to white (0 to 1) using matinee and this will change the emissive channel from the pure black constant to your emissive map, making the object glow, then use a delay after the matinee set to how long you want it to glow, and plug that into the reverse of the matinee to make the material stop glowing.

        Comment


          #5
          i'll check this out, thanks

          Comment


            #6
            Hey folks,

            I've a stupid question but, does it possible to reveal only a PART of the material (in this case, the emissive will be activated) applied on an object by toggling this area with a flashlight for exemple (or anything else). Like in Alan Wake on the yellow mark

            Comment


              #7
              That would probably involve some coding that takes into account the players field of view. I don't believe something like this can be done in just the material of the object, unless there's some really complex material trickery I haven't figured out yet.

              Comment


                #8
                I suspect that must be done by scripting if it's possible but if someone already know something about....

                Comment

                Working...
                X