Page 1 of 1

Headlight Idea for locos

Unread postPosted: Fri Mar 30, 2012 6:39 am
by SCLALINE
Hey all,

was playing with my signals and the shader trainemissiveglow.fx - and it occurred to me this might be applicable to creating super super bright headlights,
the concept is to create light discs starting the size of the headlight and progressing in size till the disc is big enough to be seen far off,each disc has a progressively farther LOD the effect on my signals is dramatic
my glow texture with alpha
greenglow.jpg

the emissive is a simple white texture, which can be greyed down to make it less bright

the result
Screenshot_CSX A Line Jacksonville Division_29.74540--81.64203_00-01-18.jpg


worth a shot and larger discs could be added to make it brighter farther off

Re: Headlight Idea for locos

Unread postPosted: Fri Mar 30, 2012 8:36 am
by Machinist
Nice one! When TS2012 was published I posted something about headlights on models: should have a halo larger than the disc (even when seen close to the loco), projecting rays (with alpha channel) and also have a sort of 3D effect (maybe joining two different objects?!). A signal is seen mostly from a frontal perspective so it can be likely 2D (as your first shot above), but headlights are often seen also from a lateral perspective (when trains is passing, for example on track view) so the halo and the rays must be projected forward also, not only to the sides (laterally). Sorry, I don't know how to explain this in English. !!**sorry**!! So here some MSTS shots:

Image

Image

Image

Image

Re: Headlight Idea for locos

Unread postPosted: Fri Mar 30, 2012 8:45 am
by Kali
If you're looking at them through a camera, sure :) The beam will light up any dust that's in the air, otherwise the only time you'll see it is when it hits something. Playing with a big torch is a good test ( also lets you check falloff, which can be a lot wider than it looks ).

That's a good idea tho SCA, although I still don't think that shader is bright enough for long distances. Also the problem with lodding it is that it will go through it's changing shape cycle repeatedly, which addatex certainly doesn't do.

Re: Headlight Idea for locos

Unread postPosted: Fri Mar 30, 2012 12:48 pm
by SCLALINE
at the largest disc i have it is extremely bright at 1K out Kali - actually i changed to a solid texture for both and it really brightened up

ill make a simple cube this weekend

Re: Headlight Idea for locos

Unread postPosted: Fri Mar 30, 2012 6:59 pm
by NS9030
This would be so cool to see done, that looked really cool from down the tracks at night! Looks real! Would it work with ditch lights though?

Re: Headlight Idea for locos

Unread postPosted: Fri Mar 30, 2012 7:05 pm
by SCLALINE
i just posted the idea, up to the loco builders to give it a go, i have other projects at the moment, just had the idea

Re: Headlight Idea for locos

Unread postPosted: Fri Mar 30, 2012 8:09 pm
by Kali
SCLALINE wrote:at the largest disc i have it is extremely bright at 1K out Kali - actually i changed to a solid texture for both and it really brightened up

ill make a simple cube this weekend


Mm, does it still do it's effect cycle when it swaps LOD? ie circle-star-fuzz ( or if you're going towards it it'd be fuzz-star-circle, anyway ).

Re: Headlight Idea for locos

Unread postPosted: Fri Mar 30, 2012 8:29 pm
by SCLALINE
yes thats what im takling about, if the discs progressively get larger as the LODs increase the effect is really cool and you can see the lights for a long way off with the effect

Re: Headlight Idea for locos

Unread postPosted: Fri Mar 30, 2012 8:38 pm
by SCLALINE
here are the 2 heads from quite a bit far out
Clipboard01.jpg

Re: Headlight Idea for locos

Unread postPosted: Sun Apr 01, 2012 12:49 am
by simer4
I like where this is going. Here in Winnipeg, most of the tracks are relatively flat, and can see very far away. You can tell when a train is coming on CP's Keewatin Sub from where I railfan, at least 5 minutes before it reaches you. Speed limit is 50 out of Winnipeg, 35 where I railfan, and 25 just past there. There is a nice big bright light off in the distance.

Re: Headlight Idea for locos

Unread postPosted: Sun Apr 01, 2012 1:53 am
by SCLALINE
i cannot take credit for the initial idea, SMMDigital does it with his signals, im just elaborating on it

Re: Headlight Idea for locos

Unread postPosted: Sun Apr 01, 2012 10:31 am
by eyein12
if you can pm an example, just so i can better understand what you did. i'll put it on my locos and give it a shot.

Re: Headlight Idea for locos

Unread postPosted: Sun Apr 01, 2012 11:41 am
by PapaXpress
Same here. I would like to see if I can apply it to my ditch and strobe lights.

Re: Headlight Idea for locos

Unread postPosted: Sun Apr 01, 2012 12:51 pm
by Machinist
Same here also !!*ok*!! !*salute*!

Re: Headlight Idea for locos

Unread postPosted: Sun Apr 01, 2012 3:22 pm
by SCLALINE
Ok here is an example, easier than pm'ing everyone
discs.jpg

now this one only goes up to 5 discs but you will need 9 the largest being 10M-20M, it takes alot of experimentation to get the right formula of disc size to LOD to make it flow correctly

each disc is a LOD of the parent light and as such it is important to ensure the pivot point of each disc lines up perfectly with the parent, or it wont show

so disc 1 is slightly larger then the headlight, disc 2 is slightly larger than disc 1 and so on, each disc i have made so far is about 10-20m farther in LOD than the previous up to 100M then i went to 100M to 500M then went to 2000M
for the light material use TrainEmissiveGlow.fx as the shader - the shader has a diffuse and emissive mask - the diffuse would be either RGB 255, 250, 244 or RGB 255, 241, 224 and the brightest emissive map would be 128x128 and white

you have to play with the disc size and LOD's the discs are basically a cylinder with all the side and back faces removed, leaving a forward facing disc

so here are the hard rules

The pivot points have to be lined up
each Disc is a child of the parent headlight alse they will always be lit up


discs2.jpg