godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.42k stars 21.26k forks source link

Expected expression, found: QUESTION in Shader Editor #42756

Open KoBeWi opened 4 years ago

KoBeWi commented 4 years ago

Godot version:

3.2.3

Steps to reproduce:

  1. Create a shader with this code
    
    shader_type canvas_item;

void fragment() { COLOR = vec4(0, 0, 0, ); }


2.
![image](https://user-images.githubusercontent.com/2223172/95797289-6ec42f00-0cef-11eb-8a4d-3ada1bfe7c0c.png)

On master it says COMMA instead of QUESTION.
4x4x8 commented 3 years ago

Just edit vec4() to vec4(1,1,1,1)

Mini_tutorial: vec4(1 - Red, 1 - G,reen, 1 - Blue, 1 - Alpha )

And now we have vec4(1,1,1,1)

UPDATE1: Try the shader_type spatial;

Update2: don't, edit only vec4()

akien-mga commented 3 years ago

On master it says COMMA instead of QUESTION.

Now it also says "found: COMMA" in 3.4 RC 1.

But that seems wrong too I guess, what it should find is a closing parenthesis where it expected an expression. The overall formulation of the error could maybe also be improved, it's a bit abrupt. CC @Chaosus

Chaosus commented 3 years ago

Just a syntax error is good to replace it? eg shadertoy have that:

image