Switch Param in Materials

  • Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

nymets1104

Active member
Dec 18, 2012
2,432
24
38
USA
While messing with the Street Lamp Mesh from the SDK:
Spoiler!

I tried to turn on the emissive lighting as its material has emmisive characteristics:
Spoiler!

The Meshes Material has a "Switch Param" 'Light off/on' variable:
Spoiler!

I selected this variable in the meshes MaterialInstance here:
Spoiler!


But no matter what I try, I cannot get this material's emissive material to show in the SDK or PIE. I tried editing the material to remove the Switch Param and have it just show Emissive all the time, but this did not work either. The UDK forums mention these params and supposedly by selecting the switch in the MaterialInstance settings, it should activate. Has anyone had any luck or tried anything like this before. I am complete Material Noob when it comes to UDK so Im sure I am missing something obvious.
 

Twrecks

Active member
Dec 28, 2011
1,241
10
38
Ventura, California
If you edit stock Materials or MIC's, you will either break compatability with the rest of the RO2 world running original versions. or it simply will not take (as soon as you close the Mesh/MIC it will default back to stock).

Right click the MIC in the browser and "make a copy" with a new name to your map package. Edit it, apply it to a mesh, and save your map. May require a rebuild to see the results.

I think I did a few lights in Yakovlevo CA this way, one in the Allied Kitchen spawn over the map table, and the bomb proof lights in Night Witch field's bunkers.
 

nymets1104

Active member
Dec 18, 2012
2,432
24
38
USA
If you edit stock Materials or MIC's, you will either break compatability with the rest of the RO2 world running original versions. or it simply will not take (as soon as you close the Mesh/MIC it will default back to stock).

Right click the MIC in the browser and "make a copy" with a new name to your map package. Edit it, apply it to a mesh, and save your map. May require a rebuild to see the results.

I think I did a few lights in Yakovlevo CA this way, one in the Allied Kitchen spawn over the map table, and the bomb proof lights in Night Witch field's bunkers.

Grrat, will check this out, Thanks!
 

dibbler67

FNG / Fresh Meat
Sep 4, 2011
654
6
0
Texas
It's important to note that the Static Switch Parameter is used at (shader) compile time and nowhere else. Therefore you must derive a new MaterialInstanceConstant from a Material using this parameter for each possible setting (the setting on the Material cannot be changed dynamically, you can only swap out Materials or MICs) that you plan on using.

MICs that have existing Materials as parents should give you no trouble as long as you've made new ones or copied old ones to a new package as Twrecks says. If you want to create an entirely new Material - that's tricky but possible for mods; I don't know about maps.
 

nymets1104

Active member
Dec 18, 2012
2,432
24
38
USA
Well I found where Twrecks got this working in Yakovlevo_CA, but I am beginning to think that the Parent Material I am using doesn't allow this. When in lit mode and in the MIC settings for the kitchen light in Yakovlevo_CA, when I switch on the parameter, it literally turns on the light if in lit mode. This is not the case with the street lamp material that I am using. I copied it to my package and same thing.

Now while playing last night I noticed that StalingradKessel had the street lamps illuminated. Opened the SDK and saw how they did it..they cheated! The used on of the emmisive light static meshes and nested it inside of the street lamp, attaching a spotlight actor to it also. So I copied this approach and gave up on this material. I did learn quite a bit about MICs though!

light.PNG