GodOfAvacyn / gdshader-lsp

29 stars 0 forks source link

Lots of incorrect diagnostics #3

Open stevenctl opened 3 weeks ago

stevenctl commented 3 weeks 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 1 week 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!