Elvas Tower: Dynamic Spotlight Lighting - Elvas Tower

Jump to content

Posting Rules

All new threads will be started by members of the Open Rails team, Staff, and/or Admins. Existing threads started in other forums may get moved here when it makes sense to do so.

Once a thread is started any member may post replies to it.
  • 11 Pages +
  • 1
  • 2
  • 3
  • 4
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

Dynamic Spotlight Lighting First submission from a new contributor Rate Topic: -----

#16 User is offline   gpz 

  • Vice President
  • Group: Posts: Elite Member
  • Posts: 2,080
  • Joined: 27-October 12
  • Gender:Male
  • Location:Budapest
  • Simulator:OpenRails
  • Country:

Posted 05 April 2026 - 01:27 AM

Guys, in unstable the gltf approach is available. Please add a gltf object similar to the one in 3rd post of this thread to the route shapes folder and reference it from the .w file.

#17 User is offline   gdineshnathan 

  • Fireman
  • Group: Posts: Active Member
  • Posts: 121
  • Joined: 11-September 17
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 05 April 2026 - 05:01 AM

View Postgpz, on 05 April 2026 - 01:27 AM, said:

Guys, in unstable the gltf approach is available. Please add a gltf object similar to the one in 3rd post of this thread to the route shapes folder and reference it from the .w file.


I would like to try the spot light setting via gltf 2.0. As a preparation I would re-iterate the steps that I intend to do to test, please correct me/ add more to it if I am wrong @gpz

1. Create a .gltf object as similar to the post #3. For example, StreetLights.gltf
2. Copy, Paset StreetLights.gltf into /SHAPES folder of any route of choice
3. Find the .w file via Tsre? so it can be referenced
4. Open. w file and add a Static entry as below describing the position and Qdirection , VDbId? What should be these?


Static (
UiD ( 100 )
FileName ( StreetLight.gltf )
Position ( 0 5 0 )
QDirection ( 0 0 0 1 )
VDbId ( 4294967295 )
)

Thanks

Attached File(s)



#18 User is offline   gpz 

  • Vice President
  • Group: Posts: Elite Member
  • Posts: 2,080
  • Joined: 27-October 12
  • Gender:Male
  • Location:Budapest
  • Simulator:OpenRails
  • Country:

Posted 05 April 2026 - 06:04 AM

I think adding a new object to the .w file by hand editing it is only for the real experts. Non-experts are better to stick to replacing an existing .s file only.

#19 User is offline   adhi-aplha-mca 

  • Apprentice
  • Group: Status: Inactive
  • Posts: 3
  • Joined: 29-March 26
  • Gender:Male
  • Simulator:Openrails
  • Country:

Posted 05 April 2026 - 09:08 AM

Hey mates, good Morning!
I guess i have messed around pushing codes in my PR,
i will review it once. and do the push as soon as possible.

but its working fine on my end! it seems i have pushed old and wrong backup codes.
-thank you, Adhi
https://ibb.co/TB4wCbj3
https://ibb.co/4wY6TVtk

#20 User is offline   Guille592 

  • Conductor
  • Group: Posts: Active Member
  • Posts: 262
  • Joined: 25-November 12
  • Gender:Male
  • Simulator:MSTS, OR
  • Country:

Posted 05 April 2026 - 03:22 PM

View Postgpz, on 03 April 2026 - 10:02 AM, said:

There is no limit on them, if you reach a limit, then either there is a bug, or you are doing something wrong. On stormerdsr's video there are 5 or 6 lights at a time in the scene.


We tried adding lights for several platform lamps only being able to light 4 at a time, no more than that. When used in cars, it works as intended. Can someone confirm you can add more than 4 functional lights as streetlamps?

#21 User is offline   FS.E652 091 

  • Conductor
  • Group: Posts: Contributing Member
  • Posts: 460
  • Joined: 22-April 14
  • Gender:Male
  • Location:Sicily
  • Simulator:ORTS
  • Country:

Posted 05 April 2026 - 04:14 PM

View Postgdineshnathan, on 04 April 2026 - 10:42 PM, said:

\

I confirm the same. OR doesn't react with dynamic lighting after following the above steps. When I tried to build a version through OR_MG branch, the alpha's got blocked fully.
Then I compiled the developers branch feature/dynamic-lighting-system , the result remains as above.

@FS.E652 091 can you try over regular OpenRails and not the monogame version once?


Hello, i've tried also on the Standard XNA version and it doesn't work too..
at this point i think that or we need certains shader files to be put on the ORTS monogame folder or then i don't know the mechanism for make this work.. Hope for a response!!
Regards

#22 User is offline   stormerdsr 

  • Fireman
  • Group: Posts: Active Member
  • Posts: 149
  • Joined: 08-February 26
  • Gender:Male
  • Simulator:ORTS
  • Country:

Posted 06 April 2026 - 02:30 PM

https://ibb.co/0R5wVQgd

free camera rotation + lot of gltf's with spot - leads to exception.

EDIT:
When range for spotlight is decreased exception is not displayed (but this is not a solution).

#23 User is offline   gpz 

  • Vice President
  • Group: Posts: Elite Member
  • Posts: 2,080
  • Joined: 27-October 12
  • Gender:Male
  • Location:Budapest
  • Simulator:OpenRails
  • Country:

Posted 07 April 2026 - 11:44 AM

I've fixed the exception today, please test if it is allright.

Actually, I would be very curious how the count of light sources displayed affects performance (in FPS). If you guys would do a small stress test it would be interesting I believe. Though not much I could do to improve the situation probably, but would be still interesting. Note, I have added a line to show the actually active light sources onto the graphics debug HUD, last page.

