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
  • 5
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

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

#31 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 08 April 2026 - 02:55 AM

Looks like where is a possibility of a bug, there will be a bug. Currently there is another bug too, that the shape in the .w file must be marked as animated in StaticFlags. I will work on lifting these unintended restrictions. Every piece of code must be written by blood. :-(

#32 User is offline   stormerdsr 

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

Posted 08 April 2026 - 03:06 AM

https://ibb.co/wZX68ytJ
https://ibb.co/6MzNfkX
https://ibb.co/nNfvyx3N
https://ibb.co/GfwDL80Q
https://ibb.co/mVXrx1Wt


There are some performance testing. My conclusion is that 8-12 lights do not affect performance at all, but displaying lights with full range on whole scene can reduce performance even about 90%. At the moment with this approach placing lights on huge stations where "tons" of lights must be activated on all platforms is hard to swallow ;)

And at the end the movie. Everything looks nice, but performance loss is not acceptable for everyday gaming.

https://files.catbox.moe/wb6odl.mp4

#33 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 08 April 2026 - 05:47 AM

Please also try to reduce the range. I think I forgot to include that parameter into my example, but if undefined, the range is infinite by default, thus will not be culled at distance.

See the spec here: https://github.com/K...ctual/README.md

If you model car traffic, add the lamps as emissive material, so they will be visible from distance, but will not eat up resources with trying to display active light cones.

EDIT, just for reference, here is a light with the range parameter added:
{
"asset": { "version": "2.0" },
"extensionsUsed": [ "KHR_lights_punctual" ],
"scenes": [ { "nodes": [0] } ],
"nodes": [ { "translation": [0, 5, 0], "rotation": [-0.7071, 0, 0, 0.7071], "extensions": { "KHR_lights_punctual": { "light": 0 } } } ],
"extensions": { "KHR_lights_punctual": { "lights": [ { "type": "spot", "range": 500.0, "color": [1.0, 0.9, 0.8], "intensity": 50.0, "spot": { "outerConeAngle": 1.5 } } ] } }
}


#34 User is offline   stormerdsr 

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

Posted 08 April 2026 - 06:56 AM

Yes I have used range parameter already and it helps to keep performance, but if you have for example a platform with 400 meters lenght and you set range for light of lamps for example to 50 meters, so only few lamps closest to the camera will light the platform. All rest of platform (~350 meters) will be flooded in darkness, unless you move camera forward.

#35 User is offline   Eldorado.Railroad 

  • Superintendant
  • Group: Posts: Elite Member
  • Posts: 1,048
  • Joined: 31-May 10
  • Gender:Male
  • Country:

Posted 08 April 2026 - 07:37 AM

 stormerdsr, on 08 April 2026 - 03:06 AM, said:

There are some performance testing. My conclusion is that 8-12 lights do not affect performance at all, but displaying lights with full range on whole scene can reduce performance even about 90%. At the moment with this approach placing lights on huge stations where "tons" of lights must be activated on all platforms is hard to swallow ;)

And at the end the movie. Everything looks nice, but performance loss is not acceptable for everyday gaming.


I am watching this play out with interest.

29-30 frames per second is not very good. I would think that you would try to stay closer to 60 frames per second. Can you post your openrails log file to see what hardware you are using?

Also this might be of interest in having more lights for other trains, AI, etc

Thanks,

Steve

#36 User is offline   stormerdsr 

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

Posted 08 April 2026 - 08:12 AM

 Eldorado.Railroad, on 08 April 2026 - 07:37 AM, said:

I am watching this play out with interest.

29-30 frames per second is not very good. I would think that you would try to stay closer to 60 frames per second. Can you post your openrails log file to see what hardware you are using?

Also this might be of interest in having more lights for other trains, AI, etc

Thanks,

Steve


I'm using core i5-12500 + rtx 3060 12GB VRAM on desktop computer, so this is a mid-range hardware.
Additionaly if you look on my screenshots you will notice, that at this location I have ~300FPS when lights are not used. When I enable lights for cars with 500 meters range, performance drops from ~300FPS to ~30FPS (about 90%). The problem will be when I start to use lights on high detailed stations where are thousands shapes per square and FPS like 80-90FPS. After adding full-range lights for these stations and take away 90% of performance from 80FPS, there will remain only about 10FPS :) In the nearest future I'm planning to test lights on large hight detailed stations to ensure if I'm right or not. Also I will appreciate feedback from other users about the performance when lot of lights is used on small areas like platforms.

