Unable to change shader behavior based on custom attribute

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ashwin.vbs

I am trying to add a custom attribute to polygon, which will affect its render output.
To test this code, I am trying to render a white polygon if attribute is > 0.1.

I have implemented two paths here.

  1. Based on custom_value, change polygon color before the color is passed into the shader. Attempt 1 · ashwin-vbs/godot@4f85210 · GitHub
  2. Pass custom_value into shader, and based on that, modify frag_color. Attempt 2 · ashwin-vbs/godot@cd7a601 · GitHub

The first method work - I clearly see the polygon rendered white.
The second method does not work. I dont see any polygon being rendered.

I am new to both glsl and godot internals, and am probably doing something wrong.
Could someone help me get the shader working please?

Is this translated visual shader ? If so, it would be much easier to read if You provided screenshots

Inces | 2023-01-10 14:02