Fragment Shader - Possible Bug?

Use this forum if you found a bug.
Post Reply
John
Posts: 6
Joined: 06 Jun 2019, 19:46
Hi Goku,
I recently installed OpenRails (Stable Version 1.3.1, runs fine with no issues) and am excited to use your TSRE5 app, but have encountered an error, as reported in the log file generated by your app:

"Declaration must include a precision qualifier or the default precision must have been previously declared. "

Upon opening any of my MSTS routes (default or other); or OpenRail specific routes (e.g. Great Zig Zag Railway - New South Wales) in TSRE5, the window that should display the route displays, instead, a number of "objects" that rapidly flicker between white & green (they are probably the objects in the game - track, trees, buildings, etc.)

I'm not a programmer, nor know anything about shaders, but a cursory examination of the TSRES5 log file suggests to me that the problem may be in the fragment shader (.fs) files: Shadow, StandardBloom & StandardFog.

Searching for "fragment shader precision" resulted in this webpage:
https://stackoverflow.com/questions/285 ... ent-shader

which states that:
"OpenGL ES Shading Language - 4. Variables and Types - pp. 35-36
The fragment language has no default precision qualifier for floating point types. Hence for float, floating point vector and matrix variable declarations, either the declaration must include a precision qualifier or the default float precision must have been previously declared."

I'm not sure if this information has any bearing on the error reported by TSRES5 or not, but may be of help to you.

Finally, thank you for providing your app to the OpenRails community. I hope the fix to the error is a simple one for you to fix :)

The following details hopefully will assist you in identifying the cause of the problem:

App version: TSRE5_v0.69751.exe 2019-05-28 11:22
App data: 0.697.tar 2019-05-26 21:19
Both files downloaded from http://koniec.org/tsre5/data/. Note that the issue also occurs with earlier builds (both x64 & x86) too.

PC & graphics card info copied from the log file for Open Rails:
--------------------------------------------------------------------------------
...
BIOS = BIOS Date: 08/31/09 13:56:34 Ver: 5.02 (American Megatrends Inc.)
Processor = AMD Phenom(tm) II X4 910 Processor (4 threads, 4 cores, 2.6 GHz)
(L1-Cache 512 KB) (L2-Cache 2048 KB) (L3-Cache 6144 KB)
Memory = 8.0 GB

Video = ATI Radeon HD 4350 (0.5 GB RAM) (atikmdag 8.1.1.909)
Display = \\.\DISPLAY1 (1360 x 768, 32-bit, primary, 0 x 0)
...
OS = Microsoft Windows 7 Home Premium 64-bit (6.1.7601)
Runtimes = 2.0.50727 SP2 3.0 SP2 3.5 SP1 4 Client 4 Full 4.0 Client
Runtime = 2.0.50727.5420 (32bit)

\\.\DISPLAY1 = ATI Radeon HD 4350 (atiumdag.dll 8.14.10.671)
Anisotropy = 16
Render Targets = 4
Streams = 16 (stride 508)
Textures = 8 (8192 x 8192, repeat 8192, ratio 8192)
Points = 256^2
Volumes = 8192^3
Primitives = 5592405
Vertexes = 16777215
Vertex Shader = 3.0 (32768 slots, 256 constants)
Pixel Shader = 3.0 (32768 slots)
Clip Planes = 6

TSRE5 log enclosed as an attachment.
log.zip
(4.66 KiB) Downloaded 363 times

User avatar
Goku
Site Admin
Posts: 363
Joined: 15 Jan 2019, 18:10
Location: Poland
Contact:
Are you sure that your GPU driver is updated?

If yes, try adding this line:
precision highp float;

in .fs files located in "./tsre_appdata/0.697/shaders" directory after "#version 130" line.

John1
Posts: 1
Joined: 13 Jun 2019, 19:12
Thanks Goku.
I have the latest GPU driver according to the manufacturers website (the graphics board is about 11 years old, and the drivers have not been updated by the manufacturer for about 9 years - they stopped supporting it years ago).
I'll try your suggestion & respond next week.

