Răsfoiți Sursa

Fix comments in chroma key example shader

tetrapod00 10 luni în urmă
părinte
comite
de7537a116
1 a modificat fișierele cu 7 adăugiri și 7 ștergeri
  1. 7 7
      tutorials/animation/playing_videos.rst

+ 7 - 7
tutorials/animation/playing_videos.rst

@@ -272,28 +272,28 @@ To implement the chroma key effect, follow these steps:
 
    shader_type canvas_item;
 
-   # Uniform variables for chroma key effect
+   // Uniform variables for chroma key effect
    uniform vec3 chroma_key_color : source_color = vec3(0.0, 1.0, 0.0);
    uniform float pickup_range : hint_range(0.0, 1.0) = 0.1;
    uniform float fade_amount : hint_range(0.0, 1.0) = 0.1;
 
    void fragment() {
-       # Get the color from the texture at the given UV coordinates
+       // Get the color from the texture at the given UV coordinates
        vec4 color = texture(TEXTURE, UV);
 
-       # Calculate the distance between the current color and the chroma key color
+       // Calculate the distance between the current color and the chroma key color
        float distance = length(color.rgb - chroma_key_color);
 
-       # If the distance is within the pickup range, discard the pixel
-       # the lesser the distance more likely the colors are
+       // If the distance is within the pickup range, discard the pixel
+       // the lesser the distance more likely the colors are
        if (distance <= pickup_range) {
            discard;
        }
 
-       # Calculate the fade factor based on the pickup range and fade amount
+       // Calculate the fade factor based on the pickup range and fade amount
        float fade_factor = smoothstep(pickup_range, pickup_range + fade_amount, distance);
 
-       # Set the output color with the original RGB values and the calculated fade factor
+       // Set the output color with the original RGB values and the calculated fade factor
        COLOR = vec4(color.rgb, fade_factor);
    }