I’m slowly losing my mind as I’m unable to make this slider work. I’m a total three beginner. TBH, found the shaders online but built the react code on my own.
To get the general idea of the slider’s functionality and to see it’s code, I’ve prepared a codesandbox
The issue I’m having is with rendering correct slide index and slide caption inside the Slider component.
Second slides’ caption is rendered when first slide is active. And afterwards, third slides’ caption is rendered when the second slide is active. This is because initially uTexture1 inside the uniforms is loaded with a transparent texture. I want this feature to stay because it animates the first slide from the white background.
So does anyone have any idea how to sync slide index and caption rendered in the Slider component, with the currently visible slide?
I would appreciate any help.