Home Unreal Engine

Material static switch change at runtime?

polycounter
Offline / Send Message
Davision3D polycounter
Is it somehow possible to change the static switch parameter of a Material Instance Constant at runtime? I know its working with floats and vectors but for some reason there seems to be no way for bools.

I like to have the player choose from different shader effects. I would do it with liner interpolate nodes and then a alpha float parameter with 0 or 1 but that would always add up all effects to the constant registers and then i get the "Vertex Shader Constant uses to many constant registers for Shader model 3" error message. Maybe a workaround could be to convert a float to a bool in the material but I could find no way to do that either.

Replies

  • blankslatejoe
    Options
    Offline / Send Message
    blankslatejoe polycounter lvl 18
    I don't think you can...Static switches are called static for that reason--even with script you can't change them at runtime--though you could swap materials on a mesh between different material instance constants with different switches turned on/off.
  • Davision3D
    Options
    Offline / Send Message
    Davision3D polycounter
    I don't think you can...Static switches are called static for that reason--even with script you can't change them at runtime--though you could swap materials on a mesh between different material instance constants with different switches turned on/off.

    Yea, that works with swapping the materials, have tried that now. Its a bit tedious to set that up for all actors. A problem with that is that for some reason swapped in materials cant be animated with matinee. I can still change scalar values with set scalarparam though. But again strange is that in kismet you have only set scalar parameter and no set vector parameter.
  • blankslatejoe
    Options
    Offline / Send Message
    blankslatejoe polycounter lvl 18
    no kidding. they used to have it, but stripped it out for some reason. You could use 3 scalars, use those in kismet, and then append them into a 3-channel vector in the material though
  • Davision3D
    Options
    Offline / Send Message
    Davision3D polycounter
    Ha, but shouldn't be much extra work appending it then in the material.
Sign In or Register to comment.