GodOfAvacyn / gdshader-lsp

35 stars 2 forks source link

Lots of incorrect diagnostics #3

Open stevenctl opened 6 months ago

stevenctl commented 6 months ago

These are all from the same shader that works just fine in Godot 4.2 stable.

  1. invalid shader include directory
#include "./include/Triplanar.gdshaderinc"
  1. Invalid arguments for function 'textureLod' (also leads to Expected return type 'float')
float sampleHeight(vec2 uv) {
   return textureLod(heightmap, uv, 0).r * height_scale;
}
  1. Type mismatch: 'float' and 'vec3'.
vec3 colorRamp(float value) {
    // Define your color stops
    vec3 colors[32];
    colors[0] = vec3(0.0, 0.0, 0.5);    // Dark Blue
    colors[1] = vec3(1.0, 0.0, 0.0);    // Red
    colors[2] = vec3(0.0, 1.0, 0.0);    // Green
    colors[3] = vec3(1.0, 1.0, 0.0);    // Yellow
...
  1. Expected Expression (leads to `Identifier 'colors' is undefined.')
  const uint DEBUG_TEXTURES = uint(8);
  vec3 colors[DEBUG_TEXTURES];
  1. Function 'smoothstep' does not exist.
    smoothstep(0.0, 1.0, abs(dot(worldNormal, vec3(1.0, 0.0, 0.0)))),
GodOfAvacyn commented 5 months ago

Thanks for pointing these out. I'm in the middle of a full re-write right now, the new version should be working 100%. Give me another week or two and it'll be on!

DiedByDisgust commented 4 months ago

invalid args in constructors overloaders.

vec2 some_vec2 = vec2(1.0);
vec3 some_vec3 = vec3(some_vec2,1.0);
vec4 some_vec4 = vec4(some_vec2,some_vec2);
vec4 other_vec4 = vec4(some_vec3,1.0);

and so on...