Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Knurz

Pages: 1 2 3 [4] 5
61
General chat / Re: Smooth interpolation...
« on: November 17, 2012 »
Yeah, very nice resource!

62
C / C++ /C# / Re: OGL: Loading Images From Memory
« on: November 15, 2012 »
That's actually a pretty bad solution because it's sampling a regular grid which has bad slope coverage.
For proper image quality you'll also need a rather complex downsampling filter to attenuate frequencies above nyquist (which bilinear/bicubic filtering won't) and which is probably already implemented somewhere in the hardware - but would require one (or two) additional rendering passes.

I got really good quality by using the stuff provided from OGL, I didn't really tried out the shader solution to the FSAA problem - maybe the shader would be a good fallback solution for some older cards ?



63
C / C++ /C# / Re: OGL: Loading Images From Memory
« on: November 15, 2012 »
BTW there is just ooooone little "nasty" thing with FBOs:

You don't have any FSAA effects with Framebuffers and the rendering quality is in my opinion (without FSAA) very shitty. There are several solutions to this problem, I found one with shaders but it seems an overkill for just applying a "normal" behaviour with FBO. After hours of googeling I found that the good guys at Khronos Group have already solved this problem for us by extending OpenGL with FSAA-FBOs.

And before you start searching again for examples, here is what I've found on the web - I packed this stuff into a function again:

Code: [Select]
#define FRAMEBUFFER_MULTISAMPLE 8
...

int createMSAAFBO ( struct FBOELEM *store, int width, int height) {
    unsigned int fbo, cbo, dbo;
    int maxsamples;
    GLenum error;

    glGetIntegerv (GL_MAX_SAMPLES_EXT, &maxsamples);

    if ( maxsamples > FRAMEBUFFER_MULTISAMPLE )
        maxsamples = FRAMEBUFFER_MULTISAMPLE;

    glGenFramebuffersEXT (1, &store->fbo);
    glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, store->fbo);
    glGenRenderbuffersEXT (1, &store->colorbuf);
    glBindRenderbufferEXT (GL_RENDERBUFFER_EXT, store->colorbuf);
    glRenderbufferStorageMultisampleEXT (GL_RENDERBUFFER_EXT, maxsamples, GL_RGBA, width, height);
    glGenRenderbuffersEXT (1, &store->depthbuffer);
    glBindRenderbufferEXT (GL_RENDERBUFFER_EXT, store->depthbuffer);
    glRenderbufferStorageMultisampleEXT (GL_RENDERBUFFER_EXT, maxsamples, GL_DEPTH_COMPONENT, width, height);
    glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_RENDERBUFFER_EXT, store->colorbuf);
    glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, store->depthbuffer);

    error = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
    if (error != GL_FRAMEBUFFER_COMPLETE_EXT) {
        switch (error) {
            case GL_FRAMEBUFFER_UNSUPPORTED_EXT:
                MessageBox(NULL, "GL_FRAMEBUFFER_UNSUPPORTED_EXT", "FBO-ERROR", MB_OK | MB_ICONINFORMATION);
                break;
            case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT:
                MessageBox(NULL, "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT", "FBO-ERROR", MB_OK | MB_ICONINFORMATION);
                break;
            case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT:
                MessageBox(NULL, "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT", "FBO-ERROR", MB_OK | MB_ICONINFORMATION);
                break;
            case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT:
                MessageBox(NULL, "GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT", "FBO-ERROR", MB_OK | MB_ICONINFORMATION);
                break;
            case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT:
                MessageBox(NULL, "GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT", "FBO-ERROR", MB_OK | MB_ICONINFORMATION);
                break;
            case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT:
                MessageBox(NULL, "GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT", "FBO-ERROR", MB_OK | MB_ICONINFORMATION);
                break;
            case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT:
                MessageBox(NULL, "GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT", "FBO-ERROR", MB_OK | MB_ICONINFORMATION);
                break;
            case GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT:
                MessageBox(NULL, "GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT", "FBO-ERROR", MB_OK | MB_ICONINFORMATION);
                break;
            default:
                MessageBox(NULL, "default:", "FBO-ERROR", MB_OK | MB_ICONINFORMATION);
                break;
        }
    }
    glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0);
    return (store->fbo);
}

The difference between FSAA FBO's and non-FSAA FBO's is (as you can see in the example above) that you can't bind any textures to this Buffer but you can do a "Blit" to another FBO which has a texture object bound.

