Everything is in the title. I created a custom glsl shader and even if I dont modify anything, the result is way darker than the original. I am using this: vec3 texture = texture2D(uTexture, uv).rgb;
to get the texture so perhaps the error is there.
You can see the original picture in /public et nature_morte.jpg.
link broken. but shaderMaterial is nothing else than a plain THREE.ShaderMaterial. what you are most likely missing is encoding and tonemapping includes but that’s the case with any custom shader in threejs.
I add this as you told #include <encodings_pars_fragment>;
I now have the message “this function already has a body” which means the package is already loaded. How not to load it twice ? basic question but I only found c# answer to this.
it might also be that the texture you’re giving is has a wrong colorSpace. you will have more luck if you search for THREE.ShaderMaterial specifically (stackoverflow etc) because that’s where the issue is. drei/shaderMaterial is just a helper that creates setter/getters, but wouldn’t change how the shader works:
As it suggests in the console error, probably delete the semicolon after your endif and the second semicolon further on? Glsl has a strict syntax that needs to be followed in order for it to compile…