Files |  Tutorials |  Articles |  Links |  Home |  Team |  Forum |  Wiki |  Impressum

Aktuelle Zeit: Do Mär 28, 2024 17:19

Foren-Übersicht » Programmierung » OpenGL
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 5 Beiträge ] 
Autor Nachricht
BeitragVerfasst: Mo Aug 10, 2020 12:36 
Offline
DGL Member

Registriert: Di Aug 31, 2010 10:29
Beiträge: 12
Wohnort: Norwegen
Programmiersprache: Pascal
Es handelt om eiene einfache Aufgabe in 2D. Nur Linien.

Angenommen, Sie haben eine statische Szene (die sich nicht ändert).
Diese Szene ist komplex und braucht Zeit zum Generieren.

Zu dieser Szene möchten Sie ein dynamisches (sich änderndes) Diagramm hinzufügen,
das sich bewegt.

Im Internet habe ich einige C++ - Beispiele gefunden, von denen ich nur verstanden habe,
dass ich zwischen einem FRONT- und einem BACK-Puffer wählen kann mittels glDrawBuffer.
Ich denke jetzt, dass die statische Szene in den BACK-Puffer gehen soll, und dass
der dynamische Graph geht in den FRONT-Puffer. Aber von hier an stecke ich fest.
Hoffentlich kann jemand auf den Weg nach vorne weisen.

Hier sind meine Fragen:

Benötige ich für diese Aufgabe einen Doppelpuffer?

Welche OpenGL-Aufrufe gehen der Erzeugung der statischen Szene in den BACK-Puffer voraus? glDrawBuffer(GL_FRONT)? glFlush?

Welche OpenGL-Aufrufe gehen der Erzeugung der dynamischen Szene im FRONT-Puffer voraus?

Um die vorherige dynamische Szene zu löschen, muss ich wohl die glEnable / glLogic-Aufrufe ausführen und
den vorige Diagramm zeichnen.
Nachher zeichne ich den gegenwärtige Diagramm aber jetzt ohne Farblogik. All dies in den FRONT-Puffer.
Ist das richtig?

Wie füge ich den FRONT-Puffer mit dem BACK-Puffer zusammen? Ich denke mit einem Anruf wie glFlush oder SwapBuffers.


Ch


Nach oben
 Profil  
Mit Zitat antworten  
BeitragVerfasst: Mo Aug 10, 2020 16:05 
Offline
Ernährungsberater
Benutzeravatar

Registriert: Sa Jan 01, 2005 17:11
Beiträge: 2067
Programmiersprache: C++
This is a use case of render to texture or renderbuffer objects.
You setup the buffer, then render your static scene.

Later on, you just first call glClearBuffer, then draw your render buffer (or the texture) and continue with your dynamic scene.

The command to draw the renderbuffer object is glBlitFramebuffer.
Hope this gave you enough informations how to handle the scenario.

_________________
Steppity,steppity,step,step,step! :twisted:
❆ ❄ ❄ ❄ ❅ ❄ ❆ ❄ ❅ ❄ ❅ ❄ ❅ ❄ ❄
❄ ❄ ❄ ❅ ❄ ❄ ❄ ❅ ❄ ❄ ❆ ❄ ❄


Nach oben
 Profil  
Mit Zitat antworten  
BeitragVerfasst: Di Aug 11, 2020 09:46 
Offline
DGL Member

Registriert: Di Aug 31, 2010 10:29
Beiträge: 12
Wohnort: Norwegen
Programmiersprache: Pascal
Thnx,

Apparently Google's Dolmetsch did not fool you.

Unfortunately my OpenGL toolbox is that of 20 years ago. Thus the available tools at that time were the double-buffer, the glDrawBuffer, GL_FRONT, GL_BACK, the colour-logic with XOR and the glFlush and SwapBuffers.

Rubber-banding was used in those days. Therefore I presume, that with but these tools correctly used, the functionality could be achieved.

Hope you could translate your answer into the language of those days ...

Ch

P.S. If you wish, then answer auf Deutsch. I read German newspapers daily and without difficulty!


Nach oben
 Profil  
Mit Zitat antworten  
BeitragVerfasst: Di Aug 11, 2020 10:14 
Offline
Ernährungsberater
Benutzeravatar

Registriert: Sa Jan 01, 2005 17:11
Beiträge: 2067
Programmiersprache: C++
I must ask why you have to use such an old toolbox? All integrated GPUs of the last 5 years support at least OpenGL 3.1.

Take a look at the first link of Tutorial Renderpass. This tutorials talks about updating the texture every frame which you don't need to do. Render to texture should be available to you.

If not, then I sadly have no clue how to help you. There is glAccum to combine buffers. So you render the static scene to the front buffer, then render the dynamic parts into the back buffer.
Clear the accumulator, then add the front and the back buffer. This could work, but I'm not sure of the parameter to glAccum and the colour of the "blank" background.

_________________
Steppity,steppity,step,step,step! :twisted:
❆ ❄ ❄ ❄ ❅ ❄ ❆ ❄ ❅ ❄ ❅ ❄ ❅ ❄ ❄
❄ ❄ ❄ ❅ ❄ ❄ ❄ ❅ ❄ ❄ ❆ ❄ ❄


Nach oben
 Profil  
Mit Zitat antworten  
BeitragVerfasst: Mo Aug 24, 2020 09:50 
Offline
DGL Member

Registriert: Di Aug 31, 2010 10:29
Beiträge: 12
Wohnort: Norwegen
Programmiersprache: Pascal
Please excuse my late reply to your question about why I use such an old OpenGL version. Here's why:

I bought around 1990 a Red Book to back-up Jacobs book. Around 2014 the version 4.3 Red Book was bought. The "hello world" example was called triangles.cpp and I understood nothing of the declarations of that language (my tradition is Algol, FØRTRAN, Delphi). The book was stored in my shelf and there it has been ... untouched.

Your answer forced me to do something. By a mere struck of luck Google led me to a wonderful Delphi example at this web address (does not understand how to use the URL of this Antwort-edotor)

https://www.pascalgamedevelopment.com/s ... ith-Delphi

To me it was a revelation. Not only does his Pascal example use dglOpenGL.pas but also does he a complete interface to Windows without any references to Delphi's IDE. (the examples shows beautifully how to handle Messages, what a call-back loop is and much more; no Delphi just dcc32; well, you may be shocked ...)

So, after I have removed all ARB-references in the www-example and read more in the Red Book, then I will return to your answer and finally do the rubber-banding the "modern" way. I look forward to that.

Ch


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 5 Beiträge ] 
Foren-Übersicht » Programmierung » OpenGL


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 45 Gäste


Du darfst keine neuen Themen in diesem Forum erstellen.
Du darfst keine Antworten zu Themen in diesem Forum erstellen.
Du darfst deine Beiträge in diesem Forum nicht ändern.
Du darfst deine Beiträge in diesem Forum nicht löschen.
Du darfst keine Dateianhänge in diesem Forum erstellen.

Suche nach:
Gehe zu:  
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.043s | 17 Queries | GZIP : On ]