• Welcome to Theos PowerBasic Museum 2017.

BassBox 2011 (version 2.60)

Started by Patrice Terrier, January 07, 2009, 09:03:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Petr Schreiber

AMD Sempron 3400+ | 1GB RAM @ 533MHz | GeForce 6200 / GeForce 9500GT | 32bit Windows XP SP3

psch.thinbasic.com

Patrice Terrier

Jürghen

You have done a tremendous work, bravo !

I have been running it, in full HD mode 1920 x 1080 with an average use of 30% on my XP HXD 18 (Dual Core 2 Duo) using your Enhanced mode.

See attached screen shot.

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Patrice Terrier

#32
QuoteWich "Graphic Processing Unit" do you have in your Computer
NVIDIA GeForce 9600M GT with 512 Mb of dedicated video RAM + 1790 Mb of shared memory.

Dual display: main display is running in full HD mode 1920 x 1080, second display in 1600 x 1200.

OS Windows 7 running in full AERO composited mode.

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Petr Schreiber

#33
Hi Jürgen,

thanks a lot for new plugin, it ran fine on my PC (in signature).
I got around 34FPS and 60 to 70% CPU usage, thanks to being just single core I guess :)


Petr
AMD Sempron 3400+ | 1GB RAM @ 533MHz | GeForce 6200 / GeForce 9500GT | 32bit Windows XP SP3

psch.thinbasic.com

Jürgen Huhn

#34
Hi Petr,

thank`s a lot for your feedback and the technical Information.
This give me the confirmation for the right adjustment of speed in the plugin.
But it's faster on your Machine as i thought.
That`s nice, thank you!

The Screenshot show CPU usage of my System at Fullscreen..

...

.¸.•'´¯)¸.•'´¯)¸.•'´¯)¸.•'´¯)
¤ª"˜¨¨¯¯¨¨˜"ª¤....¤ ª"˜¨

Jürgen Huhn

Quote from: Patrice Terrier on January 04, 2010, 05:55:36 PM

OS Windows 7 running in full AERO composited mode.

...


Patrice!

You are on Windows 7..

Maybe this Article about Windows 7's 'GodMode' is also interesting for you:
http://news.cnet.com/8301-13860_3-10423985-56.html

;)
.¸.•'´¯)¸.•'´¯)¸.•'´¯)¸.•'´¯)
¤ª"˜¨¨¯¯¨¨˜"ª¤....¤ ª"˜¨

Jürgen Huhn

#36
Update for Matrix-Sequences-V1.0!!

The first post of this thread has been updated to JH_Matrix-Sequences-V1.1
I reworked the Plugin this Sunday and improved the Colormodes, Enhancedmode and one more time the Speed of the Fall.
The Animation is a bit faster but also smoother,more compatible with older Computer and has a new Perspective.
Adding the registry Function`s to be able to save the current Setting`s of the Plugin to the Registry is also be done..
At last i removed the glGetstring an glGeterror Function`s, e.t.c. from the main Code of the Plugin and
created a glGetMessage.inc to provide the usage of glErrorhandling also fo other Plugin`s.

The new BBPlugin is only a part from my Matrix-X Project that must been posted before
BassBox lurkers reach the number of 100 000!

A final Version is in work..

Here is the link to get the new BBPlugin:

http://www.jose.it-berater.org/smfforum/index.php?topic=2975.msg11395#msg11395

Patrice!

I hope this Plugin come up to your exeption's.
If you have a special Idear for the Plugin, tell me!
I will be see what i can do, because my Brain produced the code.
Based on your Idear!!    ;D

...
.¸.•'´¯)¸.•'´¯)¸.•'´¯)¸.•'´¯)
¤ª"˜¨¨¯¯¨¨˜"ª¤....¤ ª"˜¨

Patrice Terrier

Jürgen

I like the new perspective, because it looks closer to the original Matrix.

I would suggest to preserve the original ratio of the texture being used in the background, like in the "Interference" plugin, then I could post some nice new textures that would make it more futuristic.

I would also use peek detection to display the fire effect in the rythm of the audio stream, like with the "FireWorks" plugin.  

And i would play the whole animation like in the "HAL" plugin, see the speed rotation that increase or decrease based on the audio flow.

Keep up the good work!

...

Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Jürgen Huhn

Patrice,

sorry for late reply! Busy..

To improve the Background was also in my Mind, but in the Moment no more Idears what to do.
That`s what i say, you have always really good Idears for programming!
I don`t have the SourceCode from the "Interference" plugin, only from the "HAL" and the "FireWorks" plugin.
But i`m already thinking how to do it. Thank`s for the Inspiration!
It isn`t much work and i`m sure that gives a very good Effect at the Background.

I would say at first i write the code for the new Background and when it`s done, i post the Code.
So you be able to implement the new Texture`s, while i find Solution`s for the next Step`s.

Quote from: Patrice Terrier on January 11, 2010, 12:07:58 PM

I like the new perspective, because it looks closer to the original Matrix.


To be closer at the Perspective to the original Matrix was my intension to adjust it, because that`s one
of the Part`s wich must be included and i will try to rework also the Perspective one more time at this Step.

...  ;)
.¸.•'´¯)¸.•'´¯)¸.•'´¯)¸.•'´¯)
¤ª"˜¨¨¯¯¨¨˜"ª¤....¤ ª"˜¨

Patrice Terrier

Jürgen,

For the background what you have to do, is to preserve the aspect such as a grid of squares keep the same width and height for each cell. The background texture i will use are 1024 x 512 or 512 x 256, to be HD and wide screen compatible.