John
Posts: 6
Joined: 06 Jun 2019, 19:46
Hi Goku
I added the line to the three .fs shader files as you suggested. The visible result is the same (see attached screenshot). The logfile is attached. The error is the same for all three shaders:
[E] QOpenGLShader::compile(Fragment): Fragment shader failed to compile with the following errors:
ERROR: 3:1: 'float' : syntax error parse error
ERROR: compilation errors. No code generated.

[E] *** Problematic Fragment shader source code ***
[E] #version 130
#define lowp
#define mediump
#define highp
#line 2
precision highp float;
...

FYI, the ATI Catalyst control center reports the following for my graphics card:
Hardware:
Graphics Card Manufacturer ATI
Graphics Chipset ATI Radeon HD 4350
Device ID 954F
Vendor 1002
Subsystem ID 1613
Subsystem Vendor ID 1462
Graphics Bus Capability PCI Express 2.0
Maximum Bus Setting PCI Express 2.0 x2
BIOS Version 011.015.000.012
BIOS Part Number 113-AB80200-107-MI
BIOS Date 2009/06/24
Memory Size 3579 MB
Memory Type HyperMemory
Core Clock in MHz 600 MHz
Memory Clock in MHz 500 MHz

Software:
Driver Packaging Version 8.62-090520m1-085634C-HP
Provider ATI Technologies Inc.
2D Driver Version 8.01.01.909
2D Driver File Path /REGISTRY/MACHINE/SYSTEM/ControlSet001/Control/CLASS/{4D36E968-E325-11CE-BFC1-08002BE10318}/0000
Direct3D Version 8.14.10.0671
OpenGL Version 6.14.10.8673
Catalyst
Control Center Version 2009.0520.1631.27815

Regards, John
Attachments
TSRE-5 Upload 06-19.zip
(272.41 KiB) Downloaded 349 times

User avatar
Goku
Site Admin
Posts: 363
Joined: 15 Jan 2019, 18:10
Location: Poland
Contact:
Hm, maybe remove this "float" word.

John
Posts: 6
Joined: 06 Jun 2019, 19:46
OK, I'll try that...

John
Posts: 6
Joined: 06 Jun 2019, 19:46
Hi Goku.
Your suggestion did not make any difference to display (i.e., it is the same as previously reported). From the log file (attached):

[E] QOpenGLShader::compile(Fragment): Fragment shader failed to compile with the following errors:
ERROR: 3:1: ';' : syntax error parse error
ERROR: compilation errors. No code generated.
[E] *** Problematic Fragment shader source code ***
[E] #version 130
#define lowp
#define mediump
#define highp
#line 2
precision highp;
...
Attachments
TSRE-5 Upload 07-03.zip
(4.71 KiB) Downloaded 344 times

John
Posts: 6
Joined: 06 Jun 2019, 19:46
Hi Goku,
A small request with regards to your TSRE Update v0.69752.exe (viewtopic.php?f=4&t=13):

You say "... TSRE will automatically download required data. ...Make sure that TSRE has access to the internet...."

True, if your PC has access to the Internet. However, for those like myself that live in areas without internet access (I have to use a publicly available PC in a library & download files to a USB drive), it would be useful if the post included a list of all the dependancies for TSRE, so users could download these & install them before running TSRE. Your post mentions the openAL lib, which I have, but it occurs to me that I might not have installed one or more of any other dependancies, which might be causing the error that I'm seeing.

Just a thought...
regards, john.

User avatar
Goku
Site Admin
Posts: 363
Joined: 15 Jan 2019, 18:10
Location: Poland
Contact:
TSRE downloads only one appdata file from this location:
http://koniec.org/tsre5/data/appdata/?C=M;O=D
Current appdata file is this one:
http://koniec.org/tsre5/data/appdata/0.697.tar

John
Posts: 6
Joined: 06 Jun 2019, 19:46
Thanks for that info. I've already downloaded the appdata files, so i don't think that was the problem, but it is good to know that there are no other dependancies.

Post Reply