Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411433 Posts in 69363 Topics- by 58418 Members - Latest Member: Pix_RolleR

April 20, 2024, 07:42:46 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)The happy programmer room
Pages: 1 ... 188 189 [190] 191 192 ... 279
Print
Author Topic: The happy programmer room  (Read 677842 times)
Noogai03
Level 6
*


WHOOPWHOOPWHOOPWHOOP


View Profile WWW
« Reply #3780 on: July 15, 2014, 12:27:19 PM »

After using SDL pretty much exclusively for my c++ development I recently stumbled upon SFML and I love it. It's everything I could have asked for in a library and much more.  <3

..that looks awesome. Definitely bookmarking that...

when people discover sfml after using sdl it's pure joy
Logged

So long and thanks for all the pi
Geti
Level 10
*****



View Profile WWW
« Reply #3781 on: July 15, 2014, 06:47:56 PM »

Unless of course they aren't a fan of OOP :^)
Logged

InfiniteStateMachine
Level 10
*****



View Profile
« Reply #3782 on: July 16, 2014, 07:02:52 AM »

yeah I kind of went the other direction, discovering SDL after using SFML
Logged

kamac
Level 10
*****


Notoriously edits his posts


View Profile
« Reply #3783 on: July 16, 2014, 07:51:55 AM »

yeah I kind of went the other direction, discovering SDL after using SFML

Did you cry? Tongue
Logged

zath
Level 0
**



View Profile
« Reply #3784 on: July 16, 2014, 12:56:19 PM »

I am happy today because thanks to the book SFML Game Development I've learned few C++ tricks that I wasn't aware of yet: std::bind, lambdas, and this crazy but elegant derivedAction template:

Code:
    template <typename GameObject, typename Function>
    Command::Action derivedAction(Function fn)
    {
        return [=] (SceneNode& node, sf::Time dt)
        {
            assert(dynamic_cast<GameObject*>(&node) != nullptr);
            fn(static_cast<GameObject&>(node), dt);
        };
    }

    // And its usage:
    command.action = derivedAction<ClassDerivedFromSceneNode>(
        [=] (ClassDerivedFromSceneNode& object, sf::Time dt) {
            if (object.IsSomeStateValid()) {
                object.doSomeAction(dt);
            }
         });

   // Or, when Enemy::doSomething is existing method without parameters
   command.action = derivedAction<Enemy>(std::bind(&Enemy::doSomethingStupid, _1));

   // Or when inside some setup method of class, let's say, World:
   command.action = derivedAction<Enemy>(
       [this] (Enemy& enemy, sf::Time)
       {
           // Do stuff [...]

           mSomeField = 0;
           this->somePrivateMethod();

           // Do stuff [...]
       });


Great book about game engine design. The best thing is that SFML could be thrown away from it and there would be still much to learn from this book.
Logged

EddieBytes
Level 1
*


I have ideas, and I'm not afraid to use them


View Profile
« Reply #3785 on: July 16, 2014, 01:14:25 PM »

Just finished implementing normal specular and emissive maps for my engine.




I'm happy  Shrug
Logged

Check out our thread for Boltus
InfiniteStateMachine
Level 10
*****



View Profile
« Reply #3786 on: July 16, 2014, 02:50:29 PM »

yeah I kind of went the other direction, discovering SDL after using SFML

Did you cry? Tongue

I kind of preferred it but that was mainly because of the situation I was using it. I like them both.


SDL is just a little easier to model into my own framework and I also had to use it for some low level video-streaming/blitting stuff


I am happy today because thanks to the book SFML Game Development I've learned few C++ tricks that I wasn't aware of yet: std::bind, lambdas, and this crazy but elegant derivedAction template:

Code:
    template <typename GameObject, typename Function>
    Command::Action derivedAction(Function fn)
    {
        return [=] (SceneNode& node, sf::Time dt)
        {
            assert(dynamic_cast<GameObject*>(&node) != nullptr);
            fn(static_cast<GameObject&>(node), dt);
        };
    }

    // And its usage:
    command.action = derivedAction<ClassDerivedFromSceneNode>(
        [=] (ClassDerivedFromSceneNode& object, sf::Time dt) {
            if (object.IsSomeStateValid()) {
                object.doSomeAction(dt);
            }
         });

   // Or, when Enemy::doSomething is existing method without parameters
   command.action = derivedAction<Enemy>(std::bind(&Enemy::doSomethingStupid, _1));

   // Or when inside some setup method of class, let's say, World:
   command.action = derivedAction<Enemy>(
       [this] (Enemy& enemy, sf::Time)
       {
           // Do stuff [...]

           mSomeField = 0;
           this->somePrivateMethod();

           // Do stuff [...]
       });


Great book about game engine design. The best thing is that SFML could be thrown away from it and there would be still much to learn from this book.

I do love lambda's Smiley
Logged

dirak
Level 0
**


View Profile
« Reply #3787 on: July 16, 2014, 03:00:50 PM »

Worked more on my raycaster. Today was refactoring day!
BeforeAfter

Very satisfying  Coffee
Logged
Sik
Level 10
*****


View Profile WWW
« Reply #3788 on: July 16, 2014, 09:33:07 PM »

yeah I kind of went the other direction, discovering SDL after using SFML
Pretty much this. When I saw the way SFML handled the keyboard I ditched it immediately. No idea if that's better now, but still.

SDL is way too barebones I guess, but at least I could work with it. I was coming from Allegro (more specifically, pre-4.9 Allegro), so yeah SDL feels way too empty in comparison. At least SDL2 is loads better than SDL1, it even has some basic GPU support! (if you just need simple 2D operations that's more than enough)
Logged
mokesmoe
Level 10
*****



View Profile WWW
« Reply #3789 on: July 20, 2014, 06:18:28 PM »

After a painful few hours, I just got a shader working.
It's just a super simple blending thing, but it required a sampler which I had never used (or even heard of) before.
Logged
Go Go Goto
Level 0
*


Aspirin Addict


View Profile
« Reply #3790 on: July 21, 2014, 07:49:20 AM »

Rebuilt a pixelated spaceship generator (David Bollinger's Pixel Spaceships) as an exercise in PHP, Haxe/ActionScript3, HTML5 Canvas, Processing and GameMaker and it's working just fine (I think  Embarrassed).
Logged

Meat Flavored Fluffy Omelette! :D
eyeliner
Level 10
*****


I'm afraid of americans...


View Profile
« Reply #3791 on: July 21, 2014, 07:54:27 AM »

Got myself working with SFML for .Net and I must say it's easier than I thought it would be.
I even meddled with Farseer + SFML for quite a bit and I found myself understanding all I wanted to do. Smiley
Logged

Yeah.
framk
Level 2
**


I don't know anything


View Profile
« Reply #3792 on: July 21, 2014, 08:16:04 AM »

This thread is turning into the happy SFML room
Logged

eyeliner
Level 10
*****


I'm afraid of americans...


View Profile
« Reply #3793 on: July 21, 2014, 01:16:29 PM »

Really? I didn't know there that much of a prevalence of SFML users in this particular thread. I just started developing without engines, so I'm quite happy with my progress so far.
Logged

Yeah.
Geti
Level 10
*****



View Profile WWW
« Reply #3794 on: July 21, 2014, 03:31:26 PM »

The last page or two has had a lot of people talking about it.

I'm happy cause I got some of the delta calculation stuff in KAG working in parallel; got to fix a few issues but I was honestly expecting significantly more uncontrolled breakage. Maybe the devil will be in fixing these last few things Smiley
Logged

Geti
Level 10
*****



View Profile WWW
« Reply #3795 on: July 21, 2014, 08:11:31 PM »

Figured out what was causing the main issue there (it was luckily completely unrelated to the threading stuff), so it's going to testing. Pretty pleased with how it's gone so far.

 Coffee
Logged

vinheim3
Level 5
*****



View Profile
« Reply #3796 on: July 22, 2014, 01:24:23 AM »

Started working on my first non-Game Maker game using Visual Studio 2010 C++ and SFML and everything is just going swell.
Logged
gimblll
Level 2
**



View Profile WWW
« Reply #3797 on: July 22, 2014, 02:29:37 AM »

Implemented new rendering paths to my game, and everything worked on the first try! This must be the first time in the last 15 years. I think I can retire now.
Logged

ndke
Level 2
**


View Profile
« Reply #3798 on: July 22, 2014, 02:51:27 AM »

Implemented particles in my game, worked on first try :D
Logged
Fallsburg
Level 10
*****


Fear the CircleCat


View Profile
« Reply #3799 on: July 24, 2014, 05:51:11 AM »

Managed to cram BRDF lighting into Unity's deferred lighting system.  I also have it set up to to do custom spherical harmonics for specular and diffuse ambient lighting (the specular only works for "fuzzy" reflections).  The next step is to reconfigure my faked light probe system to fake some global illumination.  

I do want to pose a question:

I only have 8 bits to work with for 3 variables (gloss, roughness, specular amount) in the BRDF.  If I can find a way to mess deeper with Unity's deferred lighting system (perhaps impossible), then I can get another 8 bits (by cramming the normal into 16 bits instead of 24).  With 16 bits, I'd feel comfortable with ~5 bits per variable, but with 8 bits, ~2 bits per variable leaves a bit wanting.  
Now, the question comes, should I just use a look up table?  

I can only have 256 distinct triplets (barring interpolating between things), but I imagine that for my own personal uses I can easily get away with 256 distinct reflectance parameters (pretty much all metals can use the same one, so too with high gloss things like car paint, so I can cram a lot of different materials into that range).

EDITED:
Second question--
I have spherical lights implemented by using the alpha channel of the light value to determine the radius of the sphere. 
Now, I want to add tube lights.  To do that, I need to define 2 points and the radius of the tube.  One point can be assumed (the position of the light).  So I need 4 floats, and I only have 1 float to pack it in.  That seems rough.  However, if I'm ok with constraining the number of colors that my light can be (say with a 256 color palette), then I have 24 bits to work with.  That way I can devote some number of bits to the location and the rest to the radius. 

bits per location value,degree precision ,number of radii available
7,~3,8
6,~6,16
5,~11,32

my guess is that 11 degree spacing is probably good enough for most uses. 

So, sound reasonable?
« Last Edit: July 24, 2014, 06:33:31 AM by Fallsburg » Logged
Pages: 1 ... 188 189 [190] 191 192 ... 279
Print
Jump to:  

Theme orange-lt created by panic