1. Post #441
    tjl
    tjl's Avatar
    February 2006
    327 Posts
    Gonna start working on this raytracer a bit again. Got it working with SFML and now it works on linux. Next to implement is transparency, textures, and beers law.

    Reply With Quote Edit / Delete United States Show Events

  2. Post #442
    Gold Member
    Robber's Avatar
    January 2006
    6,123 Posts
    Someone should make a proper CUDA powered raytracer. :buddy:
    Reply With Quote Edit / Delete Austria Show Events

  3. Post #443
    blankthemuffin's Avatar
    July 2009
    1,265 Posts
    Someone should make a proper CUDA powered raytracer. :buddy:
    Nvidia already have one. :D
    Reply With Quote Edit / Delete Australia Show Events

  4. Post #444
    Gold Member
    Robber's Avatar
    January 2006
    6,123 Posts
    Nvidia already have one. :D
    Released?
    Reply With Quote Edit / Delete Austria Show Events

  5. Post #445
    blankthemuffin's Avatar
    July 2009
    1,265 Posts
    Reply With Quote Edit / Delete Australia Show Events

  6. Post #446
    garry's Avatar
    September 2001
    12,401 Posts
    Bought some books!

    Reply With Quote Edit / Delete Show Events

  7. Post #447
    Gold Member
    HubmaN's Avatar
    July 2007
    6,267 Posts
    Good lord, hardbacks.
    Reply With Quote Edit / Delete Thailand Show Events

  8. Post #448
    Gold Member
    dezek's Avatar
    November 2005
    195 Posts
    Bought some books!

    *picture*
    I'm thinking of buying some books (GPU Gems is one of them). I guess you haven't done much reading yet but how is it compared to read things on the internet, are you planning to actually read the whole book or just use it to look things up?
    Reply With Quote Edit / Delete Sweden Show Events

  9. Post #449
    garry's Avatar
    September 2001
    12,401 Posts
    I'll probably flick through, I'd say it's a lot better than online stuff.. since with online stuff you kind of have to know what you're looking for.

    GPU Gems seems to be showing you specific techniques, RTR seems to be really more in depth, tons of little useful things. Haven't looked at the video game one yet.
    Reply With Quote Edit / Delete Show Events

  10. Post #450
    Gold Member
    nullsquared's Avatar
    November 2007
    2,450 Posts
    Reply With Quote Edit / Delete United States Show Events

  11. Post #451
    Gold Member
    efeX's Avatar
    April 2009
    2,332 Posts
    Not everyone wants to read walls of text on a monitor.
    Reply With Quote Edit / Delete United States Show Events

  12. Post #452
    garry's Avatar
    September 2001
    12,401 Posts
    I did see that, I much prefer a book though
    Reply With Quote Edit / Delete Show Events

  13. Post #453
    Gold Member
    nullsquared's Avatar
    November 2007
    2,450 Posts
    I did see that, I much prefer a book though
    Oh.

    I mean, GPU Gems isn't really something you'd sit down and read ... it's more of a "hey, I wonder what it says about so-and-so."
    Reply With Quote Edit / Delete United States Show Events

  14. Post #454
    Gold Member
    HubmaN's Avatar
    July 2007
    6,267 Posts
    Holy shit, it's got a guide on Core Image :fuckyou:
    Reply With Quote Edit / Delete Thailand Show Events

  15. Post #455
    Gold Member
    bigdoggie's Avatar
    June 2007
    1,710 Posts
    Oh, this page looks pretty interesting: http://http.developer.nvidia.com/GPU...ems3_ch01.html

    I must read more.
    Reply With Quote Edit / Delete Portugal Show Events

  16. Post #456
    Gold Member
    r4nk_'s Avatar
    April 2005
    2,021 Posts
    It's annoying how small all the images are in those articles.
    Reply With Quote Edit / Delete Australia Show Events

  17. Post #457
    Gold Member
    HubmaN's Avatar
    July 2007
    6,267 Posts

    I hope it's working, but I started with a glider...

    Edited:

    Argh, that was a =/== typo.
    It works now, now I'll have to find a way to scale the image because I can't see anything. Why isn't it aliased, though?
    Reply With Quote Edit / Delete Thailand Show Events

  18. Post #458
    Gold Member
    Vampired's Avatar
    February 2005
    374 Posts


    Moving platforms!
    Code:
    virtual void think() {
    	mover->x = clamp(mover->x + 100*dir, 18000, WORLD_WIDTH-8000);
    }
    Now how do I solve this:
    Code:
    #include "levels/Level1.cpp"
    #include "levels/Level2.cpp"
    #include "levels/Level3.cpp"
    ...
    switch(levelnum) {
    	case 1: level = new Level1(); break;
    	case 2: level = new Level2(); break;
    	case 3: level = new Level3(); break;
    	case 4: level = new Level4(); break;
    	case 5: level = new Level5(); break;
    	case 6: level = new Level6(); break;
    	...
    }
    Agh
    Reply With Quote Edit / Delete Show Events

  19. Post #459
    Eleventeen's Avatar
    August 2008
    1,261 Posts
    Vampired, please don't troll this thread.
    Reply With Quote Edit / Delete Australia Show Events

  20. Post #460
    Gold Member
    Vampired's Avatar
    February 2005
    374 Posts
    Eleventeen. Wtf?
    I'm serious. There's not much point making a thread for small questions.
    Reply With Quote Edit / Delete Show Events

  21. Post #461
    jmanmc's Avatar
    July 2007
    86 Posts
    You should probably have a level class and create instantiations from that, not have seperate classes for each level.
    Reply With Quote Edit / Delete United States Show Events

  22. Post #462
    Gold Member
    Vampired's Avatar
    February 2005
    374 Posts
    Each level has a different constructor and think function etc. How would I go about that with one level class?
    Reply With Quote Edit / Delete Show Events

  23. Post #463
    Gold Member
    Nevec's Avatar
    June 2008
    1,092 Posts
    Each level has a different constructor and think function etc. How would I go about that with one level class?
    Scripting would be one way. Another would be to have a bunch of static methods that create the levels. You then store those functions in a vector and call them whenever you want.
    Reply With Quote Edit / Delete Latvia Show Events

  24. Post #464
    garry's Avatar
    September 2001
    12,401 Posts
    There's lots of ways to make a class factory, I haven't read through it all but this seems to be what you're after:

    http://stackoverflow.com/questions/3...-class-factory
    Reply With Quote Edit / Delete Show Events

  25. Post #465
    Gold Member
    ZomBuster's Avatar
    June 2006
    2,001 Posts
    It works now, now I'll have to find a way to scale the image because I can't see anything. Why isn't it aliased, though?
    http://www.cubeupload.com/files/400400untitled.png
    Instead of pixels use sprites?
    Reply With Quote Edit / Delete Netherlands Show Events

  26. Post #466
    Gold Member
    HubmaN's Avatar
    July 2007
    6,267 Posts
    Instead of pixels use sprites?
    Eh, I'm not about to mangle with an array of sprites, this is killing the framerate as it is. I just ended up having to roll my own nearest-neighbor scaling function (by default, whenever a sprite is resized SFML defaults to bilinear interpolation). Here's something interesting, though - for some reason, it's blurrier in the corners than in the center.

    Reply With Quote Edit / Delete Thailand Show Events

  27. Post #467
    Gold Member
    Robber's Avatar
    January 2006
    6,123 Posts
    I was working on a threaded MP3 searcher using the Google API. I had a thread for each Google page which started a thread for each search result which started a thread for each link to an mp3 it found which checked the MIME type and how relevant it was to the search keywords and added it to a list.
    I thought it worked quite well and was pretty fast too.

    Today I found a plugin for NetBeans to track all the Threads a program started. Now I found out why the JVM crashed sometimes. I did something horribly wrong and it started over 3700 threads. D:
    Surprisingly the CPU usage peaked at 70%.


    And no, it's not just finding 3700 results. It stops searching after a while and still has 1999 threads.
    Reply With Quote Edit / Delete Austria Show Events

  28. Post #468
    Gold Member
    Sporbie's Avatar
    August 2006
    671 Posts
    I was working on a threaded MP3 searcher using the Google API. I had a thread for each Google page which started a thread for each search result which started a thread for each link to an mp3 it found which checked the MIME type and how relevant it was to the search keywords and added it to a list.
    I thought it worked quite well and was pretty fast too.

    Today I found a plugin for NetBeans to track all the Threads a program started. Now I found out why the JVM crashed sometimes. I did something horribly wrong and it started over 3700 threads. D:
    Surprisingly the CPU usage peaked at 70%.


    And no, it's not just finding 3700 results. It stops searching after a while and still has 1999 threads.
    I'm probably end up stupid asking this question but shouldn't there be just 2 threads if you have dual core and 4 threads if you have quad core?
    Reply With Quote Edit / Delete Croatia Show Events

  29. Post #469
    Gold Member
    efeX's Avatar
    April 2009
    2,332 Posts


    Moving platforms!
    Code:
    virtual void think() {
    	mover->x = clamp(mover->x + 100*dir, 18000, WORLD_WIDTH-8000);
    }
    Now how do I solve this:
    Code:
    #include "levels/Level1.cpp"
    #include "levels/Level2.cpp"
    #include "levels/Level3.cpp"
    ...
    switch(levelnum) {
    	case 1: level = new Level1(); break;
    	case 2: level = new Level2(); break;
    	case 3: level = new Level3(); break;
    	case 4: level = new Level4(); break;
    	case 5: level = new Level5(); break;
    	case 6: level = new Level6(); break;
    	...
    }
    Agh
    Easy. don't include CPP files...
    Reply With Quote Edit / Delete United States Show Events

  30. Post #470
    Gold Member
    ZomBuster's Avatar
    June 2006
    2,001 Posts
    Eh, I'm not about to mangle with an array of sprites, this is killing the framerate as it is. I just ended up having to roll my own nearest-neighbor scaling function (by default, whenever a sprite is resized SFML defaults to bilinear interpolation). Here's something interesting, though - for some reason, it's blurrier in the corners than in the center.
    You're right, it is slow


    (stole your idea lol)

    it works a lot faster without that much blocks (with the corect code)
    Reply With Quote Edit / Delete Netherlands Show Events

  31. Post #471
    Gold Member
    Robber's Avatar
    January 2006
    6,123 Posts
    I'm probably end up stupid asking this question but shouldn't there be just 2 threads if you have dual core and 4 threads if you have quad core?
    Only if I would be calculating something. But in this case, what's limiting the speed is the download speed from each website and the time it takes to answer.
    Lets say it takes 1 second to download a website's HTML code. When I download 10 website in 1 thread it takes 10 seconds. If I download each one in it's own thread it takes 1-3 seconds, because my local resources aren't the limiting factor.

    And if a website doesn't reply (timeout) it's thread waits for 10 seconds and stops. If I did everything in 1 (or 2) threads all the other downloads would have to wait until it didn't answer for 10 seconds.
    Reply With Quote Edit / Delete Austria Show Events

  32. Post #472
    open.gl
    Overv's Avatar
    February 2007
    7,431 Posts
    I made the physics world render code into a GUI object, so now it's easy as hell to do this:



    I don't really know any uses for it, but now that the rendered world is handled as a GUI object, adding stuff like dragging to create objects is easier than before. Here's the code to create these controls:

    guibox2dworld worldRender( 0, 0, 500.0f, 350.0f, physics::world );
    guibox2dworld worldRender2( 500.0f, 0, 500.0f, 350.0f, physics::world );
    guibox2dworld worldRender3( 0.0f, 350.0f, 500.0f, 350.0f, physics::world );
    guibox2dworld worldRender4( 500.0f, 350.0f, 500.0f, 350.0f, physics::world );
    guimanager::addControl( &worldRender );
    guimanager::addControl( &worldRender2 );
    guimanager::addControl( &worldRender3 );
    guimanager::addControl( &worldRender4 );
    Reply With Quote Edit / Delete Netherlands Show Events

  33. Post #473
    Gold Member
    Robber's Avatar
    January 2006
    6,123 Posts
    Running at a fixed framerate of 40FPS:


    It's not using sprites though. :frown:

    Edit:
    Using sprites now. Running at 55FPS. :D
    Reply With Quote Edit / Delete Austria Show Events

  34. Post #474
    tjl
    tjl's Avatar
    February 2006
    327 Posts
    Having a bit of trouble with specular lighting in my raytracer when dealing with planes.

    With specular lighting:


    and with specular lighting disabled.


    Here's the relevant bit of code.

    // now specular shading
                if ( ENABLE_SPEC_LIGHTING && prim->getSpecular() > 0 )
                {
                    Vec3 refl_vec = light_pos_norm - ( norm * light_pos_norm.dot( norm ) * 2.0f );
    
                    float dot = dir.dot( refl_vec );
    
                    if ( dot > 0 )
                    {
                        float spec = powf( dot, 20 ) * prim->getSpecular() * shade;
    
                        col += spec * light->getColor();
                    }
                }
    
    Reply With Quote Edit / Delete United States Show Events

  35. Post #475
    Gold Member
    Robber's Avatar
    January 2006
    6,123 Posts
    I made the physics world render code into a GUI object, so now it's easy as hell to do this:

    *screenshot*

    I don't really know any uses for it, but now that the rendered world is handled as a GUI object, adding stuff like dragging to create objects is easier than before.
    You could make windows inside the main window which contain their own world.
    Reply With Quote Edit / Delete Austria Show Events

  36. Post #476
    Gold Member
    foszor's Avatar
    April 2005
    932 Posts
    After rewriting our GUI Manager from scratch, I've finally got back to skinning

    http://www.youtube.com/watch?v=5vFRTDfRY0g&hd=1

    Older video before skinning

    http://www.youtube.com/watch?v=m2tb_RUWWHE&hd=1
    Reply With Quote Edit / Delete United States Show Events

  37. Post #477
    Gold Member
    ZomBuster's Avatar
    June 2006
    2,001 Posts



    ok enough game of life
    Reply With Quote Edit / Delete Netherlands Show Events

  38. Post #478
    open.gl
    Overv's Avatar
    February 2007
    7,431 Posts
    After rewriting our GUI Manager from scratch, I've finally got back to skinning

    http://www.youtube.com/watch?v=5vFRTDfRY0g&hd=1

    Older video before skinning

    http://www.youtube.com/watch?v=m2tb_RUWWHE&hd=1
    That's cool, is a skin simply overriding drawing code?
    Reply With Quote Edit / Delete Netherlands Show Events

  39. Post #479
    Gold Member
    Vampired's Avatar
    February 2005
    374 Posts
    Easy. don't include CPP files...
    Why ever not?
    Reply With Quote Edit / Delete Show Events

  40. Post #480
    Gold Member
    foszor's Avatar
    April 2005
    932 Posts
    That's cool, is a skin simply overriding drawing code?
    There's a base skin with virtual functions. Any new skin just derives from it and overrides the different drawing routines. Each skin has their own content manager as well, so switching skins frees up resources used by the previous.
    Reply With Quote Edit / Delete United States Show Events