Skip to content

Fragment function showing texture without explicitly using it #7497

@Skyvastern

Description

@Skyvastern

Your Godot version:
Godot v4.0.3.stable

Issue description:
Under the Using TEXTURE built-in subheading, for the following example code -

void fragment(){
  //this shader will result in an all white rectangle
  COLOR.b = 1.0;
}

It says that it will show a white rectangle, without setting a texture. But in Godot, the texture still shows up, and color is added over it. So basically, the above code does the same thing as this -

void fragment(){
  COLOR = texture(TEXTURE, UV); //read from texture
  COLOR.b = 1.0; //set blue channel to 1.0
}

So I think either something is wrong in the docs, or something is wrong in Godot.

URL to the documentation page:
https://docs.godotengine.org/en/stable/tutorials/shaders/your_first_shader/your_first_2d_shader.html#using-texture-built-in

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:manualIssues and PRs related to the Manual/Tutorials section of the documentationbugtopic:shaders

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions