• Welcome to Theos PowerBasic Museum 2017.

BassBox

Started by Patrice Terrier, October 08, 2007, 10:57:44 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Kent Sarikaya

I never heard distortion with the soundscapeA plugin, but I don't listen to music too loudly.
I do like the landscape with the new coding mods.

Charles, Is there a way to make the horizon wider so it goes off of the edge of the plugin screen?
It would look more like a planet's surface one was flying over that way.

Charles Pegge


This has been stretched in the X axis, so you have a full horizon, even on a wide screen. I would like to do a proper planetary surface so you could travel in any direction. but the logistics are more tricky for doing this.

But if you click on the scene then press the spacebar, you will be able to travel in reverse :)

Kent Sarikaya

Thanks Charles, looks and works great!!

Patrice Terrier

#393
--Charles

Here is my feedback for the new Soundscapea version.


  • Sound distortion still there while playing in full screen, but only when using the second monitor in dual display mode.
  • No sound distortion while playing in 1440 x 900 on my laptop built-in screen.
  • Using full horizon, makes the whole scene more like a planet than in "star war" mode.
  • Being able to swap between "far" and "near" is a nice addition.
  • You can also use the new audio duration parameters to swap between far/near or fade in/fade out.
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Charles Pegge

Many thanks, I am reworking the first soundscape. Did you get any audio distortion with that? It generates the landscape from scratch on every frame-so it works a lot harder CPU side but less work for the GPU because it uses GL_QUAD_STRIPs instead of isolated quads with individual textures.
And I didnt compile the planet either.

I hope to make use of the audio duration parameters very soon.

Petr Schreiber

Hi Charles,

new version is very nice!
I am "sorry" to report I cannot experience any sound distortion :)

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

psch.thinbasic.com

Petr Schreiber

Charles,

when I disable overlays I immediately get same FPS "fullscreen" and windowed.
What about replacing multiple blended polys with fog ? ( +possible one fake blue overlay ).

Blending is one of the perfect functions in OpenGL, but low end usually suffers on it a lot. As it is per pixel it is very resolution-sensitive.
OpenGL fog "classic" ( not via shader ) is per vertex operation, could give better speed and usable results :)


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

psch.thinbasic.com

Charles Pegge


Yes, I am trying a single overlay on the first Soundscape, a little fog may help but I want to keep the stars fairly clear. That is a good point you make about multiple blending which involves multi pass processing of  of pixels covering a large portion of the screen in Max mode.



Petr Schreiber

Hi Charles,

I was thinking of enableing fog just for terrain, for stars and planet disable it.
Regarding overlay - it could be 5 quads with color gradients, see attached image.
Maybe then even the fog would not be needed so much?


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

psch.thinbasic.com

Charles Pegge

Thanks Petr, this is a very similar idea and gives the best gradation of tint so far. It's a stretched pyramid with the peak pointing towards the horizon.


         'DO
         '    IF i>12 THEN EXIT DO
         '    glTranslatef 0,0,1
         '    glCallList 2 ' transparent blue overlays
         '    INCR i
         'LOOP
         glPopMatrix
         ' diffuse atmosphere
         glBegin GL_TRIANGLE_FAN
         glcolor4f 0.1,0.2,0.8,0.4
         glvertex3f  0,0,-15
         glcolor4f 0.1,0.2,0.8,0.0
         glvertex3f  -20,-1, 2
         glvertex3f   20,-1, 2
         glvertex3f   20, 6, -1
         glvertex3f  -20, 6, -1
         glvertex3f  -20,-1, 2
         glend
         
         glFlush

RETURN ' end of scene


To keep the BennyBenassi peaks from beaking through I have changed the 'atten' threshold from 4 to 2. I think they look better anyway. Passion under control..


                     v=SQR(fft(k+8))*8*atten
                     IF v>2 THEN atten=2/v ' attenuation
                     IF v=0 THEN v=RND*.4: atten=1 ' restore sensitivity
                     vf(i1)=v




Patrice Terrier

#400
--Charles

About soundscapea and consor:

Sound distortion problem is solved when the call to "transparent blue overlays" is removed!
         'DO
         '    IF i>12 THEN EXIT DO
         '    glTranslatef 0,0,1
         '    glCallList 2 ' transparent blue overlays
         '    INCR i
         'LOOP

