This is the testing Godot forums! All forum posts unique to this forum will be deleted! Please use the main forums here for any posts you want to keep. All forum rules still apply.

How to keep texture when changing color effect.

stevepetoskeystevepetoskey Posts: 3Member

So when ever I change color using:
Func fragment() {
COLOR = vec4(1.0,0,0,0);
}
It gets rid of the texture that the sprite had, is there any way to make it add a color effect instead of set the color?


Tags :

Best Answer

  • SIsilicon28SIsilicon28 Posts: 693
    Accepted Answer

    Yes.

    COLOR = texture(TEXTURE, SCREEN_UV) * vec4(1.0, 0, 0, 1.0);
    

    The reason why you only see a solid color is because you're only assigning a constant color to it.

Answers

  • SIsilicon28SIsilicon28 Posts: 693Moderator
    Accepted Answer

    Yes.

    COLOR = texture(TEXTURE, SCREEN_UV) * vec4(1.0, 0, 0, 1.0);
    

    The reason why you only see a solid color is because you're only assigning a constant color to it.

  • stevepetoskeystevepetoskey Posts: 3Member

    Thank you

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.