Skip to content

Shader error: function 'rand2D' is multiply defined

Summary

Fixing #37 (closed) seems to have either created another shader error or is causing a pre-existing error to present.

Steps to reproduce

  1. Install the latest version of 2024.1.1
  2. Launch with --log-level=debug and the C172P
  3. Observe the console output

What is the current bug behavior?

This bug doesn't create any overtly obvious graphics issues as far as I can tell, but does produce errors in the console.

What is the expected correct behavior?

No errors in the console pertaining to shaders.

Relevant logs and/or screenshots

  362.19 [WARN]:general   /builds/flightgear/fgmeta/flightgear/src/Main/ErrorReporter.cxx:267: Error:error-type-bad-data from error-missing-shader::Shader program errors: error: function `rand2D' is multiply defined


Shader sources:
	/home/joshua/Projects/FlightGear/fgdata/Shaders/tree-ALS-shadow.vert
	/home/joshua/Projects/FlightGear/fgdata/Shaders/noise.frag
	/home/joshua/Projects/FlightGear/fgdata/Shaders/cloud-shadowfunc.frag
	/home/joshua/Projects/FlightGear/fgdata/Shaders/tree-ALS-shadow.frag
	/home/joshua/Projects/FlightGear/fgdata/Shaders/secondary_lights.frag
	/home/joshua/Projects/FlightGear/fgdata/Shaders/hazes.frag
	/home/joshua/Projects/FlightGear/fgdata/Shaders/noise.frag
	/home/joshua/Projects/FlightGear/fgdata/Shaders/filters-ALS.frag

	/home/joshua/Projects/FlightGear/fgdata/Effects/tree.eff
  362.19 [WARN]:general   /builds/flightgear/fgmeta/flightgear/src/Main/ErrorReporter.cxx:267: Error:error-type-bad-data from error-missing-shader::Shader source errors: 0:91(5): warning: `alt' used uninitialized
0:93(10): warning: `alt' used uninitialized
0:95(14): warning: `alt' used uninitialized

System and version information

/sim/version/flightgear: 2024.1.1
/sim/version/simgear: 2024.1.1
/sim/version/openscenegraph: 3.6.5
/sim/version/build-id: none
/sim/version/build-number: 0
/sim/version/build-type: Release
/sim/version/revision: none
/sim/rendering/gl-vendor: AMD
/sim/rendering/gl-renderer: AMD Radeon RX 5700 XT (radeonsi, navi10, LLVM 19.1.7, DRM 3.59, 6.12.13-200.fc41.x86_64)
/sim/rendering/gl-version: 4.6 (Compatibility Profile) Mesa 24.3.4
/sim/rendering/gl-shading-language-version: 4.60
/sim/rendering/max-texture-size: 16384
/sim/rendering/depth-buffer-bits: 24

Occurring on Fedora 41

Possible fixes

(If you can, link to the line of code that might be responsible for the problem)

Edited by Joshua Murphy