Using "diffuse atmosphere" doesn't cause sound distortion either, however there is a culling problem as you can see on the attached jpeg screen shot.
         ' diffuse atmosphere
         glBegin GL_TRIANGLE_FAN
         glcolor4f 0.1,0.2,0.8,0.4
         glvertex3f  0,0,-15
         glcolor4f 0.1,0.2,0.8,0.0
         glvertex3f  -20,-1, 2
         glvertex3f   20,-1, 2
         glvertex3f   20, 6, -1
         glvertex3f  -20, 6, -1
         glvertex3f  -20,-1, 2
         glend

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

Charles Pegge

Thanks Patrice, I hope we have got to the root of the problem, which was affecting our PCs in different ways.

My current attenuation code limiting the height of the Benassi peaks, cures the problem seen above:
Same as before but 2 instead of 4, and v=2 to clamp the height of the current peak.


                     IF v>2 THEN atten=2/v:v=2 ' attenuation


The peaks are less spectacular by the view of the harmonics is clearer.

Charles Pegge

#402
I like the new textures Patrice and the refinement of the stars with point sprites. I am still experimenting with synthesised textures and find they have to be quite subtle to avoid giving the viewer a migraine with pixelation effects. The more detailed a texture becomes, the finer the color gradation has to be. Your subtle bg9 snowy texture is an ideal candidate for algorithmic generation.

Considering what other elements could be added to the Soundscapes: - perhaps some meteor/fireworks in the distance.

As I am in an analytical mood this evening, I have been checking to see if the textures are managed correctly when no longer needed. glDeleteTextures only works on a valid list of texture numbers, so the way you use it to predelete textures does not work. And My various attempts to delete the textures at %BBP_DESTROY using the texture numbers from your BBTexture mt() did not work either. - for some obscure reason. So I have resorted to brute force by creating an artificial list of texture numbers and telling Opengl to eliminate them. This works. The texture deletion in SoundscapeA also works correctly - the texture numbers are held in a global contiguous array so they are easy to get at.

The symptom of undeleted textures is that the texture numbers (ie names) go up whenever a new plugin is invoked.

This sort of bug does not cause any visible problems until the Graphics hardware gets full.

Inserted into %BBP_DESTROY

         ' This did not work - tried all sorts of variations
         'j=UBOUND(mt)
         'FOR i=1 TO j
         '    MSGBOX STR$(mt(i).texture)
         '    k=mt(i).texture
         '    CALL glDeleteTextures (1,k)
         'NEXT

         ' This brutal method works apparently without causing any problems.
         ' and could be safely used in other textured plugins
         j=32
         REDIM dt(j) AS LOCAL LONG
         FOR i=1 TO j:dt(i)=i:NEXT
         glDeleteTextures j,dt(1)
         ' msgbox str$(glGetError)



Charles Pegge


For a number of operations it is desirable to initialise once only. So I use a flag called 'inito' to prevent multiple initialisations of the plugin. This flag can also be used to prevent a plugin from being destroyed before it is created.
BassBox sends a %BBP_DESTROY message to all plugins when it is started. This could be a problem for future plugins which use complex resources, without some protection against premature destruction.


    STATIC inito AS LONG

    '...

    CASE %BBP_INIT
         '// Do your code initialisation there
         IF inito=1 THEN EXIT FUNCTION
         inito=1

         '...

    CASE %BBP_DESTROY

         '// Free up your resources there
         IF inito=0 THEN EXIT FUNCTION



Patrice Terrier

#404
--Charles (and others)

I shall follow your advice to use the brute force to delete the textures, but i'll do it in BassBox in BBP_Detached, to avoid doing it in each of the plugin.

By the way do you have any idea of the maximum texture number that could be used simultaneously? (32 is that the maximum).

Also look at the new constant:
%BBP_NO_REGISTRY = 1 ' Disable registry support
%BBP_NO_IOFILE     = 1 ' Disable file I/O support
%BBP_NO_GLFONT   = 1 ' Disable GL font support
#INCLUDE "Include\BBPlugin.inc"
 
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com