OpenGL ES 2.0.0とGLSL ES 1.0.0を使用して開発しています。GLSL 1.0.0 - 頂点シェーダとフラグメントシェーダで "Varying"を使用するときの問題
現在、スクリーンに画面を表示していて、テクスチャを適用するために を試しています。私は、ドキュメントを読んでいると私は「何を把握することはできません
- Failed to compile vertex shader -
0(3) : error C5060: out can't be used with non-varying tex_varying
in vec4 texture_coord ;
in vec4 position ;
out vec2 tex_varying ;
uniform mat4 translate ;
void main ()
{
gl_Position = translate * position ;
tex_varying = texture_coord . xy ;
}
:私は、トラブルのエラーメッセージを受信し、頂点およびフラグメントシェーダで「はを変える」 を使用してのことだ
私は間違っている。
ここにコードがあります。
頂点:
attribute vec4 position;
attribute vec4 texture_coord;
varying vec2 tex_varying;
uniform mat4 translate;
void main()
{
gl_Position = translate * position;
tex_varying = texture_coord.xy;
}
フラグメント:RESOLVED
varying vec2 tex_varying;
uniform sampler2D texture;
void main()
{
gl_FragColor = texture2D(texture, tex_varying);
}
: これは返事が遅れているが、私は長い時間前にこの問題を解決することになった - 誰つまずく場合問題を横断してそれは "tex_varying"がNvidiaによって予約されていることが判明しました!単にtex_varyingの名前を変更するだけで問題は解決しました。
乾杯。
で動作するはずのように見えてきたようなので、あなたの第二/第三のシェーダが見えます。 "tex_varying = texture_coord.xy;" – djmj
申し訳ありませんが、コードのように、私はちょうどここで間違ってそれをコピーしました。 – Ben
"にエラーメッセージ"どのシェーダがありますか?それは何の行ですか?エラーメッセージ全体を投稿できますか? –