2
투명도가있는 텍스처 (조명 정보가있는 흰색 삼각형)가 있고 은 알파벳 변수이 될 수 없습니다. 누락 된 조각 OpenGL-ES 가변 텍스처 알파 (2D)?
alt text http://gotoandplay.freeblog.hu/files/alpha_help.png
그리기 코드
://Place polygon vertices to the bottom left within the view.
glLoadIdentity();
glTranslatef(centerX, centerY, 0);
//Draw "diffuse" layer.
glBindTexture(GL_TEXTURE_2D, spriteTexture[0]); //Bind.
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
//Offset during development only.
glLoadIdentity();
glTranslatef(centerX-10, centerY+10, 0);
//Draw "specular" layer.
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, spriteTexture[1]); //Bind.
//Some smart alpha scaling code needs here...
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
누군가는 코드의 적절한 라인 좀 도와 주 시겠어요? 일부 glBlendFunc 또는 glTextEnvi라고 생각할 수도 있습니다.
두 텍스처의 값을 혼합하는 방법을 계산할 수 있습니까? (배경 + 삼각형 1 + 삼각형 2). 또는 두 삼각형을 같은 삼각형에 적용하고 싶습니까? – Frogblast
삼각형은 텍스처에 연결된 별도의 프레임 버퍼로 렌더링됩니다. 따라서이 별도의 프레임 버퍼에서 배경은 (0,0,0,0)이며, 트라이앵글 1은 두 번째 삼각형과 마찬가지로 알파 블렌딩됩니다 (이러한 추가, 변조 등은 없습니다). 내 이전 질문에서 이러한 이미지 (그래서 생성 된 텍스처)를 볼 수 있습니다 : http://stackoverflow.com/questions/2173363/please-help-with-an-opengl-es-iphone-multi-texturing-2d-code – Geri