Here is the source code of the "Interference" plugin project:


'+--------------------------------------------------------------------------+
'|                                                                          |
'|                              Interference                                |
'|                          BassBox OpenGL plugin                           |
'|                                                                          |
'|                              Version 1.01                                |
'+--------------------------------------------------------------------------+
'|                                                                          |
'|                         Author Patrice TERRIER                           |
'|                                                                          |
'|                            copyright(c) 2009                             |
'|                                                                          |
'|                Patrice Terrier http://www.zapsolution.com                |
'|                                                                          |
'+--------------------------------------------------------------------------+
'|                  Project started on : 01-02-2009 (MM-DD-YYYY)            |
'|                        Last revised : 01-24-2009 (MM-DD-YYYY)            |
'+--------------------------------------------------------------------------+
'

#COMPILE DLL "Interference.dll"
#INCLUDE "Include\BBPlugin.inc"

%GL_BLEND                       = &H0BE2
%GL_MODELVIEW                   = &H1700
%GL_PROJECTION                  = &H1701
%GL_DEPTH_TEST                  = &H0B71
%GL_SMOOTH                      = &H1D01
%GL_LIGHT0                      = &H4000???
%GL_TRIANGLE_FAN                = &H0006
%GL_DEPTH_BUFFER_BIT            = &H00000100
%GL_COLOR_BUFFER_BIT            = &H00004000
%GL_QUADS                       = &H0007???
%GL_QUAD_STRIP                  = &H0008???
%GL_FRONT_AND_BACK              = &H0408???
%GL_AMBIENT_AND_DIFFUSE         = &H1602???
%GL_COLOR_MATERIAL              = &H0B57???
%GL_UNSIGNED_BYTE               = &h1401&
%GL_QUADS                       = &h0007&
%GL_COLOR_BUFFER_BIT            = &h4000&
%GL_DEPTH_BUFFER_BIT            = &h0100&
%GL_MATRIX_MODE                 = &h0BA0&
%GL_PROJECTION                  = &h1701&
%GL_SMOOTH                      = &h1D01&
%GL_SRC_ALPHA                   = &h0302&
%GL_ONE                         = &h0001&
%GL_LINEAR                      = &h2601&
%GL_PERSPECTIVE_CORRECTION_HINT = &h0C50&
%GL_NICEST                      = &h1102&
%GL_TEXTURE_2D                  = &h0DE1&
%GL_TEXTURE_MAG_FILTER          = &h2800&
%GL_TEXTURE_MIN_FILTER          = &h2801&
%GL_LUMINANCE                   = &h1909&
%GL_RGB                         = &H1907
%GL_RGBA                        = &H1908
%GL_TEXTURE                     = &H1702
%GL_LIGHTING                    = &H0B50
%GL_GREATER                     = &H0204
%GL_POSITION                    = &H1203???
%GL_LIGHT_MODEL_TWO_SIDE        = &H0B52???
%GL_NORMALIZE                   = &H0BA1???
%GL_AMBIENT                     = &H1200???
%GL_DIFFUSE                     = &H1201???
%GL_SPECULAR                    = &H1202???
%GL_POSITION                    = &H1203???
%GL_TRUE                        = 1
%GL_FALSE                       = 0
%GLU_SMOOTH                     = 100000
%GL_LESS                        = &H0201

TYPE RECT
    nLeft AS LONG
    nTop AS LONG
    nRight AS LONG
    nBottom AS LONG
END TYPE

' -- WinAPI useful functions
DECLARE FUNCTION GetTickCount LIB "KERNEL32.DLL" ALIAS "GetTickCount" () AS DWORD
DECLARE FUNCTION GetClientRect LIB "USER32.DLL" ALIAS "GetClientRect" (BYVAL hwnd AS DWORD, lpRect AS RECT) AS LONG

' -- For V-Sync control we need to get address of extensions
DECLARE FUNCTION wglGetProcAddress LIB "opengl32.dll" ALIAS "wglGetProcAddress" (lpStr AS ASCIIZ) AS LONG
' -- Advanced feature to keep vertical sync on
DECLARE FUNCTION prototype_wglSwapIntervalEXT( BYVAL number AS LONG ) AS LONG