#37 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 08 April 2026 - 11:58 AM

On your highway pictures and videos the car lights over 200 m do not add much to the visuals, I think, at least not when it is not looked from directly above. Yes, they are visible, but it would be a good compromise to limit them to 200 m. Instead emissive textures should be added as white and red lamps, from distance that would have a bigger visual impact.

#38 User is offline   Genma Saotome 

  • Owner Emeritus and Admin
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin Group
  • Posts: 15,934
  • Joined: 11-January 04
  • Gender:Male
  • Location:United States
  • Simulator:Open Rails
  • Country:

Posted 08 April 2026 - 12:59 PM

 gpz, on 05 April 2026 - 06:04 AM, said:

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.


I've been editing world files for 20 years. Noonbs should not do it but anyone who has placed an object and can find it in the .w file will be competent.

#39 User is offline   stormerdsr 

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

Posted 09 April 2026 - 03:05 AM

https://fileditchfil...09_10-49-54.mp4

Platform light test. All lights were attached in blender.


EDIT:
Unfortunately shadows of nearest objects do not react to this light source

#40 User is offline   Guille592 

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

Posted 09 April 2026 - 06:06 AM

 stormerdsr, on 09 April 2026 - 03:05 AM, said:

https://fileditchfil...09_10-49-54.mp4

Platform light test. All lights were attached in blender.


EDIT:
Unfortunately shadows of nearest objects do not react to this light source


So... How did you managed to have more than 4 lights at the same time? Could you please elaborate?

#41 User is offline   stormerdsr 

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

Posted 09 April 2026 - 08:39 AM

 Guille592, on 09 April 2026 - 06:06 AM, said:

So... How did you managed to have more than 4 lights at the same time? Could you please elaborate?


Eight lamps with light sources were exported from blender as one gltf model.

#42 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 09 April 2026 - 09:21 AM

 stormerdsr, on 09 April 2026 - 03:05 AM, said:

https://fileditchfil...09_10-49-54.mp4

Platform light test. All lights were attached in blender.

Wow, impressive, good to see the lights in use!

I will fix the 4-light limitation, just I didn't have time to set up a test case (boooring) for investigating what causes that.

#43 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 09 April 2026 - 09:39 AM

 Guille592, on 09 April 2026 - 06:06 AM, said:

So... How did you managed to have more than 4 lights at the same time? Could you please elaborate?

I have 9 individual lights lined up here...

Attached Image: Open Rails 2026-04-09 05-32-29.jpg

gpz provided the answer

 gpz, on 08 April 2026 - 02:55 AM, said:

.... that the shape in the .w file must be marked as animated in StaticFlags.........


StaticFlags ( 00080000 )

Jan

#44 User is offline   vapor3D 

  • Conductor
  • Group: Posts: Active Member
  • Posts: 389
  • Joined: 15-March 20
  • Gender:Male
  • Location:Barcelona, Catalunya
  • Simulator:Open Rails
  • Country:

Posted 09 April 2026 - 10:19 AM

I have no idea how to use this, but great job. Congratulations to the creator(s)! :clapping: :clapping: :clapping: :clapping: :clapping: :clapping: :clapping: :drinks:

#45 User is offline   goku 

  • Superintendant
  • Group: Posts: Elite Member
  • Posts: 1,938
  • Joined: 12-December 13
  • Gender:Male
  • Simulator:my own
  • Country:

Posted 09 April 2026 - 10:46 AM

 stormerdsr, on 08 April 2026 - 08:12 AM, said:

When I enable lights for cars with 500 meters range, performance drops from ~300FPS to ~30FPS (about 90%).

In other thread I told that without deferred rendering, there will be significant performance hit when a lot of the lights are in the scene.
But having 30-60 lights shouldn't have that big impact on cards like 3060.

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

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