add some galaxy effect in the backgound. no changes to the current cube and animation.
Okay, I can add a procedural galaxy effect to the background. This will involve creating a second shader program that draws a starfield and nebulae behind the rotating cube.
Here's how I'll approach it:
u_resolution and u_time uniforms to make it dynamic and responsive.Here's the updated code:
I dont see any changes.
You're right, my apologies. I missed a crucial gl.useProgram() call for the galaxy shader program in the render loop. Without it, the GPU wouldn't know which shader to use for drawing the background, and the uniforms wouldn't be set for the correct program.
I've added the missing gl.useProgram(galaxyProg) call. This should now correctly render the galaxy background behind the cube.
Here's the corrected code:
add much more of stars.