Elvas Tower: Shader (*.FX-files) syntax. - Elvas Tower

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Shader (*.FX-files) syntax. Is there any tutorial/samples? Rate Topic: -----

#1 User is offline   Weter 

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

Posted 28 March 2023 - 07:25 AM

Hello, ET mates.
During last half-month, I've learned a new for me thing, reading MG discussions.
It appears to be, that one can edit *.FX-files (not new idea, but now it captured me).

So the question: where can be found any information, how these files organized?

Thanks in advance.

#2 User is offline   wacampbell 

  • Member since Nov. 2003
  • Group: Fan: Traction Nuts
  • Posts: 2,345
  • Joined: 22-November 03
  • Gender:Male
  • Location:British Columbia, Canada
  • Country:

Posted 28 March 2023 - 08:45 AM

View PostWeter, on 28 March 2023 - 07:25 AM, said:

Hello, ET mates.
During last half-month, I've learned a new for me thing, reading MG discussions.
It appears to be, that one can edit *.FX-files (not new idea, but now it captured me).

So the question: where can be found any information, how these files organized?

Thanks in advance.


Just as a first step, the language used in the .FX files is called HLSL. Here's a reference:

https://learn.micros...x-graphics-hlsl

#3 User is offline   Weter 

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

Posted 28 March 2023 - 08:55 AM

Hello, Wayne.
Thanks. So it's a kind of program file.

#4 User is offline   wacampbell 

  • Member since Nov. 2003
  • Group: Fan: Traction Nuts
  • Posts: 2,345
  • Joined: 22-November 03
  • Gender:Male
  • Location:British Columbia, Canada
  • Country:

Posted 28 March 2023 - 11:42 AM

View PostWeter, on 28 March 2023 - 08:55 AM, said:

Hello, Wayne.
Thanks. So it's a kind of program file.


Yes, its a sequence of instructions to tell the GPU what to do for every pixel of your object.

eg for every pixel on the mesh,
- open a texture file
- look up the color that corresponds to the pixel I am drawing
- see if the color alpha is transparent
- if so skip the rest of the program
- look at the angle of the sun
- figure out how much the pixel should be brightened
- look at the shadow locations
- figure out how much the pixel should be darkened
- write the final pixel to the screen buffer

etc

#5 User is offline   Weter 

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

Posted 28 March 2023 - 11:51 AM

I'm going to try to research that.

Page 1 of 1
  • 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