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.
still getting “Project not found” it’s probably set private. but either way, every color shader in threejs needs encoding and tonemapping fragments.
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:
I’m not sure this is valid glsl, you’d probably want to convert your textures color space outside of the shader before passing it in as a uniform…
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…