Home Unreal Engine

Switching Material Instance Actors

PaulH
polycounter lvl 7
Offline / Send Message
PaulH polycounter lvl 7
Hey guys,

I'm building a day/night/weather system at the moment, treading a lot of new territory but making progress nonetheless. My progress has been stumped however, here's the pickle:

For my ground plane I've got a separate material for dry, wet and snow.
For my assets I've got a separate material for dry, wet and snow.

The intention was to be able to switch these at runtime via matinee, so when clouds form it would either rain or snow, and then the ground shader and object shader Matinees would kick in to build up either puddles or snow.

My problem is switching the materials in kismet. I'm using the switch material kismet node, material instance actors, also the assets and ground plane are interpactors.

The materials are switching, but won't play through their respective Matinees. So the ground plane starts as dry, switches to snow and then rain, but neither of the build ups of either element are visible or even begin.

Any kismet tricksters around here? I'd appreciate any and all input, this is a pretty significant part of the system!

Cheers!

ph

Replies

  • imbueFX
    Options
    Offline / Send Message
    imbueFX polycounter lvl 5
    I'm not an expert at terrain/environments, but you may want to consider making one master material instead of trying to switch materials on the fly. You can then vertex paint your ground plane to switch between the different states.

    Or you could use a MI that is controlled through scalar or vector parameters in a matinee track to control the transition as well.
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    1 material, is a much better option, since you could either vertex paint in the snow and puddels, or even drive it with a animated scalar parameter in matinee, to have snow gradually blend in during the run time of the map.
  • PaulH
    Options
    Offline / Send Message
    PaulH polycounter lvl 7
    Hey guys, responses very much appreciated!

    I note that a master material is how they rock it with the UDK day and night map.

    My ground shaders at least include vertex paint functionality (many thanks to Crayloen) and can already build the puddles and snow up gradually via Matinee, as you both rightly suggested!

    My hope was that I'd be able to switch from the dry material matinee, build up and fall off with the puddles matinee, and be able to do the same with the snow matinee. All the while these seperate matinees would help control the associated particle effects (splashes, lightning etc).

    The reason for this is that I'm also creating a seasonal cycle, and it'd be a lot easier for me to hook things up in Kismet this way, seeing as it won't snow in summer but it will rain!

    I could go the suggested route and use a single master material, with several variations of Matinees (one to block out the snow and increase the puddles, and vice versa) but the shader would be HUOWHHHJ. This would also have to be done for the object/asset shader.

    What do you guys think? Really appreciate your suggestions, I just want to avoid this route unless absolutely necessary.

    Sorry my posts are so long! I'll post some pictures to make up for it!

    ph
  • passerby
    Options
    Offline / Send Message
    passerby polycounter lvl 12
    swapping should just work, but a other option, could be to setup static switches, in the material, so things can be swapped between the winter, and the summer network within the material.
  • PaulH
    Options
    Offline / Send Message
    PaulH polycounter lvl 7
    Hey passerby. Yeah swapping should just work, it doesn't seem like a particularly complicated thing to achieve. A designer pal is rather kindly taking a look at it to see if he can come up with a solution, so we'll see if it is actually possible.

    Great idea, but my understanding is that static switches can't be changed at runtime so it's not really ideal for what I want to do. Thanks for your input though man.
Sign In or Register to comment.