Answer the question
In order to leave comments, you need to log in
Learning to write shaders, where is the error?
There is a sandbox for writing shaders under Three.js, I'm trying to write a simple fragment shader there, which stupidly copies all the colors from the texture and pastes them without modification. The code:
#ifdef GL_ES
precision mediump float;
#endif
#extension GL_OES_standard_derivatives : enable
varying vec2 vTextureCoord;
uniform sampler2D uTexture;
void main(void) {
gl_FragColor = texture2D(uTexture, vTextureCoord);
}
#ifdef GL_ES
precision mediump float;
#endif
#extension GL_OES_standard_derivatives : enable
varying vec2 vTextureCoord;
uniform sampler2D uSampler;
void main(void) {
gl_FragColor = texture2D(uSampler, vTextureCoord);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question