English
Source / code snippets

Collison Ogl Oglglreadpixels Viereck

 
- Page 1 -


The first Collisionsabfrage with the Viereck 128X128 Pixel.
I form the Viereck now Black ex, so möglichs many colours taken go can.
there otherwise others colours in the Viereck also The Collisionsfarbe having ,addressed go.
If the car the "Viereck" touched ,which herewith prepares watts : ogl("glReadPixels",140,140,128,128,~GL_BGRA,~GL_UNSIGNED_BYTE,ogl_rgb#) , becomes the worth 255 spend.

Massgebend are The colours RGB greater 252. Can anytime in the CPP-File Change.

have first once The request with the DEV C++ made or DLL prepares., because I in ASM first again failed be.
The DEV C++ Source-Files are too with thereby.

The zipper is appended.

mfg

11 kB
Kurzbeschreibung: The Files
Hochgeladen:08/21/08
Downloadcounter139
Download
 
08/21/08  
 



 
- Page 1 -


Ablaufzeiten (gross)the Collisionsabfrage the Rechteckes 128X128X4 with 10000 Schleifendurchgänge :
computer with 1,6 Gigahz

The Profan While-Leerschleife need ca 200ms.

ASM with XPIA/XPSE (DLL) are it 4550 ms .

DEV C++ are it 6210 ms ( a For-Loop).

DEV C++ are it 6260 ms (While-Loop).

with 10000 durchgängen rewards it itself this in ASM umzusetzen, are ca 1,5 sec Difference.

mfg
peter
 
08/22/08  
 




Frank
Abbing
your Assembler-routine isn't optimiert. If you tappt im dunkeln umstellst of variables on tab is yet some More drin. ca. 20 percent, wealth I.

These routine keeps your Programmstruktur with, ought to but already work faster:
CompileMarkSeparation
If 0

    AsmStart rgb_farbe (ogl_rgbxy#,groesse%)

        mov edi,para2
        xor ecx,ecx
        mov ebx,para1

        .while ecx<=edi

            mov al,[ebx]
            mov cl,[ebx+1]
            mov dl,[ebx+2]

            .if al>252

                mov eax,255
                .break

            .endif

            .if cl>252

                mov eax,255
                .break

            .endif

            .if dl>252

                mov eax,255
                .break

            .endif

            lea ebx,[ebx+4]
            lea ecx,[ecx+4]

        .endw

    AsmEnd(z%)

EndIf

 
08/22/08  
 




Jörg
Sellmeyer

The Profan While-Loop need ca 200ms.


are You sure, that Profan More as 20-time faster is as ASM?
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
08/22/08  
 



should Empty-Loop heissen, because I integrally supra too of gross promise.
The Test runs with all in the same While-Loop of Profan

I have too time this Freebasic tested to that DLL create.

who in Freebasic a DLL create would like and no ASM can/would like and no "C", is so well bedient.

The Freebasic-DLL need 7400ms means only 1 second longer as DEV C++.

might for Basicprogrammierer , a DLL create would of/ one the best Freewarealternativen his.

with of my Collisionstest-Auswertung with the Freebasic-DLL on-screen on the graphic, is me the Difference optisch not noticed. the Objekt flitzte furthermore still hither and thither withal the Überprüfung/Auswertung.

mfg
peter
 
08/22/08  
 



Frank, your need 3,5 sec longer.

I knows now not, How with the whom Registern and LEA there functions.
On each drop must The address always circa "4" go on.

mfg
peter
 
08/22/08  
 




Frank
Abbing

Frank, your need 3,5 sec longer.


incorrect! tab works always faster as Varablen in memory, even if tappt im dunkeln pub are. such Tests have I already dozens implemented.
And so a Assemblerroutine needed never 3,5 sec longer, tappt im dunkeln needed at all only few Millisekunden altogether. even if You with grossen Bitmaps work. You can the gladly with the ProSpeed.dll testing, The numerous Bitmapeffekte knows. Irgendwas goes with your Tests vast schief.
What exactly should The routine because make? tappt im dunkeln fractures still immediate ex, as they a very hellen Farbwert finds. If you a Robotersoftware write want, The The data of/ one Cam auswertet, must You already The amount heller Bildpunkte count. before but the Cambild gray make, or. Black-knows.
 
08/22/08  
 



 
- Page 2 -


yet be I do not at Roboterbild, the has yet time. i want first once The fastest routines find for Bildauswertung in the zusammenhang with OpenGL and its statement.
Befinde me still in the Anfangsstufe because I the Profan first to 3 weeks gotten to know have.
there the ASM with moreover comes has the Lernumfang changed.
and have on the side already nice erkenntnisse with Getdibits , Setdibits etc assembled.

here the code for terms testing :
CompileMarkSeparation
DEF rgb_farbe_asm(2) ! "ogl-asm-test.dll","rgb_farbe"
DEF rgb_farbe_asm_o(2) ! "ogl-asm-test.dll","rgb_farbe_o"
declare bildxy# ,ogl_rgb#,x&,y&,z%
var groesse%=128*128*4
dim bildxy#,groesse%,z%
dim ogl_rgb#,groesse%
x&=10000
Print "Bereich mit 0 füllen"

whileloop 0,groesse%-1

    byte ogl_rgb#,&loop=0

endwhile

Print "rgb_farbe-asm"
y&=&GetTickCount

Whileloop x&

    z%=rgb_farbe_asm(ogl_rgb#,groesse%)

EndWhile

y&=&GetTickCount-y&
Print "Fertig in "+Str$(y&)+" Millisekunden."
Print "while-schleife"
y&=&GetTickCount

Whileloop x&

EndWhile

y&=&GetTickCount-y&
Print "Fertig in "+Str$(y&)+" Millisekunden."
Print "rgb_farbe-asm_o"
y&=&GetTickCount

Whileloop x&

    z%=rgb_farbe_asm_o(ogl_rgb#,groesse%)

EndWhile

y&=&GetTickCount-y&
Print "Fertig in "+Str$(y&)+" Millisekunden."
WaitInput
End

and here the ASM-code , woraus I a DLL prepares with XPIA/XPSE
CompileMarkSeparation
AsmStart rgb_farbe_o (ogl_rgbxy#,groesse%)

    mov edi,para2
    xor ecx,ecx
    mov ebx,para1

    .while ecx<=edi

        mov al,[ebx]
        mov cl,[ebx+1]
        mov dl,[ebx+2]

        .if al>252

            mov eax,255
            .break

        .endif

        .if cl>252

            mov eax,255
            .break

        .endif

        .if dl>252

            mov eax,255
            .break

        .endif

        lea ebx,[ebx+4]
        lea ecx,[ecx+4]

    .endw

AsmEnd(z%)

AsmStart rgb_farbe

    Parameters ogl_rgbxy#,groesse%
    LOCAL r :BYTE
    LOCAL g :BYTE
    LOCAL b :BYTE
    LOCAL n :DWORD
    mov eax,para2
    mov n,eax
    mov ecx,0
    mov ebx,para1

    .while ecx<=n

        mov al,[ebx+ecx]
        mov r,al
        mov al,[ebx+ecx+1]
        mov g,al
        mov al,[ebx+ecx+2]
        mov b,al
        mov al,b

        .if al>252

            mov eax,255
            .break

        .endif

        mov al,g

        .if al>252

            mov eax,255
            .break

        .endif

        mov al,r

        .if al>252

            mov eax,255
            .break

        .endif

        add ecx,4

    .endw

AsmEnd(z%)

 
08/22/08  
 




Frank
Abbing
Peter, You must y& to your first Zeitmessung again zurücksetzten...

Ausserdem misst You not The speed the Assemblerroutine, separate The duration one Dll-Call. where You The Dll not even into memory lädts.

my Messungen confirm my testimony of today afternoon. your routine needed for Loop 344 Millisekunden, if I these hundred millions(!) times through let. my routine needed for same Schleifenanzahl 172 Millisekunden. this is exakt twice so quick!

here The simple Testroutine, with the You anytime my code against your replace can to that testing:
CompileMarkSeparation
 {$cleq}
declare ogl_rgb#,y&
var groesse%=100000000
dim ogl_rgb#,groesse%
cls
Sleep 3000
y&=&GetTickCount

AsmStart rgb_farbe (ogl_rgb#,groesse%)

    mov edi,para2
    xor ecx,ecx
    mov ebx,para1

    .while ecx<=edi

        mov al,[ebx]
        mov cl,[ebx+1]
        mov dl,[ebx+2]

        .if al>252

            mov eax,255
            .break

        .endif

        .if cl>252

            mov eax,255
            .break

        .endif

        .if dl>252

            mov eax,255
            .break

        .endif

        lea ebx,[ebx+4]
        lea ecx,[ecx+4]

    .endw

AsmEnd(z%)

Print Str$(Int(&GetTickCount-y&))
WaitInput
dispose ogl_rgb#
/../funcion-referencias/XProfan/end/'>End

be in future vorsichtiger with your allegations. i want not, that of of my software and of Assembler at all one Wrong Image arise, only because You fehlerhafte testify verbreitest because of your fehlerhaften Testverfahren and Codes.
 
08/22/08  
 



The 1. Time ca 4000ms

The 2. Time ca 200ms

The 3. Time ca 8000ms

this Testprogramm is from this Forum.
one must always mißtrauischer go, traue keinem strangers Program.
I have such a thing already geahnt.

I have me times the Taktcyklen herausgesucht and umgerechnet. I come almost on your Time.
such a thing sharpens whom spirit, but nevertheless scheiss work.

power over ands over again joke.

this is program. high lebe The Own Überprüfung.

so now go to that next Topic....., it goes on Jungs and Mädels.

mfg
 
08/22/08  
 




Frank
Abbing
look you my code still on.
You misst whom Dll-appeal, the has with Assemblergeschwindigkeit mere none To do.

what misstrauisch? XPIA is my Program.
 
08/22/08  
 



Frank you are super.
too these runs with your Messung and your ASM-suggestion only concise 300ms. this is still what. super thing. there was the worm drin.

have it with of/ one FreeBasic-DLL tested, need 532ms.
can means hochgerechnet ca per second 93 Images evaluate with 128*128*4 Pixel with a Framerate of 30 or can with 970ms ca 53 BMP-Textures reading.
CompileMarkSeparation
CompileMarkSeparation
DEF rgb_farbe(2) !"ogl-dll.dll","rgb_farbe"
declare ogl_rgb#,y&,z%
var groesse%=100000000
dim ogl_rgb#,groesse%
cls
Sleep 1000
print "test"
y&=&GetTickCount
z%=rgb_farbe(ogl_rgb#,groesse%)
Print Str $(Int(&GetTickCount-y&))
WaitInput
dispose ogl_rgb#
End
 
08/22/08  
 



so, this issue is now first once through for my tack.
in the attachment as zipper : an Collison with a Viereck. Objektsteuerung with the Keys : QWES.
thereby The FreeBascic Bas, woraus I The beiliegende DLL prepares have with the Program FreeBasic.
as nächstes comes evtl one unregelmäßiges Kollisionsobjekt.

Perhaps creates the too another Forum-User.

my Schwerpunkt remaining first once with 2D.

mfg
peter

9 kB
Hochgeladen:08/23/08
Downloadcounter123
Download
 
08/23/08  
 




Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

11.022 Views

Untitledvor 0 min.
Tango10/30/21
Sven Bader08/01/21
H.Brill10/08/20
funkheld05/25/16
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie