![]() |
|
|
#1 |
|
Registered User
Join Date: Jul. 17th, 2008
Posts: 7
|
Possible to change an mesh's texture in-game?
Hey everyone. So I'm just wondering if there's a way to change a texture on a mesh in-game, maybe through kismet? Perhaps for a lamp that has both "on" and "off" state texture maps.
|
|
|
|
|
|
#2 |
|
If by "texture" you mean Material, then yes. I did something like that for the core status screens in my recent warfare map. Apparently, it doesn't work for Static Meshes though, so you'll need to add your static mesh as an interp actor instead (and simply not have it move at all).
To actually change the material, you can do it easily in Kismet. Simply connect the trigger event node (whatever it is that you have triggering this change) to a "Set Material" node. (i.e. New Action->Actor->Set Material). Good Luck .
|
|
|
|
|
|
|
#3 |
|
Or, you can copy the mesh from the stock package into your own and change the material that way. That's what I did for the skydome in my Valhalla map.
You can find the instructions for copying the mesh in this tutorial. |
|
|
|
|
|
|
#4 |
|
Why would you need to copy the mesh from a stock package just to change the material?
What _N_ said is correct, and I have a tutorial on my website on triggering materials via Kismet if you need additional help. You dont need to make an all new lamp texture for the off state, you only need to disable the emissive to save memory. |
|
|
|
|
|
|
#5 |
|
|
|
|
|
#6 |
|
Oh wow, Hourences, your solution is much better than mine
. It gets rid of the need for those pesky inefficient interp actors (which I could never get to accept static lights). Do you know if there's any risk of there being one of those crazy texture-streaming artefacts (like a lower detail texture being used) if the texture was not previously used elsewhere in the map?
|
|
|
|
|
|
|
#7 |
|
you always have that risk, I wouldnt bother thinking about that for things like this.
|
|
|
|
|
|
|
#8 |
|
From what I recall, yes you can do it from kismet depending on your goals. If you want something to trigger it then it's definitively in Kismet that you're going to do it.
__________________
|
|
|
|
|
|
|
#9 |
|
Registered User
Join Date: Jul. 17th, 2008
Posts: 7
|
Thanks for all the information guys!
I can see how this would work now in kismet. However, Hourences suggested that I simply disable the emmisive channel instead. How would I go about doing that? |
|
|
|
|
|
#10 |
|
Yeah, I would suggest running through Hourence's tutorials on the material editor too
. You would probably just multiply the emissive channel stuff by solid black (0 times anything is still 0 afterall ).
|
|
|
|
|
|
|
#11 |
|
Registered User
Join Date: Jul. 17th, 2008
Posts: 7
|
Yes I know how to hook up and disable the emissive channel, my question is how would I trigger that with kismet... is there a way to target a specific channel in a single material or do I need two copies of the that material, one with the effect on and one with it off?
|
|
|
|
|
|
#12 |
|
http://www.hourences.com/book/tutori...dmaterials.htm
In this case I would not use another texture though, but I would work with VectorParam, and simply do a multiply with constant 1 vector on whats inputted on emissive, then changing that constant 1 vector from value 0.0 to 1.0 to toggle it on through kismet, or other way around for toggling it off... Saves texturespace. |
|
|
|
|
|
|
#13 |
|
Registered User
Join Date: Jul. 17th, 2008
Posts: 7
|
Very nice!! Thank you very much, this is exactly what I need to do here.
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|