can material properties be modified at run time?
by deepscratch · in Torque 3D Professional · 12/19/2010 (12:35 am) · 12 replies
hi all,
can an objects material be modified at run time?
what?
I need to have a value in the material change when a key is pressed, and restored when pressed again.
why?
my vehicles have working light switches, I want the vehicles dashboard material to become emissive when the lights are switched on, so you can see the speedometer at night.
I could mount a tiny spotlight in front of it, but that would be hugely wasteful.
is it possable? or maybe you have an idea to light up the dashboard in another way?
I'd love to hear it.
cheers
can an objects material be modified at run time?
what?
I need to have a value in the material change when a key is pressed, and restored when pressed again.
why?
my vehicles have working light switches, I want the vehicles dashboard material to become emissive when the lights are switched on, so you can see the speedometer at night.
I could mount a tiny spotlight in front of it, but that would be hugely wasteful.
is it possable? or maybe you have an idea to light up the dashboard in another way?
I'd love to hear it.
cheers
About the author
email me at medan121@gmail.com
Recent Threads
#4
Toggling features on the light material isn't going to work if you have more than one vehicle as the material is shared with other instances.
So i would investigate the 'reskin' resources which allow you to change the material assigned to your models.
12/20/2010 (9:13 pm)
What you really need is to reassign the material used by the lights.Toggling features on the light material isn't going to work if you have more than one vehicle as the material is shared with other instances.
So i would investigate the 'reskin' resources which allow you to change the material assigned to your models.
#5
I think that's probably going to be the best solution, been thinking about adding one, this is more reason too.
thanks.
12/20/2010 (10:00 pm)
@Tom,I think that's probably going to be the best solution, been thinking about adding one, this is more reason too.
thanks.
#7
I have implemented that, but to this day I cannot work out how to change the skins.
I gave up trying, I am probably missing something small, but the frustration of not getting it to work led me to dismiss the resource.
are you willing to walk me through getting it to work??
12/21/2010 (9:20 am)
@game4Rest,I have implemented that, but to this day I cannot work out how to change the skins.
I gave up trying, I am probably missing something small, but the frustration of not getting it to work led me to dismiss the resource.
are you willing to walk me through getting it to work??
#8
12/21/2010 (1:45 pm)
OK, let's check if I can help you. You can send me an email to zzleggam (at) gmail (dot) com.
#9
12/21/2010 (2:23 pm)
sent
#10
...wouldn't need the Source code change either...just a few pennies worth. Torque art can do some pretty tricky things! You can even have it 'fading' as it goes on/off.
To me; this could be handled with art...of course, you'd have to see and compare...but adding a light and moving it...no way!
I could probably do this quickly enough[but not the scripting for on/off toggle]; all I'd have to know is what you'd want the internal visibility animation named and how long, fading etc...and a copy of the working DTS file as it stood right now.
12/21/2010 (2:35 pm)
How about just having the art with a visibility animation??....and put a self-lighted material to the dashboard geometry? Might be quickest/easiest to get working on a per object basis[totally client side controlled effect{me tinks},less you want a 3rd party outside vehicle to view it??] Animate the visiblilty of the geometry on/off?? Would take up an animation Thread, but:...wouldn't need the Source code change either...just a few pennies worth. Torque art can do some pretty tricky things! You can even have it 'fading' as it goes on/off.
To me; this could be handled with art...of course, you'd have to see and compare...but adding a light and moving it...no way!
I could probably do this quickly enough[but not the scripting for on/off toggle]; all I'd have to know is what you'd want the internal visibility animation named and how long, fading etc...and a copy of the working DTS file as it stood right now.
#11
that too is a good solution,
unfortunately I'm not sure it will work here.
I have working dashboards with speedometer and fuel guages on them, and the effect I need is to be able to see the guages when driving at night.
of course this is only for whatever vehicle the player is in at any time.
after some thought, I may go with a tiny point light in the dash, they are not that heavy on the game, and one extra small one for this effect is ok.
if you think there is another way to achieve this, please do tell
12/21/2010 (6:49 pm)
@Rex,that too is a good solution,
unfortunately I'm not sure it will work here.
I have working dashboards with speedometer and fuel guages on them, and the effect I need is to be able to see the guages when driving at night.
of course this is only for whatever vehicle the player is in at any time.
after some thought, I may go with a tiny point light in the dash, they are not that heavy on the game, and one extra small one for this effect is ok.
if you think there is another way to achieve this, please do tell
#12
maybe it will work,
if I apply an extra texture,
with a 2 frame anim.
clear, and clear with emissive or glow.
12/21/2010 (6:56 pm)
thinking more,maybe it will work,
if I apply an extra texture,
with a 2 frame anim.
clear, and clear with emissive or glow.
Torque Owner deepscratch
DeepScratchStudios