translated-content
translated-content copied to clipboard
ソースコードの間違い
MDN URL
https://developer.mozilla.org/ja/docs/Web/API/WebGL_API/Tutorial/Using_textures_in_WebGL
この問題に関する節や見出しはどこですか。
フラグメントシェーダー
不完全、不親切、不完全であった情報は何ですか。
const fsSource = ` varying highp vec2 vTextureCoord;
uniform sampler2D uSampler;
out vec4 fragColor;
void main(void) {
fragColor = texture(uSampler, vTextureCoord);
}
`;
どう表示されるべきだと思いますか。
const fsSource = ` varying highp vec2 vTextureCoord;
uniform sampler2D uSampler;
void main(void) { gl_FragColor = texture2D(uSampler, vTextureCoord); } `;
補足情報となるリンク、参考資料、引用文献はありますか。
https://github.com/mdn/dom-examples/blob/main/webgl-examples/tutorial/sample6/webgl-demo.js
他に共有したいことはありますか。
GitHub のソースコードと解説のコードが違っているため正しく挙動したなったため、こちら調整をお願いします GitHub のコードであれば問題なく動きました
MDN metadata
Page report details
- Folder:
ja/web/api/webgl_api/tutorial/using_textures_in_webgl
- MDN URL: https://developer.mozilla.org/ja/docs/Web/API/WebGL_API/Tutorial/Using_textures_in_WebGL
- GitHub URL: https://github.com/mdn/translated-content/blob/main/files/ja/web/api/webgl_api/tutorial/using_textures_in_webgl/index.md
- Last commit: https://github.com/mdn/translated-content/commit/208a139285a6ec20aa36949d2c87fe220dc25fa3
- Document last modified: 2024-03-30T02:05:51.000Z