DECLARE SUB glColor4ub LIB "OPENGL32.DLL" ALIAS "glColor4ub" (BYVAL red AS BYTE, BYVAL green AS BYTE, BYVAL blue AS BYTE, BYVAL Alpha AS BYTE)
DECLARE SUB glNormal3f LIB "OPENGL32.DLL" ALIAS "glNormal3f" ( BYVAL SINGLE, BYVAL SINGLE, BYVAL SINGLE )
DECLARE SUB gluLookAt LIB "glu32.dll" ALIAS "gluLookAt" (BYVAL eyex#, BYVAL eyey#, BYVAL eyez#, BYVAL centerx#, BYVAL centery#, BYVAL centerz#, BYVAL upx#, BYVAL upy#, BYVAL upz AS DOUBLE)
DECLARE SUB glColorMaterial LIB "OPENGL32.DLL" ALIAS "glColorMaterial" ( BYVAL DWORD, BYVAL DWORD )
DECLARE SUB glEnd LIB "opengl32.dll" ALIAS "glEnd"
DECLARE SUB glLoadIdentity LIB "opengl32.dll" ALIAS "glLoadIdentity"
DECLARE SUB glBegin LIB "opengl32.dll" ALIAS "glBegin" (BYVAL LONG)
DECLARE SUB glClear LIB "opengl32.dll" ALIAS "glClear" (BYVAL DWORD)
DECLARE SUB glEnable LIB "opengl32.dll" ALIAS "glEnable" (BYVAL DWORD)
DECLARE SUB glDisable LIB "opengl32.dll" ALIAS "glDisable" (BYVAL DWORD)
DECLARE SUB glShadeModel LIB "opengl32.dll" ALIAS "glShadeModel" (BYVAL DWORD)
DECLARE SUB glMatrixMode LIB "opengl32.dll" ALIAS "glMatrixMode" (BYVAL DWORD)
DECLARE SUB glHint LIB "opengl32.dll" ALIAS "glHint" (BYVAL DWORD, BYVAL DWORD)
DECLARE SUB glBlendFunc LIB "opengl32.dll" ALIAS "glBlendFunc" (BYVAL LONG, BYVAL LONG)
DECLARE SUB glTexCoord2f LIB "opengl32.dll" ALIAS "glTexCoord2f" (BYVAL SINGLE, BYVAL SINGLE)
DECLARE SUB glVertex3f LIB "opengl32.dll" ALIAS "glVertex3f" (BYVAL SINGLE, BYVAL SINGLE, BYVAL SINGLE)
DECLARE SUB glTranslatef LIB "opengl32.dll" ALIAS "glTranslatef" (BYVAL SINGLE, BYVAL SINGLE, BYVAL SINGLE)
DECLARE SUB glClearColor LIB "opengl32.dll" ALIAS "glClearColor" (BYVAL SINGLE, BYVAL SINGLE, BYVAL SINGLE, BYVAL SINGLE)
DECLARE SUB glGenTextures LIB "opengl32.dll" ALIAS "glGenTextures" (BYVAL DWORD, textures AS ANY)
DECLARE SUB glBindTexture LIB "opengl32.dll" ALIAS "glBindTexture" (BYVAL DWORD, BYVAL DWORD)
DECLARE SUB glTexParameteri LIB "opengl32.dll" ALIAS "glTexParameteri" (BYVAL DWORD, BYVAL DWORD, BYVAL LONG)
DECLARE SUB glTexImage2D LIB "opengl32.dll" ALIAS "glTexImage2D" (BYVAL DWORD, BYVAL LONG, BYVAL LONG, BYVAL LONG, BYVAL LONG, BYVAL LONG, BYVAL DWORD, BYVAL DWORD, npixels AS ANY)
DECLARE SUB glDeleteTextures LIB "opengl32.dll" ALIAS "glDeleteTextures" (BYVAL LONG, textures AS ANY)
DECLARE FUNCTION glGetError LIB "opengl32.dll" ALIAS "glGetError" () AS DWORD
DECLARE FUNCTION wglMakeCurrent LIB "OPENGL32.DLL" ALIAS "wglMakeCurrent" (BYVAL hdc AS DWORD, BYVAL hglrc AS DWORD) AS LONG
DECLARE SUB gluPerspective LIB "glu32.dll" ALIAS "gluPerspective" (BYVAL fovy#, BYVAL aspect#, BYVAL zNear#, BYVAL zFar AS DOUBLE)
DECLARE SUB glRotatef LIB "OPENGL32.DLL" ALIAS "glRotatef" (BYVAL angle AS SINGLE, BYVAL x AS SINGLE, BYVAL y AS SINGLE, BYVAL z AS SINGLE)
DECLARE SUB glDepthFunc LIB "OPENGL32.DLL" ALIAS "glDepthFunc" (BYVAL func AS DWORD)
DECLARE SUB glLightfv LIB "OPENGL32.DLL" ALIAS "glLightfv" ( BYVAL DWORD, BYVAL DWORD, BYREF SINGLE )
DECLARE SUB glLightModeli LIB "OPENGL32.DLL" ALIAS "glLightModeli" ( BYVAL DWORD, BYVAL LONG )
DECLARE SUB glScalef LIB "OPENGL32.DLL" ALIAS "glScalef" ( BYVAL SINGLE, BYVAL SINGLE, BYVAL SINGLE )
DECLARE SUB glMaterialf LIB "OPENGL32.DLL" ALIAS "glMaterialf" ( BYVAL DWORD, BYVAL DWORD, BYVAL SINGLE )
DECLARE SUB glClearDepth LIB "opengl32.dll" ALIAS "glClearDepth" (BYVAL DOUBLE)
DECLARE SUB glDepthMask LIB "OPENGL32.DLL" ALIAS "glDepthMask" ( BYVAL BYTE )
DECLARE SUB glAlphaFunc LIB "OPENGL32.DLL" ALIAS "glAlphaFunc" (BYVAL func AS DWORD, BYVAL ref AS SINGLE)
DECLARE SUB glColor4f LIB "opengl32.dll" ALIAS "glColor4f" (BYVAL SINGLE, BYVAL SINGLE, BYVAL SINGLE, BYVAL SINGLE)

DECLARE FUNCTION gluNewQuadric  LIB "glu32.dll" ALIAS "gluNewQuadric"  () AS LONG
DECLARE SUB gluDeleteQuadric    LIB "glu32.dll" ALIAS "gluDeleteQuadric"   (BYVAL state AS ANY)
DECLARE SUB gluQuadricNormals   LIB "glu32.dll" ALIAS "gluQuadricNormals"  (BYVAL quadObject AS ANY, BYVAL normals AS DWORD)
DECLARE SUB gluQuadricTexture   LIB "glu32.dll" ALIAS "gluQuadricTexture"  (BYVAL quadObject AS ANY, BYVAL textureCoords AS DWORD)' ANY)
DECLARE SUB gluSphere      LIB "glu32.dll" ALIAS "gluSphere" (BYVAL qobj AS ANY, BYVAL radius#, BYVAL slices&, BYVAL stacks AS LONG)
DECLARE SUB gluDisk   LIB "glu32.dll" ALIAS "gluDisk"   (BYVAL qobj AS DWORD, BYVAL innerRadius#, BYVAL outerRadius#, BYVAL slices&, BYVAL loops AS LONG)

GLOBAL gColor() AS LONG
SUB ColorInit()
    DIM gColor(1 TO 33) AS LONG
    gColor(1)  = RGB(32,32,32)
    gColor(2)  = RGB(0,44,233)
    gColor(3)  = RGB(0,67,210)
    gColor(4)  = RGB(0,89,187)
    gColor(5)  = RGB(0,112,164)
    gColor(6)  = RGB(0,135,142)
    gColor(7)  = RGB(0,159,117)
    gColor(8)  = RGB(0,183,88)
    gColor(9)  = RGB(0,207,58)
    gColor(10) = RGB(0,231,29)
    gColor(11) = RGB(26,234,26)
    gColor(12) = RGB(52,237,23)
    gColor(13) = RGB(79,240,20)
    gColor(14) = RGB(105,243,17)
    gColor(15) = RGB(126,245,14)
    gColor(16) = RGB(147,248,11)
    gColor(17) = RGB(168,250,8)
    gColor(18) = RGB(189,253,5)
    gColor(19) = RGB(210,255,2)
    gColor(20) = RGB(233,255,0)
    gColor(21) = RGB(255,255,0)
    gColor(22) = RGB(255,251,0)
    gColor(23) = RGB(255,235,0)
    gColor(24) = RGB(255,215,0)
    gColor(25) = RGB(255,196,0)
    gColor(26) = RGB(255,176,0)
    gColor(27) = RGB(255,156,0)
    gColor(28) = RGB(253,137,0)
    gColor(29) = RGB(255,117,0)
    gColor(30) = RGB(255,97,0)
    gColor(31) = RGB(255,78,0)
    gColor(32) = RGB(255,58,0)
    gColor(33) = RGB(255,0,0)
END SUB

FUNCTION LevelColr(BYVAL nLevel AS LONG) AS LONG
    LOCAL nColor AS LONG
    nLevel = nLevel + 1: IF nLevel > 33 THEN nLevel = 33
    nColor = 0: IF nLevel > 0 THEN nColor = gColor(nLevel)
    FUNCTION = nColor
END FUNCTION

DECLARE SUB gluCylinder LIB "GLU32.DLL" ALIAS "gluCylinder" (BYVAL DWORD, BYVAL DOUBLE, BYVAL DOUBLE, BYVAL DOUBLE, BYVAL LONG, BYVAL LONG)
SUB DrawCylinder(BYVAL Radius AS SINGLE, BYVAL Value AS SINGLE, BYVAL R1 AS SINGLE, BYVAL R2 AS SINGLE)
    LOCAL quadObj AS LONG
    quadObj = gluNewQuadric()                        ' Pointer to the Quadric Object (Return 0 If No Memory))
    IF quadObj THEN
       CALL gluQuadricNormals(quadObj, %GLU_SMOOTH)  ' Create Smooth Normals
       CALL gluQuadricTexture(quadObj, %GL_TRUE)     ' Create Texture Coords
       CALL gluCylinder(quadObj, Radius * R1, Radius * R2, Value, 24, 1)
       CALL gluDeleteQuadric(quadObj)
    END IF
END SUB

SUB DrawDisk(BYVAL Radius AS SINGLE)
    LOCAL quadObj AS LONG
    quadObj = gluNewQuadric()                        ' Pointer to the Quadric Object (Return 0 If No Memory))
    IF quadObj THEN
       CALL gluQuadricNormals(quadObj, %GLU_SMOOTH)  ' Create Smooth Normals
       CALL gluQuadricTexture(quadObj, %GL_TRUE)     ' Create Texture Coords
       CALL gluDisk(quadObj, 0.0, Radius, 32, 32)
       CALL gluDeleteQuadric(quadObj)
    END IF
END SUB

'// Renders flat square
SUB RenderSquare(BYVAL edge AS SINGLE)
    edge = edge / 2
    CALL glBegin(%GL_QUADS)
       CALL glTexCoord2f(0.0, 0.0): CALL glVertex3f(-edge,-edge, 0.0)
       CALL glTexCoord2f(1.0, 0.0): CALL glVertex3f( edge,-edge, 0.0)
       CALL glTexCoord2f(1.0, 1.0): CALL glVertex3f( edge, edge, 0.0)
       CALL glTexCoord2f(0.0, 1.0): CALL glVertex3f(-edge, edge, 0.0)
    CALL glEnd()
END SUB

GLOBAL gsR(), gsG(), gsB() AS SINGLE
SUB MakeColorLUT()
    LOCAL K, RGBColor AS LONG
    DIM gsR(255), gsG(255), gsB(255) AS SINGLE
    FOR K = 0 TO 255
        RGBColor = LevelColr(K)
        gsR(K) = (BBP_GetRValue(RGBColor) + 1) / 256
        gsG(K) = (BBP_GetGValue(RGBColor) + 1) / 256
        gsB(K) = (BBP_GetBValue(RGBColor) + 1) / 256
    NEXT
END SUB

'// The main exported plugin's function would be bbProc, like this:
FUNCTION BBProc ALIAS "BBProc" (BYREF BBP AS BBPLUGIN) EXPORT AS LONG
    REGISTER K AS LONG

    LOCAL nRet AS LONG

    DIM mt(1 TO 6) AS STATIC BBPTEXTURE
    LOCAL rc AS RECT
    DIM Vec4(3) AS LOCAL SINGLE

    STATIC ptr_wglSwapIntervalEXT AS DWORD, rAspect AS DOUBLE
    nRet = %BBP_SUCCESS

    SELECT CASE LONG BBP.Msg
    CASE %BBP_RENDER
         '// Draw the scene using BBP.LeftPeak and BBP.RightPeak
         LOCAL nLValue, nRValue, nValue, RGBColor, quadObj AS LONG
         LOCAL xD, pulse AS DOUBLE, cbA, cbR, cbG, cbB AS BYTE


         nLValue = (BBP.Lpeak / 700)
         nRValue = (BBP.Rpeak / 768)
         nValue = MAX&(nLValue, nRValue)

         '// Pulsating section
         pulse = nValue / 7
         '// Velocity section
         pulse = ABS(pulse / 4)

         CALL glClear(%GL_COLOR_BUFFER_BIT OR %GL_DEPTH_BUFFER_BIT)
         CALL glLoadIdentity()

         CALL gluLookAt(0.0, 0.0, 15.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0)

         CALL glEnable(%GL_LIGHTING)
         CALL glEnable(%GL_BLEND)

         '// Draw the fixed background -------------------------
         CALL glBindTexture(%GL_TEXTURE_2D, mt(4).Texture)
         CALL glBegin(%GL_QUADS)
            CALL glColor4ub(60,60,64,64)
            CALL glTexCoord2f(0.0, 0.0): CALL glVertex3f(-85,-45,-85.01) ' Bottom Left Of The Texture And Quad
            CALL glTexCoord2f(1.0, 0.0): CALL glVertex3f( 85,-45,-85.01) ' Bottom Right Of The Texture And Quad
            CALL glTexCoord2f(1.0, 1.0): CALL glVertex3f( 85, 45,-85.01) ' Top Right Of The Texture And Quad
            CALL glTexCoord2f(0.0, 1.0): CALL glVertex3f(-85, 45,-85.01) ' Top Left Of The Texture And Quad
         CALL glEnd()

         RGBColor = LevelColr(nValue)
         cbR = BBP_GetRValue(RGBColor)
         cbG = BBP_GetGValue(RGBColor)
         cbB = BBP_GetBValue(RGBColor)
         CALL glColor4ub(cbR , cbG , cbB, 64)'255)
         CALL glBindTexture(%GL_TEXTURE_2D, mt(4).Texture)
         CALL glBegin(%GL_QUADS)
            'CALL glColor4f(1.0,1.0,1.0,1.0)'0.5,0.5,0.5,0.5)
            CALL glTexCoord2f(0.0, 0.0): CALL glVertex3f(-85,-45,-85) ' Bottom Left Of The Texture And Quad
            CALL glTexCoord2f(1.0, 0.0): CALL glVertex3f( 85,-45,-85) ' Bottom Right Of The Texture And Quad
            CALL glTexCoord2f(1.0, 1.0): CALL glVertex3f( 85, 45,-85) ' Top Right Of The Texture And Quad
            CALL glTexCoord2f(0.0, 1.0): CALL glVertex3f(-85, 45,-85) ' Top Left Of The Texture And Quad
         CALL glEnd()
         '// ----------------------------------------------------

         CALL glDisable (%GL_LIGHTING)
       
''''''''''''''''''''''''''''''''
         DIM fft(BBP.FFTsize) AS SINGLE AT BBP.FFTdata
         DIM SoundBuffer(BBP.FFTsize) AS SINGLE
         LOCAL Cz AS LONG, Ax, Ay AS SINGLE

         Cz = -30

         '// Try and smooth out the buffer by averaging the last results:
         FOR K = 0 TO 255
             '// We use SQR to bring out the midtone of the music, otherwise the spectrum is very flat.
             '// And fortunatly SQR is highy optimized in PowerBASIC
             SoundBuffer(K) = SQR( SQR(fft(K)) * 2)
         NEXT

         '// Start drawing podium lights
         '// The iterator K goes from 0 (deepest bass) to 255 (highest treble pitch)
         '// Ax is the distance from the center. Ay & By are width and height of the flares.
         CALL glDisable(%GL_DEPTH_TEST)

         K = 1
            CALL glLoadIdentity()
            CALL glTranslatef(0.0, -8.75, Cz)
            CALL glRotatef(-90, 1.0, 0.0, 0.0)
            Ax = -14.3
            Ay = 2 + SoundBuffer(K) * 15
            CALL glColor4f(gsR(K) * SoundBuffer(K), gsG(K) * SoundBuffer(K), gsB(K) * SoundBuffer(K), 0.7)
            CALL glTranslatef(Ax, 0.0, 0.0)
            CALL glRotatef((GetTickCount * pulse) / (pulse * 22), 0.0, 0.0, 1.0)

            CALL glBindTexture(%GL_TEXTURE_2D, mt(6).Texture)
            CALL DrawDisk(1.80)
            CALL glBindTexture(%GL_TEXTURE_2D, mt(5).Texture)
            CALL DrawCylinder(1.80, Ay, SoundBuffer(K), 1.0/SoundBuffer(K))

         K = 33
            CALL glLoadIdentity()
            CALL glTranslatef(0.0, -8.55, Cz)
            CALL glRotatef(-90, 1.0, 0.0, 0.0)
            Ax = 14.3
            Ay = 2 + SoundBuffer(1) * 15
            CALL glColor4f(gsR(K) * SoundBuffer(K), gsG(K) * SoundBuffer(K), gsB(K) * SoundBuffer(K), 0.7)
            CALL glTranslatef(Ax, 0.0, 0.0)
            CALL glRotatef((GetTickCount * pulse) / (pulse * 22), 0.0, 0.0, 1.0)

            CALL glBindTexture(%GL_TEXTURE_2D, mt(6).Texture)
            CALL DrawDisk(1.80)
            CALL glBindTexture(%GL_TEXTURE_2D, mt(5).Texture)
            CALL DrawCylinder(1.80, Ay, SoundBuffer(1), 1.0/SoundBuffer(1))

         K = 7
            CALL glLoadIdentity()
            CALL glTranslatef(0.0, -7.25, Cz)
            CALL glRotatef(-90, 1.0, 0.0, 0.0)
            Ax = -8.65
            Ay = 2 + SoundBuffer(K) * 3.5
            CALL glColor4f(gsR(K) * SoundBuffer(K), gsG(K) * SoundBuffer(K), gsB(K) * SoundBuffer(K), 0.7)
            CALL glTranslatef(Ax, 0.0, 0.0)
            CALL glRotatef((GetTickCount * pulse) / (pulse * 22), 0.0, 0.0, 1.0)

            CALL glBindTexture(%GL_TEXTURE_2D, mt(6).Texture)
            CALL DrawDisk(1.50)
            CALL glBindTexture(%GL_TEXTURE_2D, mt(5).Texture)
            CALL DrawCylinder(1.50, Ay, 0.1, 2.0)

         K = 27
            CALL glLoadIdentity()
            CALL glTranslatef(0.0, -7.11, Cz)
            CALL glRotatef(-90, 1.0, 0.0, 0.0)
            Ax = 8.60
            Ay = 2 + SoundBuffer(K) * 3.5
            CALL glColor4f(gsR(K) * SoundBuffer(K), gsG(K) * SoundBuffer(K), gsB(K) * SoundBuffer(K), 0.7)
            CALL glTranslatef(Ax, 0.0, 0.0)
            CALL glRotatef((GetTickCount * pulse) / (pulse * 22), 0.0, 0.0, 1.0)

            CALL glBindTexture(%GL_TEXTURE_2D, mt(6).Texture)
            CALL DrawDisk(1.50)
            CALL glBindTexture(%GL_TEXTURE_2D, mt(5).Texture)
            CALL DrawCylinder(1.50, Ay, 0.1, 2.0)

         K = 12
            CALL glLoadIdentity()
            CALL glTranslatef(0.0, -6.55, Cz)
            CALL glRotatef(-90, 1.0, 0.0, 0.0)
            Ax = -2.89
            Ay = 2 + SoundBuffer(K) * 3.5
            CALL glColor4f(gsR(K) * SoundBuffer(K), gsG(K) * SoundBuffer(K), gsB(K) * SoundBuffer(K), 0.7)
            CALL glTranslatef(Ax, 0.0, 0.0)
            CALL glRotatef((GetTickCount * pulse) / (pulse * 22), 0.0, 0.0, 1.0)

            CALL glBindTexture(%GL_TEXTURE_2D, mt(6).Texture)
            CALL DrawDisk(1.40)
            CALL glBindTexture(%GL_TEXTURE_2D, mt(5).Texture)
            CALL DrawCylinder(1.40, Ay, 0.1, 2.0)

         K = 22
            CALL glLoadIdentity()
            CALL glTranslatef(0.0, -6.50, Cz)
            CALL glRotatef(-90, 1.0, 0.0, 0.0)
            Ax = 2.80
            Ay = 2 + SoundBuffer(K) * 3.5
            CALL glColor4f(gsR(K) * SoundBuffer(K), gsG(K) * SoundBuffer(K), gsB(K) * SoundBuffer(K), 0.7)
            CALL glTranslatef(Ax, 0.0, 0.0)
            CALL glRotatef((GetTickCount * pulse) / (pulse * 22), 0.0, 0.0, 1.0)

            CALL glBindTexture(%GL_TEXTURE_2D, mt(6).Texture)
            CALL DrawDisk(1.40)
            CALL glBindTexture(%GL_TEXTURE_2D, mt(5).Texture)
            CALL DrawCylinder(1.40, Ay, 0.1, 2.0)
         '// End of podium lights

         CALL glEnable(%GL_DEPTH_TEST)

         CALL glLoadIdentity()
         CALL gluLookAt(0.0, 0.0, 15.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0)

         CALL glDepthMask(%GL_FALSE)

         '// Drawing the pulsating halo
         CALL glColor4ub(cbR , cbG , cbB, 255)
         CALL glBindTexture(%GL_TEXTURE_2D, mt(3).Texture)
         FOR K = 1 TO 4
             CALL glPushMatrix()
                CALL glTranslatef(0.0, -42.0, 1.0)
                CALL glRotatef(K * 20 + GetTickCount / (K * 100), 0.0, 0.0, 1.0)
                CALL glBegin(%GL_QUADS)
                   CALL glTexCoord2f(0.0, 0.0): CALL glVertex3f(-30,-30,-60.0)
                   CALL glTexCoord2f(1.0, 0.0): CALL glVertex3f( 30,-30,-60.0)
                   CALL glTexCoord2f(1.0, 1.0): CALL glVertex3f( 30, 30,-60.0)
                   CALL glTexCoord2f(0.0, 1.0): CALL glVertex3f(-30, 30,-60.0)
                CALL glEnd()
             CALL glPopMatrix()
         NEXT

         '// Draw star dust
         CALL glBindTexture(%GL_TEXTURE_2D, mt(2).Texture)
         CALL glColor4ub(32, 64, 128, 255)
         FOR K = 1 TO 900 STEP 3
             CALL glPushMatrix()
                CALL glRotatef(K * 20 + GetTickCount/(K * 100 + nValue / 600), 1.0, 0.0, 0.0)
                CALL glRotatef(K * 30 + GetTickCount/(K * 10), 0.0, 1.0, 0.0)
                CALL glTranslatef(0.35, -12.5, 0.0)
                CALL glRotatef(GetTickcount / 100 + K, 0.0, 0.0, 1.0)
                CALL RenderSquare(4 + SIN(K) * 10 * nValue / 80)
             CALL glPopMatrix()
         NEXT

         '// Draw cylinders
         CALL glRotatef(90.0, 1.0, 0.0, 0.0)
         FOR K = 1 TO 1
             CALL glBindTexture(%GL_TEXTURE_2D, mt(5).Texture)
             CALL glColor4ub(cbR \ 4 , cbG \ 4 , cbB, 48)
             CALL glPushMatrix()
                CALL glTranslatef(0.0, 0.0, -8.8)
                CALL glRotatef(-K * 20 + GetTickCount / (-K * 100), 0.0, 0.0, 1.0)
                CALL DrawCylinder(1.98, 15, 1, 1)
             CALL glPopMatrix()

             CALL glBindTexture(%GL_TEXTURE_2D, mt(1).Texture)
             CALL glColor4ub(cbR \ 8 , cbG \ 16 , cbB \ 12, 8)
             CALL glPushMatrix()
                CALL glTranslatef(0.0, 0.0, -8.8)
                CALL glRotatef(K * 20 + GetTickCount / (K * 100), 0.0, 0.0, 1.0)
                CALL DrawCylinder(2.0, 15, 1, 1)
             CALL glPopMatrix()
         NEXT

         CALL glDepthMask(%GL_TRUE)
         CALL glDisable(%GL_BLEND)

         '// Very important we must reassign UseRC to the new UseDC
         '// Note: don't use permanent DC, this produce better and smoother display
         CALL wglMakeCurrent(BBP.DC, BBP.RC)

    CASE %BBP_CREATE
         '// Retrieve plugin details
         BBP.Title    = "Interference"
         BBP.Author   = "Patrice Terrier"
         BBP.Version  = MAKDWD(1, 0) '// Version 1.0"
         BBP.RenderTo = %BBP_OPENGL  '// or %BBP_GDIPLUS, or %BBP_DIRECTX

    CASE %BBP_INIT
         '// Do your code initialisation there

         '// Set random-number seed.
         RANDOMIZE TIMER

         '// May I ask you at which pretty pointer wglSwapIntervalEXT situated is ?
         ptr_wglSwapIntervalEXT = wglGetProcAddress("wglSwapIntervalEXT")
         '// Enables V-Sync at startup
         IF ptr_wglSwapIntervalEXT THEN
            CALL DWORD ptr_wglSwapIntervalEXT USING prototype_wglSwapIntervalEXT(1) 'TO x
            'IF x = 0 THEN Something is terribly wrong
         END IF

         CALL BBP_SplitColorARGB(BBP.BackARGB, A?, R?, G?, B?)
         Alpha! = A? + 1: Red! = R? + 1: Green! = G? + 1: Blue! = B? + 1
         CALL glClearColor(Red! / 256, Green! /256, Blue! / 256, Alpha! / 256)

         CALL glEnable(%GL_DEPTH_TEST)
         CALL glShadeModel(%GL_SMOOTH)
         CALL glEnable (%GL_LIGHTING)
         CALL glEnable (%GL_LIGHT0)
         CALL glColorMaterial (%GL_FRONT_AND_BACK, %GL_AMBIENT_AND_DIFFUSE)
         CALL glEnable(%GL_COLOR_MATERIAL)
         CALL glEnable(%GL_NORMALIZE)
         CALL glBlendFunc(%GL_ONE, %GL_ONE)

         CALL glEnable(%GL_TEXTURE_2D)

         mt(1).FullName = $BBP_PLUGIN_FOLDER + "Texture\oblique.jpg":   mt(1).ID = 1: mt(1).Square = 0
         mt(2).FullName = $BBP_PLUGIN_FOLDER + "Texture\flare0.jpg":    mt(2).ID = 2: mt(2).Square = 0
         mt(3).FullName = $BBP_PLUGIN_FOLDER + "Texture\Crown.png":       mt(3).ID = 3: mt(3).Square = 0
         mt(4).FullName = $BBP_PLUGIN_FOLDER + "Texture\Interference.jpg":    mt(4).ID = 4: mt(4).Square = 0
         mt(5).FullName = $BBP_PLUGIN_FOLDER + "Texture\superbeam.jpg": mt(5).ID = 5: mt(5).Square = 0
         mt(6).FullName = $BBP_PLUGIN_FOLDER + "Texture\texture3.jpg": mt(6).ID = 6: mt(6).Square = 0
         CALL MakeMultipleTexture (BYVAL VARPTR(mt(LBOUND(mt))), UBOUND(mt) - LBOUND(mt) + 1)

         CALL ColorInit()
         CALL MakeColorLUT()

    CASE %BBP_SIZE
         '// The size of the view port has changed.
         CALL GetClientRect(BBP.ParentWindow, rc)

         CALL glMatrixMode(%GL_PROJECTION)
         CALL glLoadIdentity()
         rAspect = 0: IF rc.nBottom THEN rAspect = rc.nRight / rc.nBottom
         CALL gluPerspective(45.0, rAspect, 0.1, 150.0)
         CALL glMatrixMode(%GL_MODELVIEW)

    CASE %BBP_DESTROY
         '// Free up your resources there
         CALL DestroyTexture (BYVAL VARPTR(mt(LBOUND(mt))), UBOUND(mt) - LBOUND(mt) + 1)
         '// Disables V-Sync when the end is near :)
         IF ptr_wglSwapIntervalEXT THEN
            CALL DWORD ptr_wglSwapIntervalEXT USING prototype_wglSwapIntervalEXT(0) 'TO x
           'IF x = 0 THEN Something is terribly wrong
         END IF

    CASE ELSE
        nRet = %BBP_ERROR
    END SELECT

    FUNCTION = nRet
END FUNCTION

SUB MakeMultipleTexture (BYVAL tp AS BBPTEXTURE PTR, BYVAL N AS LONG)
    LOCAL mtCount, K, nRet, xSize, ySize, OkDelete AS LONG
    DIM mt(1 TO N) AS BBPTEXTURE AT tp
    mtCount = UBOUND(mt()) - LBOUND(mt()) + 1
    IF mtCount THEN
       DIM Texture(1 TO mtCount) AS LONG
       FOR K = 1 TO mtCount
           Texture(K) = mt(k).Texture: IF Texture(K) THEN OkDelete = -1
       NEXT
       IF OkDelete THEN CALL glDeleteTextures(mtCount, Texture(1))
       CALL glGenTextures(mtCount, Texture(1)): nRet = glGetError()
       IF nRet = 0 THEN
          FOR K = 1 TO mtCount
              REDIM PixelArray(0) AS BYTE
              IF BBP_CreateGLTextureFromFile(mt(K).FullName, xSize, ySize, PixelArray(), mt(K).Square) THEN
                 mt(k).Texture = Texture(K)
                 CALL glBindTexture(%GL_TEXTURE_2D, Texture(K)): nRet = glGetError
                 IF nRet = 0 THEN
                    CALL glTexParameteri(%GL_TEXTURE_2D, %GL_TEXTURE_MAG_FILTER, %GL_LINEAR)
                    CALL glTexParameteri(%GL_TEXTURE_2D, %GL_TEXTURE_MIN_FILTER, %GL_LINEAR)
                    CALL glTexImage2D(%GL_TEXTURE_2D, 0, 4, xSize&, ySize&, 0, %GL_RGBA, %GL_UNSIGNED_BYTE, PixelArray(0))
                 END IF
              END IF
          NEXT
       END IF
    END IF
END SUB

SUB DestroyTexture(BYVAL tp AS BBPTEXTURE PTR, BYVAL N AS LONG)
    LOCAL K, mtCount, OkDelete AS LONG
    DIM mt(1 TO N) AS BBPTEXTURE AT tp
    mtCount = UBOUND(mt()) - LBOUND(mt()) + 1
    IF mtCount THEN
       DIM Texture(1 TO mtCount) AS LONG
       FOR K = 1 TO mtCount
           Texture(K) = mt(k).Texture: IF Texture(K) THEN OkDelete = -1
       NEXT
       IF OkDelete THEN CALL glDeleteTextures(mtCount, Texture(1))
    END IF
END SUB
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Jürgen Huhn

Patrice!

Thank you very much for all this Information`s and the marvelous Texture`s!
I fix the little Problem with the wrong Colors, it`s no Problem...
Now i will try your new Texture`s!

:)
...
.¸.•'´¯)¸.•'´¯)¸.•'´¯)¸.•'´¯)
¤ª"˜¨¨¯¯¨¨˜"ª¤....¤ ª"˜¨

