How to make a police light?

  • Thread starter Johannes Rojola
  • Start date

Johannes Rojola

I searched a lot from different forums but couldn't find comprehensive help on this scenario.

I have a police light object on my car, and I would like to it have simple 2-frame animated texture (light off - light on) which cycles all the time.

I have basic gMotor tools on my 3ds Max, which have some options for animated textures there. But I don't know what to do... do I need a 3Dsimed too?

Bonus question, how hard would it be to toggle blinking police lights on when putting driving lights on?
 
Do you mean like a strobe or a rotating light?

For a strobe, set the animation to cycle, and set the sequence to something like, (0,0,0,0,0,0,0,0,0,1,) make a new material for each light and offset it a bit for each light, so it doesn't look square. just add an 0 to each new light material. Add 0's in to lengthen the frequency of the light coming on.
Do you know the basics of setting up a texture animation? If not, have a look at the samplecar max file and check out how the headlight glow animation is done. Its set the same, except it uses manual instead of cycle. You can find it at devs corner on rfactor.net in the 1st version of the tools.

And no, I don't think you can switch it on with the lights, because they are already an animation. But you can set it in the upgrades to have it enabled or disabled.
 
It's like maniak said, but if you really want them toggled with headlights there is a way in DirectX9 mode.


These are flares created with Shader Pack - all of them are rotating and only flash when they're facing the camera. This way you don't have to use animation.
So you could add these flares to HLGLO_PS or HLGLO_DS objects using my editor and set their type to "headlights". Then just make them rotate with equal speeds around vertical vector and give them random horizontal directions to start with.

Note thet this will work only in DirectX9 mode, but if that's enough for you you can give it a try.
 
Do you know the basics of setting up a texture animation? If not, have a look at the samplecar max file and check out how the headlight glow animation is done. Its set the same, except it uses manual instead of cycle. You can find it at devs corner on rfactor.net in the 1st version of the tools.

Ah no I don't even know these basics, never actually done this before. The sample car max-file didn't open correctly in my Max, it was complete mess. But I will try again if I get something out of it... Until then, my cop car wont have animated lights :D Seems like setting up driving lights and brake lights is also a quite complicated process...
 
Ah no I don't even know these basics, never actually done this before. The sample car max-file didn't open correctly in my Max, it was complete mess. But I will try again if I get something out of it... Until then, my cop car wont have animated lights :D Seems like setting up driving lights and brake lights is also a quite complicated process...

OK, I took a screenshot for you.
Taking into account that you have already made the mesh for the light glow.
In the mat editor, make a multisub material, then in the submaterial make it a gmotor material and give it a name, for this I will use hlglowa.
I have underlined what needs to be set.
Adjust the rate to speed it up, add 0's to the seq. to give it a strobe effect, the amount of 0 depends how frequent it turns on.



I dunno if you know how to use the GMT converter but incase you don't and to save you asking and waiting, I'll explain briefly.
Go to the GMT Converter, select the light mesh, click 'Get Selected' turn everything off except move, set you gmt output directory and press the 'Do' button next to 'Make Mesh File'
 
OK, I took a screenshot for you.
Taking into account that you have already made the mesh for the light glow.
In the mat editor, make a multisub material, then in the submaterial make it a gmotor material and give it a name, for this I will use hlglowa.
I have underlined what needs to be set.
Adjust the rate to speed it up, add 0's to the seq. to give it a strobe effect, the amount of 0 depends how frequent it turns on.



I dunno if you know how to use the GMT converter but incase you don't and to save you asking and waiting, I'll explain briefly.
Go to the GMT Converter, select the light mesh, click 'Get Selected' turn everything off except move, set you gmt output directory and press the 'Do' button next to 'Make Mesh File'

Thanks mianiak! That was exactly the help I would need :) I suppose the name of the material can be anything, or does it have to be a "hlglowa"? You never really know when material names do matter and when not...
 
Thanks mianiak! That was exactly the help I would need :) I suppose the name of the material can be anything, or does it have to be a "hlglowa"? You never really know when material names do matter and when not...

For what you want, the material name doesn't matter.
 
What about a quick tip about this fluffy grass from materialtool2?

:rolleyes:



It's like maniak said, but if you really want them toggled with headlights there is a way in DirectX9 mode.


These are flares created with Shader Pack - all of them are rotating and only flash when they're facing the camera. This way you don't have to use animation.
So you could add these flares to HLGLO_PS or HLGLO_DS objects using my editor and set their type to "headlights". Then just make them rotate with equal speeds around vertical vector and give them random horizontal directions to start with.

Note thet this will work only in DirectX9 mode, but if that's enough for you you can give it a try.
 
With new release, grass generator should be fully functional. I have my hands full with some new shaders now, but when I'm done it should be worth the waiting. It's possible that I'll skip 0.8 and release version 0.9 allready.
I couldn't release 0.8 without knowing I will be able to upgrade all these shaders to non-linear exposition in 0.9, so these two releases are practically connected.
 
Last edited:
With new release, grass generator should be fully functional. I have my hands full with some new shaders now, but when I'm done it should be worth the waiting. It's possible that I'll skip 0.8 and release version 0.9 allready.
I couldn't release 0.8 without knowing I will be able to upgrade all these shaders to non-linear exposition in 0.9, so these two releases are practically connected.

That's OK, I'm sure it will be worth to wait for. Your new shaders are providing a new life to the game. The default Gmotor2 shaders are lifeless in terms of lightining.
 

Back
Top