Shader Help?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By The_Duskitty
:warning: Old Version Published before Godot 3 was released.

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

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

Bojidar Marinov | 2016-03-11 16:49

:bust_in_silhouette: Reply From: rgrams

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;

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)

The_Duskitty | 2016-03-11 20:41

Ahh, makes sense.

rgrams | 2016-03-11 21:32

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?

The_Duskitty | 2016-03-11 21:37

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.

rgrams | 2016-03-12 13:40

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)

The_Duskitty | 2016-03-12 19:11