Autor Beitrag
t/f
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 70



BeitragVerfasst: Di 22.04.03 23:48 
Hi Board!

Also ich möchte in OpenGL gern zwei Quads mit je einer anderen Textur ineinander verschwimmen lassen...

Habs wie folgt probiert doch das Ergebnis ist ernüchternd. Die erste Textur wird zwar angezigt und nach rechtshin abgeblendet, die Zweite jedoch ist gar nicht zu sehen....

ausblenden volle Höhe Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
MyTex:=TTextur.Create('terrain1.jpg');
MyTex.Bind;

    glBegin(gl_Quads);
        glColor4f(1,1,1,1);
        glTexCoord2f(0,0);
        glVertex3f(-1,-1,0);

        glColor4f(1,1,1,0);
        glTexCoord2f(1,0);
        glVertex3f(1,-1,0);
        glTexCoord2f(1,1);
        glvertex3f(1,1,0);

        glColor4f(1,1,1,1);
        glTexCoord2f(0,1);
        glvertex3f(-1,1,0);
    glEnd;

    glEnable(GL_BLEND);
    glBlendFunc(GL_SRC_ALPHA,GL_ONE);

MyTex:=TTextur.Create('terrain2.jpg');
MyTex.Bind;

    glBegin(gl_Quads);
        glColor4f(1,1,1,0);
        glTexCoord2f(0,0);
        glVertex3f(-1,-1,0);

        glColor4f(1,1,1,1);
        glTexCoord2f(1,0);
        glVertex3f(1,-1,0);
        glTexCoord2f(1,1);
        glvertex3f(1,1,0);

        glColor4f(1,1,1,0);
        glTexCoord2f(0,1);
        glvertex3f(-1,1,0);
    glEnd;


Screeni:

user defined image

Was mache ich falsch?

_________________
OS: Linux - RedHat 9
Delphi: Kylix 3
Andreas Pfau
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 997



BeitragVerfasst: Do 24.04.03 19:17 
Du musst Blending VOR dem rendern aktivieren, also nicht erst nach dem ersten Quad. Setze glEnable() und glBlendFunc() nach ganz oben.

_________________
Life is a bad adventure, but the graphic is really good!