Code: [Select]
void texturizeMSAAFBO ( int source, int dest, int width, int height) {
    glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, source);
    glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, dest);
    glBlitFramebufferEXT(0, 0, width, height, 0, 0, width, height, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT, GL_NEAREST);
    glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0);
    glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0);
}

This "Blits" (how I missed this term from good old Amiga) the source-MSAA (or any FBO if you need that) to dest FBO (created by the function of my first posting).

I found another "solution" several days ago, where some guy wrote that he "antialiases" his Screen by creating a FBO with twice size of the Backbuffer. I didn't like the solution so I didn't really tried it out, but I readed in some OGL Specs that FBO Rendering on newer cards should be the fastest solution.

64
After finishing the movie-database-project I got bored again and started last Friday something - I don't know what it will look when it's done..but I wanted to render something different than 2D/cubes and I wanted to explore OGL a little bit deeper than in my previous codes.. But it will have a "cracktro" style (again), aimed size is under 40k.

Cu.



65
C / C++ /C# / Re: OGL: Loading Images From Memory
« on: November 13, 2012 »
The screen is obviously being rendered to something other than a texture.

No idea how to use that as it doesn't tell have any examples. Maybe have to set the view to ortho and grab the pixels some how.

But thanks for the link. Appreciate it.

Offscreen Rendering using OGL is very very simple and you can use generic functions to generate everything you need.

Here you have an example how I create a FrameBufferObject:
Code: [Select]
struct FBOELEM {
    GLuint fbo;
    GLuint depthbuffer;
    GLuint texture;
    GLuint colorbuf;
    GLint status;
};

...

int createFBO ( int count, struct FBOELEM *buffers, int width, int height, int filter ) {
    int current, enderr = 1;
    GLenum error;

    for (current = 0; current < count; current++) {
        glGenFramebuffersEXT (1, &buffers[current].fbo);
        glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, buffers[current].fbo);
        glGenRenderbuffersEXT (1, &buffers[current].depthbuffer);
        glBindRenderbufferEXT (GL_RENDERBUFFER_EXT, buffers[current].depthbuffer);
        glRenderbufferStorageEXT (GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT, width, height);
        glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, buffers[current].depthbuffer);
        glGenTextures (1, &buffers[current].texture);
        glBindTexture (GL_TEXTURE_2D, buffers[current].texture);
        glTexParameteri (GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER, filter);
        glTexParameteri (GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER, filter);
        glTexImage2D (GL_TEXTURE_2D, 0, GL_RGBA8,  width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
        glFramebufferTexture2DEXT (GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, buffers[current].texture, 0);
        // check if everything was ok with our requests above.
        error = glCheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT);
        if (error != GL_FRAMEBUFFER_COMPLETE_EXT) {
            buffers[current].status = 0;
            enderr = 0;
        }
        else
            buffers[current].status = 1;
    }
    // set Rendering Device to screen again.
    glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0);
    return (enderr);
}

void enableFBO ( int fbo, int width, int height ) {
    // thus cannot have a larger request than tex size!
    glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);
    glPushAttrib(GL_VIEWPORT_BIT);
    glViewport(0, 0, width, height);
}

inline void disableFBO () {
    glPopAttrib();
    glBindFramebufferEXT (GL_FRAMEBUFFER_EXT, 0);
}

I think this is self-explaining what it does.

Just call createFB() to create n FBO's and if you want to render something to one of the screens call enableFBO(myFBO[n].fbo), render your stuff to offscreen and don't forget to switch to the backscreen after you've finished using disableFBO().

If you want to use the rendered texture call glBindTexture(GL_TEXTURE_2D, myFBO[n].texture). You can use it like a loaded Texture Bitmap.

Hope this example helps :).

Brgds.

66
Great Competition!

congrats to the winners!

67
Hi Guys!

Just wanted to say hello and report what I've done the last few weeks (this maybe sound a bit nerdy  ;D ).

I've a movie and TV collection with about 5000 files containing it, and a hardware Mediaplayer to render this stuff to tv.
After a while it was nearly impossible to browse my collection, just imagine you want to watch a movie starting with letter "J"..it was really annoying.

So I installed a Manger for this called "yamj" (Yet another movie jukebox), which downloads information, posters from the net and stores the information in several XML Files. A nice solution, but not nice enough for a lazy person like me :). This brought me to the next step: Making a website, containing my movies and TV Shows. This was done really fast using a template system and PHP/MySQL.

But I missed something... I was not really happy that I can browse my stuff on the web, but I was just not able to start a video from my webpage. This "evolved" to the next level: Add a function to the page which uses UPnP to tell the Mediaplayer to play file X. After a while of browsing the net I found the theory how to do it but I didn't found a program which was able to play a file, only using the commandline. So I did this too (and UPnP is a very annoying protocol...).

