admin管理员组

文章数量:1289775

I was making a sky shader in Godot, but I encountered an error with the following code:

vec2 sky_uv = EYEDIR.xz / EYEDIR.y;
vec3 Clouds = texture(Cloud_texture, sky_uv * Cloud_scale * TIME * Cloud_Direction * 0.001).rgb = texture(Cloud_texture2, sky_uv * Cloud_scale * TIME * Cloud_Direction2 * 0.0058).rgb;
sky += Clouds;

The error is assignment to function. Can anyone tell me how to fix it?

I was making a sky shader in Godot, but I encountered an error with the following code:

vec2 sky_uv = EYEDIR.xz / EYEDIR.y;
vec3 Clouds = texture(Cloud_texture, sky_uv * Cloud_scale * TIME * Cloud_Direction * 0.001).rgb = texture(Cloud_texture2, sky_uv * Cloud_scale * TIME * Cloud_Direction2 * 0.0058).rgb;
sky += Clouds;

The error is assignment to function. Can anyone tell me how to fix it?

Share Improve this question edited Feb 25 at 16:50 President James K. Polk 42k28 gold badges109 silver badges145 bronze badges asked Feb 21 at 7:14 Sparsh VerencarSparsh Verencar 1 2
  • 1 The lack of proper code formatting makes it difficult for readers to help you. Please edit your question to format inline code properly and to use a code block for any code or error messages you have included. – zerocukor287 Commented Feb 21 at 14:46
  • Please provide the error code. – Jonathan F. Commented Feb 24 at 15:13
Add a comment  | 

1 Answer 1

Reset to default 1

This line causes the reported error (you can't assign values to functions):

vec3 Clouds = texture(...).rgb = texture(...).rgb;

I guess you erased a variable involved in the second assignment, like:

vec3 Clouds = texture(Cloud_texture, sky_uv * Cloud_scale * TIME * Cloud_Direction * 0.001).rgb;
vec3 Clouds2 = texture(Cloud_texture2, sky_uv * Cloud_scale * TIME * Cloud_Direction2 * 0.0058).rgb;

本文标签: godotHow can I fix the cloud shader error quotassignment to functionquotStack Overflow