Jürgen Huhn

#41
First post has been updated...
I fixed the little Problem with the Colors and improved Version 1.1 with the original Background.

http://www.jose.it-berater.org/smfforum/index.php?topic=2975.msg11395#msg11395

...
.¸.•'´¯)¸.•'´¯)¸.•'´¯)¸.•'´¯)
¤ª"˜¨¨¯¯¨¨˜"ª¤....¤ ª"˜¨

Patrice Terrier

#42
Jürgen (and others)

I couldn't resist to put my nose in your code ...

My idea would be to allow the changing of the texture background, as i am doing already with the VORTEX plugin.

See the attached screen shot taken on full HD display

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Jürgen Huhn

Patrice!

I work on it to be HD and wide screen compatible and i think
to do it like the Background from Vortex-Plugin is the best Idear.
Screenshot look's really nice!!

Last Post was only to have quick fixed the color`s in the available Version.

And any changes at the SourceCode are alowed!

Put your nose into the Code, that`s why it`s included in the .zip.

...   :)
.¸.•'´¯)¸.•'´¯)¸.•'´¯)¸.•'´¯)
¤ª"˜¨¨¯¯¨¨˜"ª¤....¤ ª"˜¨

Patrice Terrier

#44
Jürgen

To avoid any interference with you own work, i have renamed the project "Matrix.dll" to replace the old one.

I am also working with Photoshop CS4 to create the new textures and all the glass effects.

Of course, i shall post the source code here once done.

I have also made a new play/pause button for the player, see the attached png files to put in the "DarkCrystal" folder.

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com