Forum | | | | - Page 1 - |
| Sven Bader | Hi,
OpenGL in XProfan power correctly. Fun, with of/ one thing be I but not yet integrally pleased. I had gladly slippery Kanten (Antialisasing). what one so in the network finds are The References really always same and well in XProfan nachzustellen, unfortunately becomes too between whom Polygonen, The really zusammengehören neatened - the results in Löchern I have already probiert, with StartList/Endlist/Drawlist items To group, too have I testweise large pieces the Codes with API Call supplant.
Perhaps happens in the Init-commands something, that not so verträgt?
has itself of you Schonmal someone with the Topic befasst? I would find it too for Games with plainer graphic right wichitg, it heard somehow moreover.
greetings Sven
in the integral is the the code, the whom Objects vorangestellt go must:
One lauffähiges Komplettbeispiel is here, with Leertaste can the Glättung on and off:
'$H OpenGL.ph
Def &GL_POLYGON_SMOOTH $B41;
Def &GL_NICEST $1102;
Def &GL_ONE_MINUS_SRC_ALPHA $303;
Def &GL_SRC_ALPHA $302;
Def &GL_POLYGON_SMOOTH_HINT $C53;
Def &GL_ONE 1;
Def &GL_BLEND 3042;
proc DrawGLScene
oGL("Clear")
oGL("Color", 1,1,1,1)
if (aa% = 1)
oGL("glBlendFunc",&GL_SRC_ALPHA, &GL_ONE_MINUS_SRC_ALPHA)
oGL("glEnable", &GL_BLEND)
oGL("glEnable", &GL_POLYGON_SMOOTH);
oGL("glHint", &GL_POLYGON_SMOOTH_HINT, &GL_NICEST);
else
oGL("glDisable",&GL_POLYGON_SMOOTH)
oGL("glDisable", &GL_BLEND)
oGL("glBlendFunc",&GL_ONE, &GL_ONE)
endif
oGL("Origin", 0, 0, -4.0)
oGL("Rotate", 0, 0, 22.5)
oGL("Origin", -1.0, 0, -4.0)
oGL("Quad", 2, 2)
oGL("Origin", 1.0, 0, -4.0)
oGL("sphere", 1,20,20)
oGL("Show")
endproc
declare end%, aa%
window 600,400
oGL("Init", %hWnd, 0.5, 0.5, 0.5, 0)
oGL("PosMode", 1)
aa% = 1
DrawGLScene()
ende% = 0
WhileNot end%
WaitInput
if (%key = 32)
sleep 200
aa% = abs(aa% - 1)
elseif (%key = 27)
end% = 1
endif
DrawGLScene()
EndWhile
oGL("Done")
end
Antialiasing AN, The Borders are ok, but any Schnittkanten having holes
Standardzustand Antialiasing AUS, Schnittkanten ok, but no Glättung
Hack: Anti Aliasing by Grafiktreiber erzwungen, so ought to it looks
|
| | | | |
| | « this Posting watts as Solution marked. » | | Sven Bader | for my tack have I a Solution, The unfortunately in each something komplexerem associated area failure becomes.
I lay the ungeglättete Objekt ....
... with the whom slippery Kanten ...
... the Result is How gewüsncht
to that a is it wrong and unperformant the whole Objekt once more to drawing, to that others it can method To others Problemen lead if the Objekt no "culled faces" means unsichtbare reverses had or one ever to Beschaffenheit the Objekts pieces of itself self by the holes sees. too combination with transparenten Objects sorgt with this Solution for confusion.
interestingly To see is, that the Originalobjekt something small and that the Glättung outside moreover comes - there asks one itself, as at all to the Löchern in the Innenbereich comes ...
an Interessante Variant angwendetes Smoothing but with deaktiviertem Blending, so get to the "größere" Objekt, but the only on the Rande.
lying The Solution just in the right glBlendFunc(), which letztendlich the does, I with two identischen Objects nachbilde or can it something with Buffern or oGL Grundeinstellungen concern?
here the new code
$H OpenGL.ph
proc DrawGLScene
oGL("Clear")
oGL("Color", 1,1,1,1)
if (aa%)
oGL("glDisable", ~GL_BLEND)
oGL("glDisable", ~GL_POLYGON_SMOOTH)
'Objekt with hard Kanten
oGL("Push")
oGL("Rotate", 0, 0, 22.5)
oGL("Origin", -1.0, 0, -4.0)
oGL("Quad", 2, 2)
oGL("Origin", 1.0, 0, -4.0)
oGL("sphere", 1,30,30)
oGL("Pop")
oGL("glBlendFunc",~GL_SRC_ALPHA, ~GL_ONE_MINUS_SRC_ALPHA)
oGL("glEnable", ~GL_POLYGON_SMOOTH)
oGL("glEnable", ~GL_BLEND)
'Gleiches Objekt geglätten above
oGL("Push")
oGL("Rotate", 0, 0, 22.5)
oGL("Origin", -1.0, 0, -4.0)
oGL("Quad", 2, 2)
oGL("Origin", 1.0, 0, -4.0)
oGL("sphere", 1,30,30)
oGL("Pop")
else
oGL("glDisable", ~GL_BLEND)
oGL("glDisable", ~GL_POLYGON_SMOOTH)
oGL("Push")
oGL("Rotate", 0, 0, 22.5)
oGL("Origin", -1.0, 0, -4.0)
oGL("Quad", 2, 2)
oGL("Origin", 1.0, 0, -4.0)
oGL("sphere", 1,30,30)
oGL("Pop")
endif
oGL("Show")
endproc
declare end%, aa%
window 600,400
oGL("Init", %hWnd, 0.5, 0.5, 0.5, 0)
oGL("PosMode", 1)
oGL("glHint", ~GL_POLYGON_SMOOTH_HINT, ~GL_NICEST);
ende% = 0
aa% = 1
DrawGLScene()
WhileNot end%
WaitInput
if (%key = 32)
sleep 200
aa% = abs(aa% - 1)
elseif (%key = 27)
end% = 1
endif
DrawGLScene()
EndWhile
oGL("Done")
end
|
| | | | | |
| | Sven Bader | I have whom Posting as resolved declared though it no perfect Solution gives.
its well simply so, that The ursprüngliche Possibility over GL_POLYGON_SMOOTH of present Grafiktreibern not any more correctly treats and is one on zeitgemäßere (and complex) Technologien zurückgreifen ought to. an Lösungsansatz with oldschool OpenGL would yet the mehrfache slight versetzte Rendern into Accumulation Buffer (glAccum), whom have so did i already successful for Motion Blur uses. |
| | | | |
|
AnswerThemeninformationenthis Topic has 1 subscriber: |