0 votes

Basically I need to Make a shader to merely add the Colour Changing Function (Ive messed with the demo for it)

Basically i Need a shader for objects that dont come with The "modulate" Option, all my efforts on trying to change the Silhouette look to be just a simple colour change than a solid colour have failed, could i have a bit of help?

Basically I need a shader to Add Colour Changing properties and act like the "Modulate" option on stuff like sprites but NOT Look like the silhouette demo thing

in Engine by (484 points)

Maybe you mean the "CanvasItemTexture" node in 2D fragment ShaderGraphs or the TEXTURE constant for 2D fragment Shaders (tex(TEXTURE, UV))?

1 Answer

+1 vote
Best answer

The TextureButton didn't work, huh?

Modulate is just a multiply, so all you have to do is:

uniform vec4 MyModulateColor;
COLOR = tex(TEXTURE, UV) * MyModulateColor;
by (532 points)
selected by

No the texture button did work, now im just tryng to find a way so i can tint stuff like Objects that dont have the Option for modulating (example The "LineEdit" Node)

Ahh, makes sense.

So i tried your method and it worked but didnt at the same time, the tint goes over the text to the point where the text becomes part of the colour, do you know how to possibly fix this?

Hmm, so it does. The material is applied to the whole CanvasItem. Sadly no, I don't know how to fix that.

I mean the way I'd expect to do this, is by changing the theme of the UI control. Buuut I looked into that, and while it's easy enough to change the style of the LineEdit's box, the only options are Empty, Flat, ImageMask, and Texture, none of which have both a texture and a material or a modulate color. So, short of making your own UI nodes or editing the C++ of the existing ones, I don't know.

So i decided to Just like, Make premade options, Rather than make a slider for this, So thanks for the help ^^ Also if you could, Could you tell me how one would edit styleboxes Via gd script? (like how to access them through a script)

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 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 webmaster@godotengine.org with your username.