GLSL requires a decimal point on all floating-point literals
In GLSL (the GPU shading language), almost all numeric values are floating-point, and literals must include a decimal point to be valid. Writing 1 where 1. is expected causes a type error because 1 is an integer literal and GLSL is strictly typed. This trips up programmers coming from JavaScript, Python, or other loosely-typed languages where 1 and 1.0 are interchangeable. The fix is universal: always write 1., 0.5, 4. etc. in any GLSL shader context.
Examples
Wrong: float frequency = 4; (integer, type error). Correct: float frequency = 4.;. Wrong: gl_FragColor = vec4(1, 0, 0, 1); — Correct: vec4(1., 0., 0., 1.).
Assessment
Given the GLSL snippet float color = sin(time * 4);, identify the error and write the corrected version. Then explain why this error would not occur in JavaScript.