Dynamic Spotlight Lighting First submission from a new contributor
#16
Posted 05 April 2026 - 01:27 AM
#17
Posted 05 April 2026 - 05:01 AM
gpz, on 05 April 2026 - 01:27 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
Attached File(s)
-
StreetLight.zip (508bytes)
Number of downloads: 73
#18
Posted 05 April 2026 - 06:04 AM
#19
Posted 05 April 2026 - 09:08 AM
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
Posted 05 April 2026 - 03:22 PM
gpz, on 03 April 2026 - 10:02 AM, said:
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
Posted 05 April 2026 - 04:14 PM
gdineshnathan, 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
Posted 06 April 2026 - 02:30 PM
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
Posted 07 April 2026 - 11:44 AM
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
Posted 07 April 2026 - 12:33 PM
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
Posted 07 April 2026 - 12:46 PM
- 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
Posted 07 April 2026 - 01:00 PM
James Ross, on 07 April 2026 - 12:46 PM, said:
- 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 ;)
#28
Posted 07 April 2026 - 06:07 PM
gdineshnathan, on 05 April 2026 - 05:01 AM, said:
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
Posted 07 April 2026 - 10:30 PM
FS.E652 091, on 07 April 2026 - 06:07 PM, said:
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
Posted 08 April 2026 - 12:17 AM
4 lights along the platform are activated. When first opened with Openrails, the image is very milky and blurry.
Once you restart the activity without closing OpenRails, the picture becomes clear.
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.
Jan

Log In
Register Now!
Help