#24 User is offline   stormerdsr 

  • Fireman
  • Group: Posts: Active Member
  • Posts: 149
  • Joined: 08-February 26
  • Gender:Male
  • Simulator:ORTS
  • Country:

Posted 07 April 2026 - 12:33 PM

https://files.catbox.moe/45ogjr.mp4
https://files.catbox.moe/ltg6cd.mp4

Looks like this is fixed now. Thank you.
I do not notice performance drop but night textures act strange compared to testing version (whole scene is much darker and street lights almost blackened).
I will do some performance testing tomorrow.

#25 User is online   James Ross 

  • Open Rails Developer
  • Group: Posts: Elite Member
  • Posts: 5,587
  • Joined: 30-June 10
  • Gender:Not Telling
  • Simulator:Open Rails
  • Country:

Posted 07 April 2026 - 12:46 PM

From reading this thread, it seems to me that there are only two reasonable routes forward here:

  • Do nothing and only provide lights via glTF models
  • Add support for lights in SD files (rendered by same code as glTF models)

Option 2 would provide a way to enhance existing content with real lights, a bit easier than creating and placing new light-only glTF objects, but it isn't clear if it is worth the trouble.

And I do not think anything more involved (e.g. new files, especially anything involving S files) is going to be worth it.

#26 User is offline   stormerdsr 

  • Fireman
  • Group: Posts: Active Member
  • Posts: 149
  • Joined: 08-February 26
  • Gender:Male
  • Simulator:ORTS
  • Country:

Posted 07 April 2026 - 01:00 PM

View PostJames Ross, on 07 April 2026 - 12:46 PM, said:

From reading this thread, it seems to me that there are only two reasonable routes forward here:

  • Do nothing and only provide lights via glTF models
  • Add support for lights in SD files (rendered by same code as glTF models)

Option 2 would provide a way to enhance existing content with real lights, a bit easier than creating and placing new light-only glTF objects, but it isn't clear if it is worth the trouble.

And I do not think anything more involved (e.g. new files, especially anything involving S files) is going to be worth it.


Both "routes" are proper for me, but option 2 looks like real deal ;)

EDIT:
Option 1 is also important because we can add a light directly from blender to the gltf model. So, both approaches are exciting ;)

#27 User is offline   gpz 

  • Vice President
  • Group: Posts: Elite Member
  • Posts: 2,080
  • Joined: 27-October 12
  • Gender:Male
  • Location:Budapest
  • Simulator:OpenRails
  • Country:

Posted 07 April 2026 - 02:21 PM

These highways look really cool! 🙂

#28 User is offline   FS.E652 091 

  • Conductor
  • Group: Posts: Contributing Member
  • Posts: 460
  • Joined: 22-April 14
  • Gender:Male
  • Location:Sicily
  • Simulator:ORTS
  • Country:

Posted 07 April 2026 - 06:07 PM

View Postgdineshnathan, on 05 April 2026 - 05:01 AM, said:

I would like to try the spot light setting via gltf 2.0. As a preparation I would re-iterate the steps that I intend to do to test, please correct me/ add more to it if I am wrong @gpz

1. Create a .gltf object as similar to the post #3. For example, StreetLights.gltf
2. Copy, Paset StreetLights.gltf into /SHAPES folder of any route of choice
3. Find the .w file via Tsre? so it can be referenced
4. Open. w file and add a Static entry as below describing the position and Qdirection , VDbId? What should be these?


Static (
UiD ( 100 )
FileName ( StreetLight.gltf )
Position ( 0 5 0 )
QDirection ( 0 0 0 1 )
VDbId ( 4294967295 )
)

Thanks


Why the World File replacement?

The creator of the function attached a simple .s file with the dynamic light template, so just insert it into the ref file and then position it via TSRE5.

Sorry for the question, but I'm really having trouble getting this to work!

#29 User is offline   gdineshnathan 

  • Fireman
  • Group: Posts: Active Member
  • Posts: 121
  • Joined: 11-September 17
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 07 April 2026 - 10:30 PM

View PostFS.E652 091, on 07 April 2026 - 06:07 PM, said:

Why the World File replacement?

The creator of the function attached a simple .s file with the dynamic light template, so just insert it into the ref file and then position it via TSRE5.

Sorry for the question, but I'm really having trouble getting this to work!


The post you quoted is to test out gLTF 2.0 feature. You're right, adding .ref entry with the .gltf object and placing the object as a regular .s file via TSRE5 route editor do place empty geometry in the scene.

Unfortunately for some reason unstable XNA didn't help me project the light. It would be interesting if I could get it working.

#30 User is offline   Kapitaen13 

  • Fireman
  • Group: Posts: Active Member
  • Posts: 234
  • Joined: 05-April 19
  • Gender:Male
  • Location:Binzen an der Kandertalbahn
  • Simulator:MSTS / OR
  • Country:

Posted 08 April 2026 - 12:17 AM

Tested with U2026.04.07-1207 2026-04-07 13:13:26
4 lights along the platform are activated. When first opened with Openrails, the image is very milky and blurry.

Attached Image: Trüb.jpg


Once you restart the activity without closing OpenRails, the picture becomes clear.

Attached Image: Normal.jpg


Unfortunately, only four lights are currently available in wFile. After activating the fifth light—the orange cube shown in the previous images—the lights turn off.

Attached Image: Aus.jpg


Jan

  • 11 Pages +
  • 1
  • 2
  • 3
  • 4
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users