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.
  • 8 Pages +
  • « First
  • 5
  • 6
  • 7
  • 8
  • You cannot start a new topic
  • You cannot reply to this topic

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

#91 User is offline   stormerdsr 

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

Posted 29 April 2026 - 07:51 AM

OK I increased strenght from 1 to 100. Now I have the following entry in gltf:

"extensions":{
"KHR_materials_emissive_strength":{
"emissiveStrength":100
}


Please watch the video after those changes:
https://fileditchfil...29_15-43-49.mp4

and please compare to previous video.
As for me everything looks very similar even if the light power is now a hundred times greater.


EDIT:
When you use strenght more than 1 in blender then

"extensions": { "KHR_materials_emissive_strength": { "emissiveStrength": 100.0 }

is automatically added by blender during export, but seems that this strenght does not have impact on glowing effect in OR.

#92 User is offline   gpz 

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

Posted 29 April 2026 - 11:32 AM

Ah, I remember now, for this to fully work, I need to change the rendertarget format from 8 bit byte to 16 bit float RGBA for these high dynamic range calculations to work properly, otherwise at some point it is clamped to 1 by the GPU no matter what. It is on my task list, just I forgot about that. Sorry for the confusion!

#93 User is offline   stormerdsr 

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

Posted 12 May 2026 - 08:14 AM

Is there a chance that you implement this 16 bit float precision for glowing soon? I'm ready for testing.
Thank you,

#94 User is offline   Weter 

  • Member, Board of Directors
  • PipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin Group
  • Posts: 9,678
  • Joined: 01-June 20
  • Gender:Not Telling
  • Simulator:ORTS
  • Country:

Posted 29 May 2026 - 08:09 PM

Hello, stormerdsr. Welcome to ET. Please, try to use [code] tags.
this would preserve all needed tabs and highlight code samples, You are posting.
You can look back to this Your post: how it looks on the page, then - You can enter Editing (by the button at the post's bottom), to see, how the syntax is done.

#95 User is offline   RailVeda 

  • Apprentice
  • Group: Posts: Dispatcher
  • Posts: 17
  • Joined: 14-February 18
  • Gender:Male
  • Location:INDIA
  • Simulator:MSTS/OR
  • Country:

Posted 02 July 2026 - 02:15 AM

View Postgpz, on 29 April 2026 - 11:32 AM, said:

Ah, I remember now, for this to fully work, I need to change the rendertarget format from 8 bit byte to 16 bit float RGBA for these high dynamic range calculations to work properly, otherwise at some point it is clamped to 1 by the GPU no matter what. It is on my task list, just I forgot about that. Sorry for the confusion!

I've been trying to get this working for quite some time now, but despite many tests and experiments, I haven't been able to find a solution.
I'm experimenting with the new KHR_lights_punctual support in the latest OpenRails unstable build and I've run into a problem that I can't explain.
I created a simple street light model in Blender 4.4 and exported it as glTF. The model contains:
  • A single mesh (street light pole)
  • One Spot Light (KHR_lights_punctual)
  • Standard PNG texture (no PBR textures)
  • Emissive material for the lamp
  • Light and mesh exported in the same glTF file

What works
  • The object loads correctly in OpenRails.
  • The Spot Light is active.
  • The light illuminates terrain and nearby objects.
  • The emissive material works correctly.

What does not work

  • The Spot Light does not illuminate the mesh that belongs to the same glTF model. For example, the ground below the lamp is illuminated correctly, but the lamp housing and the pole itself remain unaffected by the light emitted from that lamp.
  • The emissive material is visible during daytime as well. I was expecting the emissive effect to appear only at night, but it remains active throughout the day. I'm not sure if this is the expected behavior or if there's a recommended way to control emissive visibility based on the day/night cycle.


For example, the lamp illuminates the ground, but the lamp housing and the pole remain unaffected by their own light.

What I have already tested
  • Different light intensities.
  • Different Spot Light cone angles.
  • Moving the light slightly away from the mesh.
  • Different light positions.
  • Emissive enabled/disabled.
  • Simplified the model to a single material.
  • Verified normals are exported correctly.
  • Exported directly from Blender without any intermediate conversion.
  • Tried different glTF structures and parenting (mesh/light under a common parent).

In Blender, the exact same light correctly illuminates the pole, so the light placement itself appears to be correct.

My question

Is this the expected behavior of the current KHR_lights_punctual implementation?
Can a punctual light illuminate the mesh contained in the same glTF asset, or is there any additional requirement that I may be missing (material settings, export options, node hierarchy, etc.)?
If anyone has a working example where a KHR_lights_punctual light illuminates its own mesh, I would appreciate any guidance or example.

Any guidance or suggestions would be greatly appreciated. Your advice would be very helpful in understanding what I might be doing wrong. Thank you in advance for your time and assistance!

#96 User is offline   ermel17 

  • Apprentice
  • Group: Posts: Dispatcher
  • Posts: 11
  • Joined: 26-March 15
  • Gender:Male
  • Simulator:msts
  • Country:

Posted Yesterday, 11:46 PM

Hello, I am creating lines, as well as many streets, quays, and other objects that require light textures. Could you please provide a file or a tutorial? I read that it works using a .S file, but where do I put the code mentioned in this post? I tried the method involving the REF and .W files, but I don't quite grasp the concept, and no lights are appearing. Any help would be greatly appreciated, as it could take our simulator to a whole new level.
Thanks,
Eric

#97 User is offline   scottb613 

  • Executive Vice President
  • Group: Status: First Class
  • Posts: 3,370
  • Joined: 06-July 09
  • Gender:Male
  • Location:Downeast Maine (soon)
  • Simulator:ORTS
  • Country:

Posted Today, 05:31 AM

Hi Folks,

Wow - this is a GAME CHANGER.

The old single light source was one reason I never ran at night. Meeting an AI without a light source - shattered the illusion.

The loco and streetlamps are all GLB. My streetlamp's mesh is catching the light.

Well done - gentlemen.


https://i.postimg.cc/ZYyyTh7X/2026-10-05-19-42-09-Greenshot.png



Regards,
Scott

#98 User is offline   JordySmeets 

  • Hostler
  • Group: Posts: Active Member
  • Posts: 77
  • Joined: 23-June 15
  • Simulator:Open Rails
  • Country:

Posted Today, 06:27 AM

This is also a feature now? Damnit alot of work to be done to get my route up to date now... Someone has an example route for me to check upon?

#99 User is offline   prodigy 

  • Fireman
  • Group: Posts: Active Member
  • Posts: 173
  • Joined: 15-July 24
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted Today, 06:34 AM

It's a promising feature, but I've re-read the whole thread and I still don't quite understand how to implement it in the game.

#100 User is offline   scottb613 

  • Executive Vice President
  • Group: Status: First Class
  • Posts: 3,370
  • Joined: 06-July 09
  • Gender:Male
  • Location:Downeast Maine (soon)
  • Simulator:ORTS
  • Country:

Posted Today, 06:37 AM

Hi Folks,

My example Blender source and working GLB model.


DOWNLOAD:
Attached File  SCOstreetlamp.zip (117.45K)
Number of downloads: 15


Regards,
Scott

#101 User is offline   ermel17 

  • Apprentice
  • Group: Posts: Dispatcher
  • Posts: 11
  • Joined: 26-March 15
  • Gender:Male
  • Simulator:msts
  • Country:

Posted Today, 08:04 AM

View Postscottb613, on 06 October 2026 - 06:37 AM, said:

Hi Folks,

My example Blender source and working GLB model.


DOWNLOAD:
SCOstreetlamp.zip


Regards,
Scott

hi
Where should I put this file in my route? And how? As a shape? In the shapes folder?

#102 User is offline   scottb613 

  • Executive Vice President
  • Group: Status: First Class
  • Posts: 3,370
  • Joined: 06-July 09
  • Gender:Male
  • Location:Downeast Maine (soon)
  • Simulator:ORTS
  • Country:

Posted Today, 09:13 AM

View Postermel17, on 06 October 2026 - 08:04 AM, said:

hi
Where should I put this file in my route? And how? As a shape? In the shapes folder?


Hi...

It's just a model - the textures are embedded in the model - so yes - copy to shapes and make a ref entry so you can place it.


Hi Folks,

FYI: What we really need is more light switch controls on locomotives - to control these new light sources.

Regards,
Scott

#103 User is offline   goku 

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

Posted Today, 10:33 AM

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.

SD file is actually the proper place to put lights, not S file. Usually a game engine uses those small files/data sets to load them all at once to collect information about scene object bounds / view spheres / lights. A light may be seen from a very far distance, where object and it's large S / GLB file should not be loaded yet. MSTS uses this for view spheres, modern engine would benefit for lights, but rendering far lights require deferred renderer.

#104 User is offline   pwillard 

  • Foreman Of Engines
  • Group: Posts: Contributing Member
  • Posts: 976
  • Joined: 03-March 08
  • Gender:Male
  • Location:Cumming, Ga
  • Simulator:OpenRails
  • Country:

Posted Today, 10:43 AM

Quote

Are we sure he's not a bot? The code seems AI-generated, and also the comments in the PR have the style of LLMs.


Ok, what is your point? AI generally doesn't create bad code these days. Does this feature work and not create more problems than it solves? What does it matter how the code was developed if it actually works?

#105 User is offline   goku 

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

Posted Today, 10:50 AM

View Postpwillard, on 06 October 2026 - 10:43 AM, said:

Ok, what is your point? AI generally doesn't create bad code these days. Does this feature work and not create more problems than it solves? What does it matter how the code was developed if it actually works?

There is difference between AI assisted code and Bot activity. Imagine that code is indeed great, but issues surfaced. A human you can contact, a bot is usually unreachable. You can of course ask an agent for review/fix yourself, but that cost real money. Anyway, this is unrelated topic.

  • 8 Pages +
  • « First
  • 5
  • 6
  • 7
  • 8
  • 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