1
내가 스위프트의 OpenGL을하여 RGB 텍스처를 표시 할
, 그것은 목표 - C에서 잘 작동했다, 나는 스위프트 언어 코드를 포팅하려고 Swift에서 OpenGL을 사용하여 RGB 텍스처를 표시하는 방법은 무엇입니까?
,정말 전달하는 방법을 이해할 수 없다
누구나 Swift에서 OpenGL을 사용하여 RGB 텍스처를 표시하는 방법에 대한 간단한 자습서를 제공 할 수 있습니까?
내 쉐이더 :
정점 :
precision highp float;
attribute vec2 positionCoords;
attribute vec2 textureCoords;
uniform mat4 modelViewProjectionMatrix;
varying vec2 v_texcoord;
void main()
{
gl_Position = modelViewProjectionMatrix * vec4(positionCoords, 0.0, 1.0);
v_texcoord = textureCoords.xy;
}
조각 :
precision highp float;
varying vec2 v_texcoord;
uniform sampler2D s_texture;
void main()
{
gl_FragColor = texture2D(s_texture, v_texcoord);
}
문제가 해결3210
헤이 바인딩 glvertexarray를 사용하고 계십니까? 텍스처로드 및 패스 코드. –