How to make an object "pulse" a color
by Brady · in Technical Issues · 08/27/2008 (2:53 pm) · 4 replies
I try to keep my questions few by searching thoroughly before asking, but this time I've been unable to find an answer to this question.
I want the player to be able to mouse over some specialized objects I have on the landscape, and when their mouse passes over an object, I have a special "outline" mesh I've created for that object that I want to change color and pulse to indicate that this is the one the user is selecting. I've got all the mouse picking, etc, done, but what I can't figure out is how to colorize the "outline" mesh and make it pulse a particular color. I've tried adjusting the "customAmbientLighting" which colorizes the mesh, but doesn't get bright enough (I want absolute bright green, like 0,255,0), and beside that, if I try to modify the lighitng value in script, it doesn't get updated on-screen unless I go into the world editor and manipulate to the object in some way to make it update its state.
I've also tried making the object as an item and using a pulsing light, but that didn't work at all.
This is such a simple thing that I can't believe I'm having such a hard time figuring out how to do it. Can anybody lend me some guidance? Thanks!
I want the player to be able to mouse over some specialized objects I have on the landscape, and when their mouse passes over an object, I have a special "outline" mesh I've created for that object that I want to change color and pulse to indicate that this is the one the user is selecting. I've got all the mouse picking, etc, done, but what I can't figure out is how to colorize the "outline" mesh and make it pulse a particular color. I've tried adjusting the "customAmbientLighting" which colorizes the mesh, but doesn't get bright enough (I want absolute bright green, like 0,255,0), and beside that, if I try to modify the lighitng value in script, it doesn't get updated on-screen unless I go into the world editor and manipulate to the object in some way to make it update its state.
I've also tried making the object as an item and using a pulsing light, but that didn't work at all.
This is such a simple thing that I can't believe I'm having such a hard time figuring out how to do it. Can anybody lend me some guidance? Thanks!
About the author
#2
Instead of trying to do it with script/code and or changing the "customAmbientLighting" I would try a more simple way of doing it. Go back to the mesh.. add some animated textures. I don't have the time to explain in detail. What I can do is point you in the right direction.
On the winki site. Search for " Seting up flash" "IFL" "Self Illumination" "Setting up glow"
All under "DTS/3dsmax/Advanced Materials"
All found on this page... tdn.garagegames.com/wiki/DTS/3dsmax/Advanced_Materials#IFL
look for the glowing and flashing Power up. This should help you figure a way to make a pulse around your select model (mesh)
IFL - Image file List Should be able to get the pulse your looking for. All the code you have now should work fine with the new mesh with animated textures.
Or attach a pulse light to the model. <---- resource hog!
GL, Hope this helps.
Freeze
08/27/2008 (6:00 pm)
Brady - Instead of trying to do it with script/code and or changing the "customAmbientLighting" I would try a more simple way of doing it. Go back to the mesh.. add some animated textures. I don't have the time to explain in detail. What I can do is point you in the right direction.
On the winki site. Search for " Seting up flash" "IFL" "Self Illumination" "Setting up glow"
All under "DTS/3dsmax/Advanced Materials"
All found on this page... tdn.garagegames.com/wiki/DTS/3dsmax/Advanced_Materials#IFL
look for the glowing and flashing Power up. This should help you figure a way to make a pulse around your select model (mesh)
IFL - Image file List Should be able to get the pulse your looking for. All the code you have now should work fine with the new mesh with animated textures.
Or attach a pulse light to the model. <---- resource hog!
GL, Hope this helps.
Freeze
#3
User Interface designers should be aware of health guidelines in this regard.
I don't have a good reference off hand.
www.epilepsy.org.uk/info/photo_web.html
Basically: small areas only, not bright, avoid the most dangerous frequency range (research it), and allow the user to control or turn off the effect (accessibility).
08/27/2008 (6:11 pm)
Be careful about having large areas of the screen flash. Some of your customers may be susceptible to blinking widgets. User Interface designers should be aware of health guidelines in this regard.
I don't have a good reference off hand.
www.epilepsy.org.uk/info/photo_web.html
Basically: small areas only, not bright, avoid the most dangerous frequency range (research it), and allow the user to control or turn off the effect (accessibility).
#4
@James
Yes, I had read some passing references to dglModulateBitmap (I think it was). I've already done some heavy modification to the engine source for what I'm doing and was hoping to find a solution without re-writing some of the rendering code. But I guess if it's what I want to do, I've got to do what has to be done... Thanks for the input!
@Freeze
Thanks for the references. I had thought about using IFLs, but it seemed like an inefficient way to achieve a simple pulsating effect since for it to be smooth, it would have to involve somewhere around 30 textures (one per tick for an oscillation lasting 1 second) each of which were only a slight shade darker/lighter than the next. I figured there was a way to do this just through lighting or some other effect. I come from an OpenGL background and if I were writing it all myself, I'd just use glColor3f(), and I suppose I might still if it comes to having to modify the rendering code. But there may have been some pieces of info I missed at the wiki page you sent, so I'll give that another look before writing my own rendering code. I'll also give more consideration to using IFLs if you think that's a good solution. Thanks again, it is much appreciated!
@Matthew
Yes, large flashes at certain frequencies are not only annoying, but can be dangerous for some people. I think the range is somewhere around 15hz and involves large changes in brightness over large areas of the screen. I'm going for something pretty small and it won't be flashing, it will be slowly pulsing (somewhere around 1hz). But your word of caution is very well founded. It is indeed something everyone should keep in mind when designing their game.
08/27/2008 (7:41 pm)
Sorry, I completely forgot to mention this was for TGE (though I'm thinking heavily about moving to TGEA...maybe I'll decide at the Torque get-together after GDC Austin :-) ).@James
Yes, I had read some passing references to dglModulateBitmap (I think it was). I've already done some heavy modification to the engine source for what I'm doing and was hoping to find a solution without re-writing some of the rendering code. But I guess if it's what I want to do, I've got to do what has to be done... Thanks for the input!
@Freeze
Thanks for the references. I had thought about using IFLs, but it seemed like an inefficient way to achieve a simple pulsating effect since for it to be smooth, it would have to involve somewhere around 30 textures (one per tick for an oscillation lasting 1 second) each of which were only a slight shade darker/lighter than the next. I figured there was a way to do this just through lighting or some other effect. I come from an OpenGL background and if I were writing it all myself, I'd just use glColor3f(), and I suppose I might still if it comes to having to modify the rendering code. But there may have been some pieces of info I missed at the wiki page you sent, so I'll give that another look before writing my own rendering code. I'll also give more consideration to using IFLs if you think that's a good solution. Thanks again, it is much appreciated!
@Matthew
Yes, large flashes at certain frequencies are not only annoying, but can be dangerous for some people. I think the range is somewhere around 15hz and involves large changes in brightness over large areas of the screen. I'm going for something pretty small and it won't be flashing, it will be slowly pulsing (somewhere around 1hz). But your word of caution is very well founded. It is indeed something everyone should keep in mind when designing their game.
Associate James Ford
Sickhead Games