Elvas Tower: Why can't we have light cones for all trains in OpenRails? - Elvas Tower

Jump to content

  • 4 Pages +
  • « First
  • 2
  • 3
  • 4
  • You cannot start a new topic
  • You cannot reply to this topic

Why can't we have light cones for all trains in OpenRails? Rate Topic: -----

#31 User is offline   Genma Saotome 

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

Posted 19 February 2022 - 02:12 PM

 gpz, on 18 February 2022 - 12:44 AM, said:

During the rewriting of the lights handling code I noticed, that the current headlight shading is quite unrealistic. Let me show you two pictures for comparision. (I hope the pictures will appear for everyone.)

The original shader used
  • linear distance range attenuation (1 - distance / range), and
  • fully-lit pixels within the range (HLSL method step(0, projection) – means either 0 or 1), not counting the cone attenuation around the light cone edges.

http://www.kepfeltoltes.eu/images/2022/02/18/173Spot_linear_trim.png

In contrast, the PBR method for handling spot lights would be
  • inverse-squared distance range attenuation (1 / distance²), which is actually how the light attenuates in real world, and
  • proportionally lit pixels within the range, calculating how much the surface is perpendicular to the light direction (HLSL method clamp(projection, 0, 1) – means proportional within 0 and 1)

http://www.kepfeltoltes.eu/images/2022/02/18/466Spot_inverse_sqared_tr.png

Did you guys notice this, and what do you think about it?


It's very good Peter.

One of the problems w/ headlights is most .eng files have never updated the light cone definitions in their .eng files to work properly w/ OR. Not having the MSTS source code nobody could figure out what KUJU had actually done and so it was necessary to come up with our own solution. The change affected the radius and angle values. In OR radius describes the radius of the entire circle of light (it might be sphere but I don't recall). Angle describes how much of that will be visible as the headlight. If North American headlights are typical then the correct values to being using are ~ 1600m for radius and 4 for angle (a projection of about about a mile with a spread of 4 degrees on either side of the centerline. That's much further out and MUCH more narrow than what most people use. Your math changes should go a long way to diminishing the intensity of the outer degrees at distant points, which, IMO will be a very big improvement.

#32 User is offline   Jonatan 

  • Vice President
  • Group: Status: Elite Member
  • Posts: 2,662
  • Joined: 29-March 10
  • Gender:Male
  • Location:Somewhere.
  • Simulator:MSTS and Vehicle Simulator
  • Country:

Posted 03 August 2022 - 12:30 PM

What's the current status on this? Any progress towards implementation in the OR release?

#33 User is offline   R H Steele 

  • Executive Vice President
  • PipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 3,447
  • Joined: 14-March 13
  • Gender:Male
  • Location:known universe
  • Simulator:Open Rails
  • Country:

Posted 03 August 2022 - 08:28 PM

 Jonatan, on 03 August 2022 - 12:30 PM, said:

What's the current status on this? Any progress towards implementation in the OR release?

Perhaps reading this thread will provide an answer ( especially post #5 from Serana ) multiple light cones


  • 4 Pages +
  • « First
  • 2
  • 3
  • 4
  • 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