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

Aktuelle Zeit: So Jul 20, 2025 10:26

Foren-Übersicht » English » English Programming Forum
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 48 Beiträge ]  Gehe zu Seite Vorherige  1, 2, 3, 4  Nächste
Autor Nachricht
 Betreff des Beitrags:
BeitragVerfasst: Sa Sep 11, 2004 18:46 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
I know that switching depht compare function in a frame turns off depth optimizations on Radeon 9500 and up, but in my case it haven't had a noticeable impact on the framerate.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Sep 12, 2004 08:40 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
Just found out that ~0 means not 0. Maybe that gets things working...

EDIT:
Yes now it works!!!! It was the stencil function that was wrong.
This means there is also a bug in dglopengl in the way tgluint (and gluint) is defined. It should not be cardinal, but integer!.

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Sep 12, 2004 09:53 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
No, not 0 for bitmasks means 255, and not -1. So if you have a stencildepth of 8 bits it looks like this :

0 translates to a bitmask of 0 0 0 0 0 0 0 0
not 0 translates to a bitmask of 1 1 1 1 1 1 1 which is 255 which is $FF, and that's what I said above.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Sep 12, 2004 10:05 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
:shock: Now i am all confused. It did not work before, but now it does. Also the way you say, but that did not work before...

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Sep 12, 2004 10:11 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
This won't work :
glStencilMask(not 0),
but this will
glStencilMask(Byte(not 0)) or glStencilMask(255).

I guess you used the first one, but in that equation it does an integer-not which will result in a negative. You you must either explicit set 255 or use a "hard" typecast to byte.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Sep 12, 2004 11:34 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
i got that working. I am still not happy with the framerate however. It goes way down.... Basicly i get 1/10 of the original framerate..... Is that supposed to be normal. Maybe for a scene with a static light i could put the shadows in a displaylist for static objects.

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Sep 12, 2004 11:37 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
What hardware are you using. As I said the hit on the framerate is normally big, but it should not be that big. In a current demo, I render a huge racetrack with a terrain and my framerate is still > 50 fps most of the time. That's about half of what I get without shadows. One thing you should do is to calculate and extrude the shadowvolumes only when the light moves, that'll take much work off the CPU.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Sep 12, 2004 12:25 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
you are right, i am testing in a worst case scenario with a moving light that moves every frame. Also i can try optimizing the shadow render routine. It starts with:

Code:
  1.  
  2.  for i := 0 to FNumIndices DIV 3 - 1 do
  3.     if Ffaces[i].visible then
  4.       for j := 0 to 2 do
  5.         begin
  6.         k := Ffaces[i].neighbour[j];
  7.         if (k = 0) or (not Ffaces[k-1].visible) then
  8.           begin
  9.  

then it renders the shadow by calculating 2 new points. ((vertex - lightpoint)*100)

There is not much to get or i should make a new list storing the result of the first path during visibility calculation, but then that also needs to be done after the light changes. So i don expect speed advantages there.

BTW my videocard is a geforce ti4200 and my pc has a p4 running at 2.4ghz

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Sep 12, 2004 13:18 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
Could you download this shadow volume demo (~300k) and take a look at the framerates? It's one of my first shadow volume tests that uses almost the same scene as you, so you can see how shadow volumes impact on performance and see if your demo performs good. This demo also calculates the shadow volumes every frame. Some keys :

r - toggle shadow volumes on/off
v - show volumes
s - show silhouettes
z - switch between zPass (which is default and gives errors when you enter the volume) and zFail
Cursor left/right - Rotate scene
+/- - Zoom

Performance on my Radeon 9700 (no AA/16xAF, defatult window size and start view) : With shadows (zPass) = 200 fps, without = 250 fps.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Sep 12, 2004 18:19 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
hmmm, again something unexpected:
On pressing r the scene only darkens, but no shadows, and the framerate goes up to 360 from 240 initial.
On showing volumes framerate goes back to 188-230.

EDIT:
Scene with my test program:
Normal rendering (no Shadows, one pass): 388 fps
Rendering with volume shadows: 60 fps

_________________
http://3das.noeska.com - create adventure games without programming


Zuletzt geändert von noeska am So Sep 12, 2004 18:36, insgesamt 1-mal geändert.

Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Sep 12, 2004 18:35 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
That's about normal. Pressing r turns off the shadow volumes, so your FPS-increase sounds right to me. So it really seems you do something wrong in your demo if you don't get the same performance.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Sep 12, 2004 19:03 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
i split one procedure in 2 so the face vicibility is now calculated once, now the scene with shadows renders about 135fps. Still no 188 but it is better now.

Code:
  1.  
  2.  side := FFaces[i].Plane.a*lp.x + FFaces[i].Plane.b*lp.y
  3.       + FFaces[i].Plane.c*lp.z{ + Ffaces[i].Plane.d*1.0};
  4.  

is a real slowdown. (if side is > 0 then the face might be visible)

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Sep 12, 2004 19:16 
Offline
DGL Member
Benutzeravatar

Registriert: Di Nov 26, 2002 22:12
Beiträge: 259
Wohnort: Dresden
I’ve the same problem like noeska. I cannot see any shadows. If I press “r” the scene becomes a little bit darker, but there are still no shadows.
The text message in on the screen says that the depth of the stencilbuffer is zero. Maybe it’s a hardware specific problem or there is a bug in your code.

_________________
Nichts auf der Welt ist so gerecht verteilt wie der Verstand. Denn jederman ist überzeugt, dass er genug davon habe.
Rene Descartes, frz. Mathematiker u. Philosoph, 1596-1650


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Sep 12, 2004 19:18 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
Oh, I guess you both have NVidia-cards, am I right? It may be the case that I accidentely left over some ATI-specific code and the demo still uses GL_ATI_separate_stencil even if it's turned off...I'm gonna take a look at it and upload a new file if I find the error.

But the stencil = 0 is very suspicous and shouldn't happen. Do you both have your desktops set to 32 Bit?

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: So Sep 12, 2004 19:23 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
Please try this new exe. I forgot (back in that demo, it's old and was one of my first steps with stencil shadows) to explicit request a stencil buffer. But most cards (at least ATI) automatically give you 8 stencil bits if you request 24 bits of depth under 32 bits of colordepth.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 48 Beiträge ]  Gehe zu Seite Vorherige  1, 2, 3, 4  Nächste
Foren-Übersicht » English » English Programming Forum


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 3 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.008s | 14 Queries | GZIP : On ]