I packaged this stuff and uploaded it to a GIT repository: https://github.com/theknurz/yamj-ro-suite

If you have readed this.. I warned you..it's a bit nerdy  ;D

BTW, nice competition again, if I find time, I'll distribute something :).

Byebye

68
General chat / Re: The Secret World
« on: July 04, 2012 »
Hey!

I'm a really MMO Addict and I've also tried TSW Beta and I buyed it last week online. I also played Age of Conan...
Yea the game is definitely a great try to do something different on the MMO-Market.

You've done (or learned from AoC) so much right, it really really makes fun to splash Zombie/Drough Faces :).
The Graphics are more than stunning (Savage Coast the Wood where the Treehouse hangs is more than an eyecatcher, its epic!), the sound is perfectly synchronized to the "mood" from your character. I love the shader which you apply when you are dead or when you try some mushrooms ;).
FC also learned that the users don't care about lights (in Tortage ^^) and care more about the gameplay itself. PvP is also great (love slaughtering at stonehenge :D ).
Default-UI is the BEST one I've seen for years, you don't need any UI-Addons.

Tentonhammer rated TSW at 85% or so, I rate it above 90%. ;)

Guys if you want to play a really nice adult MMO, try TSW.
(And I'm not in any way affiliated with FC ^^).

Some critics from a 10+year MMO Gamer:
The chat system is horrible.
No dungeon finder in 2012 ? Mhh ok, i like the social interaction and don't need it, but some friends already complained about that.
Please fix the PvP-queue-bug :)

But FC has done a really great job, I was afraid (after I've played AoC) that the "Funcom"-Effect strikes again in this games (First levels are great, than more than flat).

Great job, great game, absolutly great storyline!

cu.

PS.: BUFF SHOTGUN!  :||

69
Are you setting your viewport to the right dimensions ?

Code: [Select]
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);
glPushAttrib(GL_VIEWPORT_BIT);
glViewport(0, 0, width, height);

70
Projects / Re: New and Last Intro
« on: June 16, 2012 »
Catchy chiptune, and screen #2 is REALLY great :)

71
Nice! Thanks :)

72
Challenges & Competitions / Re: [CUBES] HTTSC
« on: June 14, 2012 »
Yeah K+++++ for the src :updance:

Oops, that reminds me. Will post mine soon, promise!

Waiting for it too :). (because raymarching hurts my brain...  :inspired: )

73
General chat / Mathematics on youtube [GERMAN]
« on: June 07, 2012 »
Hi!

http://www.youtube.com/watch?v=mWN0cA_Ngk4&list=PL526B83B6A68B8759&index=13&feature=plpp_video

Wer sich mit Mathematik genauso schwer tut wie ich, das eine recht anschauliche Version des ganzen Vektorenkrams und mit der Rumrechnerei desselben. Wenn man auf den Channel des Users geht sind da noch etliche andere Mathevorlesungen aufgezeichnet, aber da ich eher noch bei den Basics bin, poste ich mal das. :)

lg.

74
Challenges & Competitions / Re: [CUBES] HTTSC
« on: May 27, 2012 »
Source Code for httsc.

(It's a mess and there are many functions in it which I never use...  :updance: )




75
General chat / Re: Donations
« on: May 25, 2012 »
Don't mention it :).


76
Shockwave can you clear my votings ? Me like a monkey, clicks but no reading  :vangry:

77
Grrrrrreat Stuff!
 :clap: :clap:

78
Challenges & Competitions / Re: [CUBES] HTTSC
« on: May 06, 2012 »
@BlackSheep: Nope, the colors are precalc (it'S the same routine as used in vroom  ) => lazy Jones mode :).

Thanks for your positive replies.

Now that my logical Volume on my server works again (Thought I have lost all my work from prev. 5 years -.-), I'll post the source after the comp. has finished :).


79
Challenges & Competitions / Re: [CUBES] HTTSC
« on: May 05, 2012 »
Mhh I programmed this on W7/64, should not need any additional permissions  :o.

Except for that "VROOM" Remake, this is my first Intro :).

80
Challenges & Competitions / Re: [CUBES] HTTSC
« on: May 04, 2012 »
@jace: Thanks, I figured out that MoveWindow after GL has initialized is not smart ... Will change my init.-code :)

As uncreative as ever HTTSC stands for "Homage to the spinning cube" :).

Thanks for the positive replies. :)

Pages: 1 2 3 [4] 5