• Welcome to Dark Bit Factory & Gravity.
 

Some OpenGL stuff in FreeBasic....

Started by Rattrapmax6, June 14, 2006

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Rattrapmax6

I posted these on the official FreeBasic forums, but perhapse someone here might enjoy these too!

Here was me playing around w/ some of NeHe's tuts to learn motion bluring.... Might fail on ATI cards, dunno, some at FB.net had issues with it...
http://www.xteraco.com/xtrgraphics/myproggies/GL_Radi_Blur.zip

This was just me playing around w/ texture animation.... A = Accelerate, Z = Brake, Left and Right arrows rotate the tires respectively.... Just wind the tires up and hit the brakes to see them heat up....  ;D
http://www.xteraco.com/xtrgraphics/myproggies/Rotor%20Temp.zip

Both of these are x.t.r.GRAPHICS prods....  ;)
-Rattra (x.t.r.GRAPHICS)

zparticle

I'm unable to download anything from your site. Using the links above I get page not found and then the address bar changes to something like this:

http://68.109.27.59:8888/xtrgraphics/myproggies/Rotor%20Temp.zip

Shockwave

Both files download here fine for me, The radial blur seems to have a problem on this comp, Radeon X300 SE Gfx card, I see two cubes with a stone texture rotating around but no radial blur effect unfortunately.

The wheels thing is a nice idea, just need a car to sit on top of it now :)
Thanks for posting.
Shockwave ^ Codigos
Challenge Trophies Won:

Clyde

Nice codes dude. I dont see the radial effect either mate.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.


Challenge Trophies Won:

Blitz Amateur

I saw a VERY faint trace of a radial blur, but it seemed that you used too much transparency.

RADEON X800Pro

Rattrapmax6

Strange, Shows up in full here:


??? Nvidia GeForce 6600 GT .... :P .... Maybe ATI and Nvidia handle alpha differently...
-Rattra (x.t.r.GRAPHICS)

Shockwave

Rel was saying something before about a problem with GL multitexturing on ATI cards.
Shockwave ^ Codigos
Challenge Trophies Won:

Clyde

Now that is very strange, I can now see the radial effect.
Welldone dude/ Cool.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.


Challenge Trophies Won:

Shockwave

I just looked again and I put my eyes virtually against the screen and there is a really, really faint ghosting which looks like it could be a radial blur but my eyes aren't good enough to say for sure.
It's definately nothing like the shot you posted.
Here's what I see.
Shockwave ^ Codigos
Challenge Trophies Won:

Rattrapmax6

#9
As far as I know, it doesn't fall under multitexture.. It lays x-nuber of ortho squares w/ stretched and alpha-faded screen captured texture....

For those w/ FBC, try to adjust the alphaV start, it looks like DIM AS SINGLE alphaV = 0.2 'Start Alpha, and is found in the "Draw_Blur" sub.... If it does anything, you'll be looking for a higher value than 0.2 ....

EDIT: Try this one, I modded the texture capture a lil: http://www.xteraco.com/xtrgraphics/myproggies/GL_Radi_Blur_Test.zip

Here is the blur sub:
SUB Draw_Blur(times AS single, inc AS single)
    'Set the varibles
    DIM AS SINGLE spost = 0 'Texture coord
    DIM AS SINGLE alphainc = .9 / times 'Alpha blen rate
    DIM AS SINGLE alphaV = 0.2 'Start Alpha
   
    glDisable GL_DEPTH_TEST 'Disable depth testing
    glEnable GL_TEXTURE_2D  'Enable testures
    glBlendFunc GL_SRC_ALPHA, GL_ONE 'Set blend mode
    glEnable GL_BLEND 'Enable blending
   
    glBindTexture GL_TEXTURE_2D, Blur_Tex 'Bind the screen blur to texture matrix
   
    OrthMode_() 'Swap to Ortho-mode
   
    alphainc = alphaV / times 'Calculate the blur fade
   
    glBegin GL_QUADS
    DIM i
    FOR i = 1 TO times
        glColor4f (1, 1, 1, alphaV)     'Set alpha fade
        glTexCoord2f (0+spost, 1-spost) 'Set texture and size it
        glVertex2f (0, 0)               'Set vertex   
       
        glTexCoord2f (0+spost, 0+spost) 'Set texture and size it
        glVertex2f (0, 600)             'Set vertex
       
        glTexCoord2f (1-spost, 0+spost) 'Set texture and size it
        glVertex2f (800, 600)           'Set vertex
       
        glTexCoord2f (1-spost, 1-spost) 'Set texture and size it
        glVertex2f (800, 0)             'Set vertex
       
        spost += inc        'Add up the size
        alphaV -= alphainc  'Decrease the alpha (Makes it fade)
    NEXT
    glEnd
   
    PerMode_() 'Return to perspective mode
   
    glEnable GL_DEPTH_TEST 'Re-Enable Depth testing
    glDisable GL_TEXTURE_2D 'Turn textures off
    glDisable GL_BLEND 'Turn alpha off...
   
    glBindTexture GL_TEXTURE_2D, 0 'Unbind Blur_Tex from the texture matrix.. ;)
END SUB
-Rattra (x.t.r.GRAPHICS)

Clyde

Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.


Challenge Trophies Won:

Shockwave

Shockwave ^ Codigos
Challenge Trophies Won:

Blitz Amateur