私はopenglを学んでいます。私はテクスチャを持つ球を持っています。私は外から見ても問題ありませんが、カメラを入れると暗く見えます。私はこれを解決しようとしました:球の中からテクスチャを見ることはできません。opengl-es
GLES20.glCullFace(GLES20.GL_FRONT_AND_BACK);
しかし、私はまだ黒い画面が表示されます。それは光によるものですか?私は球の内部からテクスチャを見るために何ができますか?
これらのシェーダである:
final String vertexShader =
"uniform mat4 u_MVPMatrix; \n" // A constant representing the combined model/view/projection matrix.
+ "attribute vec4 a_Position; \n" // Per-vertex position information we will pass in.
+ "varying vec2 vTexCoord; \n"
+ "attribute vec2 vTexCoord0; \n"
+ "void main() \n" // The entry point for our vertex shader.
+ "{ \n"
+ " gl_Position = u_MVPMatrix \n" // gl_Position is a special variable used to store the final position.
+ " * a_Position; \n" // Multiply the vertex by the matrix to get the final point in
+ " vTexCoord = vTexCoord0; \n"
+ "} \n"; // normalized screen coordinates.
final String fragmentShader =
"precision mediump float; \n"
+ "varying vec2 vTexCoord; \n"
+ "uniform sampler2D sTexture; \n"
+ "void main() \n"
+ "{ \n"
+ " gl_FragColor = texture2D(sTexture, vTexCoord);\n"
+ "}
のように見えることは、私が持っているあなたのシェーダが –
書かれている方法によって異なりますシェイダーを投稿しました。 – takluiper
それでは、シェーダにライト計算がないので、ライトではありません –