3Dickulus / FragM

Derived from https://github.com/Syntopia/Fragmentarium/
GNU General Public License v3.0
344 stars 30 forks source link

glsl preprocessor directives not parsed #196

Open 3Dickulus opened 1 year ago

3Dickulus commented 1 year ago

Description glsl preprocessor directives #if #else #endif are not parsed by FragM when enclosing sliders on both sides of the conditional both sets of sliders will be created

To Reproduce

// creates 2 Zoom sliders

if VERSION >= 400

// Camera zoom uniform double Zoom; slider[1e-4,1,1e64] Logarithmic NotLockable

else

// Camera zoom uniform float Zoom; slider[1e-4,1,1e7] Logarithmic NotLockable

endif

// creates CenterX CenterY Center widgets

if VERSION >= 400

// Camera center X in high precision (quad-double) uniform dvec4 CenterX; slider[(-100,-100,-100,-100),(0,0,0,0),(100,100,100,100)] NotLockable // Camera center Y in high precision (quad-double) uniform dvec4 CenterY; slider[(-100,-100,-100,-100),(0,0,0,0),(100,100,100,100)] NotLockable const dvec4 CenterShift = dvec4(1.0, 1.1102230246251565e-16LF, 1.232595164407831e-32LF, 1.3684555315672042e-48LF);

else

// Camera center in single precision uniform vec2 Center; slider[(-100,-100),(0,0),(100,100)] NotLockable vec4 CenterX = vec4(Center.x, 0.0, 0.0, 0.0); vec4 CenterY = vec4(Center.y, 0.0, 0.0, 0.0);

endif

Expected behavior create the correct sliders when VERSION < 400 or VERSION >= 400 1 Zoom slider Center when < 400 or CenterX and CenterY when >= 400

Desktop: Vendor: NVIDIA Corporation Renderer: NVIDIA GeForce GTX 1650 SUPER/PCIe/SSE2 GL Driver: 4.5.0 NVIDIA 525.89.02 Display using GL 4.5 Core profile

Additional context