Author Topic: Lighting on trains  (Read 5130 times)

Megistos

  • Posts: 18
  • Turrets: +0/-0
Lighting on trains
« on: June 23, 2007, 07:16:00 pm »
Hi guys,


Is it possible to make the brushes in a func_train be illuminated by the light that's actually around them at the time? At the moment the train I have keeps exactly the same lighting as it spawns with, which looks quite out of place when it reaches its destination. Any way to avoid this?

benmachine

  • Posts: 915
  • Turrets: +99/-76
    • ben's machinery
Lighting on trains
« Reply #1 on: June 23, 2007, 08:47:20 pm »
Although this is not my field of expertise, I'd say it's unlikely you'll have any luck: as far as I know, there is no dynamic lighting in the Tremulous engine and lighting effects/shadows on map objects are (may as well be, at least) calculated at load (or maybe even at compile :O )
The lighting system in general for Tremulous has always seemed pretty poor to me, at any rate.
benmachine

DASPRiD

  • Administrator
  • Posts: 549
  • Turrets: +21/-2
    • http://www.dasprids.de
Lighting on trains
« Reply #2 on: June 23, 2007, 10:50:14 pm »
Not possible. Try to let it start in a light neutral area.
url=https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=mail%40dasprids%2ede&item_name=DASPRiD%27s&no_shipping=0&no_note=1&tax=0&currency_code=EUR&lc=DE&bn=PP%2dDonationsBF&charset=UTF%2d8][/url]

Taiyo.uk

  • Posts: 2309
  • Turrets: +222/-191
    • Haos Redro
Lighting on trains
« Reply #3 on: June 23, 2007, 11:11:39 pm »
Or maintain similar lighting conditions over the trains' range of travel.

kaziorvb

  • Posts: 234
  • Turrets: +19/-43
Lighting on trains
« Reply #4 on: June 24, 2007, 11:09:21 am »
you could be also a bit tricky - play with shaders like with _style-d lights (only if the train doesnt stop, and the lights are placed regularly, you could make a shader with regular light beams on a texture) - tho its hard and a bit pointless T_T
Signatures are displayed at the bottom of each post or personal message. BBCode and smileys may be used in your signature.

gareth

  • Posts: 710
  • Turrets: +38/-89
Lighting on trains
« Reply #5 on: June 24, 2007, 07:27:49 pm »
i mentioned this on irc a few days ago, then i didnt think it was possible without engine changes. however when i saw your post i did some more experiementation and found that it is possible - and it can look good but it is not easy to do at all.

first i tried using rgbgen lightingDiffuse on my lift brushes - this should provide a lighting value that is taken from lightgrid+dynamic lights (eg light from your gun). on brushes tho it is buggy as hell, it doesnt change smoothly or sometimes at all until you fire your gun or something wierd.

then i poked some more and found the the model2 key used to attach a model to a func_ results in the model having the kind of lighting that we want - nice smooth color changing.

so basically you need to convert your brushes to an md3 model and use the model2 key to attach it to your train (which will need clip brushes to define solid bits).

the hard bit is converting your brushes to an md3, if you find an easy way to do this let me know. :-?

DASPRiD

  • Administrator
  • Posts: 549
  • Turrets: +21/-2
    • http://www.dasprids.de
Lighting on trains
« Reply #6 on: June 25, 2007, 08:08:04 am »
Not needed, you can simply convert it to an ase model.
url=https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=mail%40dasprids%2ede&item_name=DASPRiD%27s&no_shipping=0&no_note=1&tax=0&currency_code=EUR&lc=DE&bn=PP%2dDonationsBF&charset=UTF%2d8][/url]

gareth

  • Posts: 710
  • Turrets: +38/-89
Lighting on trains
« Reply #7 on: June 25, 2007, 11:22:33 am »
it needs to be md3, ases just show the xyz axis lines where the model should be.

i did get my lift to md3 though, it doesnt look that great though, although it looks good changing color when it goes near lights, it is a bit too bright all the time, you could probably make it look a bit better by darkening it with a shader.

looks quite bad here.

[/img]

DASPRiD

  • Administrator
  • Posts: 549
  • Turrets: +21/-2
    • http://www.dasprids.de
Lighting on trains
« Reply #8 on: June 25, 2007, 11:35:29 am »
Nope, ASEs are model files.
url=https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=mail%40dasprids%2ede&item_name=DASPRiD%27s&no_shipping=0&no_note=1&tax=0&currency_code=EUR&lc=DE&bn=PP%2dDonationsBF&charset=UTF%2d8][/url]

gareth

  • Posts: 710
  • Turrets: +38/-89
Lighting on trains
« Reply #9 on: June 25, 2007, 06:12:34 pm »
Quote from: "DASPRiD"
Nope, ASEs are model files.


just try it. :P

.f0rqu3

  • Guest
Lighting on trains
« Reply #10 on: June 25, 2007, 06:34:41 pm »
afaik animated models are excluded from the tri-soup
so they receive generic light(vertex)

LinuxManMikeC

  • Posts: 125
  • Turrets: +0/-0
Lighting on trains
« Reply #11 on: June 25, 2007, 07:01:45 pm »
Quote from: "gareth"
it needs to be md3, ases just show the xyz axis lines where the model should be.

i did get my lift to md3 though, it doesnt look that great though, although it looks good changing color when it goes near lights, it is a bit too bright all the time, you could probably make it look a bit better by darkening it with a shader.

looks quite bad here.


I got an ASE to attach to a train just fine over here.  The catch is there are two different ways attach a model to a train.  The method you are probably using is setting the model2 key of the train entity.  I'm guessing this method only supports MD3 because it didn't work with my ASE (looked just the way you described).  However, if you load the ASE as a misc_model entity and have it target your train entity it will work.

And the screenshot doesn't look bad to me.
b]Embrace your inner penguin 8)
GtkRadiant Wiki (under construction)[/b]