0 votes

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 customvalue, change polygon color before the color is passed into the shader. https://github.com/ashwin-vbs/godot/commit/4f85210782669ab760b170a4bcc7532cc93deb90
2. Pass custom
value into shader, and based on that, modify frag_color. https://github.com/ashwin-vbs/godot/commit/cd7a6012f859b2b47a3e89968f705c2d8d329320

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?

Godot version 3.5
in Engine by (12 points)

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

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.