ShaderMan
ShaderMan copied to clipboard
const float is always 0
Define should be used instead of const. Anything const seems to be always equal to 0 regardless of what you set it to.
Example:
const float MAX_TRACE_DISTANCE = 20.0;
const float INTERSECTION_PRECISION = 0.001;
const int NUM_OF_TRACE_STEPS = 100;
should be turned to
#define MAX_TRACE_DISTANCE 20.0
#define INTERSECTION_PRECISION 0.001
#define NUM_OF_TRACE_STEPS 100
thanks for reporting this Issue I will fix It but now you can use this:
add this regex to my code
Regex
const\s*(float|int)([^=]*)\=([^;]*)\;
Substitution
#define$2$3
https://regex101.com/