1. Post #1081
    Gold Member
    dvondrake's Avatar
    August 2006
    2,336 Posts
    Yeah, it sounded like such a great idea, too. It just sucks that it doesn't work out geometrically. I wouldn't say that the reasons why it doesn't work are intuitive, either. You have to think pretty hard to see why it fails.
    I kept thinking I was doing something wrong while transforming the light's position from world space to view space, it was driving me insane over the course of days. I just couldn't figure out what was wrong. Randomly decided to store the normals' Z as well and it worked.

    Just implemented lambert azimuthal equal-area projection as you suggested, works great. Thanks for that, I'll be able to sleep tonight knowing my G-buffer isn't the size of Mars.



    Do you guys use your own math libs for doing vector and matrix calculations, or external libs. If so, which ones (preferably C/C++)
    I too would love to know about any matrix/vector libraries out there.

    Currently I've coded my own, but it's really, really makeshift and doesn't actually work 100% correctly. Needless to say I'm trying to do as many matrix calculations in GLSL as I can, rather than in C++.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Friendly Friendly x 1 (list)

  2. Post #1082
    I bought a title for $1.
    sambooo's Avatar
    March 2011
    3,065 Posts
    0xDDDDDDDD
    Oh god that pointer was annoying to read
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Funny Funny x 19Agree Agree x 1 (list)

  3. Post #1083
    Gold Member
    raBBish's Avatar
    March 2007
    2,667 Posts
    Do you guys use your own math libs for doing vector and matrix calculations, or external libs. If so, which ones (preferably C/C++)
    Try this: http://glm.g-truc.net
    Reply With Quote Edit / Delete Windows 7 Finland Show Events Friendly Friendly x 1Agree Agree x 1 (list)

  4. Post #1084
    DevBug's Avatar
    July 2010
    1,059 Posts
    Needless to say I'm trying to do as many matrix calculations in GLSL as I can, rather than in C++.

    .
    Reply With Quote Edit / Delete Windows 7 Canada Show Events Agree Agree x 5 (list)

  5. Post #1085
    Gold Member
    dvondrake's Avatar
    August 2006
    2,336 Posts
    I like to get my code functional before worrying about making it fast. Would've taken too much time for me to make my own matrix library right off the bat rather than just getting the thing actually working first. Don't worry, I'll move them back to C++ once I find a good matrix library.

    ...Like the one raBBish posted! Looks like this will do just fine, thank you sir.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  6. Post #1086
    Gold Member
    Electroholic's Avatar
    June 2011
    2,339 Posts


    Speech bubbles, and showing off some animations and equipment
    Reply With Quote Edit / Delete Windows 7 Canada Show Events Artistic x 4Winner x 2Friendly x 1Programming King x 1Informative x 1 (list)

  7. Post #1087
    Gold Member
    raBBish's Avatar
    March 2007
    2,667 Posts
    With the annoying crash fixed and Luabind integrated, I can start binding more stuff.

    local clr = Color(255, 128, 0, 255)
    local clr2 = Color(0, 128, 255, 255)
    local vec_origin = math.Vector(0)
    hook.add( "Paint", "test", function( str )
    	if not INGAME then return end
    
    	local c = vec_origin:ToScreen();
    
    	surface:SetColor( clr )
    	surface:DrawRect( 25, 25, 50, 50 )
    	surface:DrawOutlinedRect( 50, 50, 75, 75 )
    	if not c.behind then
    		surface:SetColor( clr2 )
    		surface:DrawOutlinedCircle( c.x - 10, c.y - 10, 10, 18 )
    	end
    end )



    Should I keep posting updates even when the more hack-like content (ESP, aimbot, etc.) comes into play, or are people going to get upset?
    Reply With Quote Edit / Delete Windows 7 Finland Show Events Agree Agree x 15 (list)

  8. Post #1088
    Gold Member
    Robber's Avatar
    January 2006
    6,206 Posts
    Keep posting



    Speech bubbles, and showing off some animations and equipment
    When he runs to the left he is mirrored (left hand is the right hand and other way around).
    Reply With Quote Edit / Delete Windows 7 Austria Show Events Agree Agree x 4 (list)

  9. Post #1089
    Gold Member

    March 2005
    3,028 Posts


    Speech bubbles, and showing off some animations and equipment
    Moving left: Right-handed
    Moving right: Left-handed

    :S

    Seems like I'm late.
    Reply With Quote Edit / Delete Windows 7 Show Events

  10. Post #1090
    SHADERS
    Legend286's Avatar
    October 2008
    10,024 Posts
    Depth buffer issues. Easy fix, one line in Draw()
    Code:
    device.DepthStencilState = DepthStencilState.Default;
    Should fix it.
    I blame spritebatch for fucking that up.

    And that didn't fix it, for some reason...
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  11. Post #1091
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    With the annoying crash fixed and Luabind integrated, I can start binding more stuff.

    local clr = Color(255, 128, 0, 255)
    local clr2 = Color(0, 128, 255, 255)
    local vec_origin = math.Vector(0)
    hook.add( "Paint", "test", function( str )
    	if not INGAME then return end
    
    	local c = vec_origin:ToScreen();
    
    	surface:SetColor( clr )
    	surface:DrawRect( 25, 25, 50, 50 )
    	surface:DrawOutlinedRect( 50, 50, 75, 75 )
    	if not c.behind then
    		surface:SetColor( clr2 )
    		surface:DrawOutlinedCircle( c.x - 10, c.y - 10, 10, 18 )
    	end
    end )



    Should I keep posting updates even when the more hack-like content (ESP, aimbot, etc.) comes into play, or are people going to get upset?
    while hacks might be annoying to play with, it's awesome if you can program them
    Reply With Quote Edit / Delete Mac Australia Show Events Agree Agree x 16 (list)

  12. Post #1092
    SirCrest Sexual Enthusiast
    wingless's Avatar
    August 2008
    14,852 Posts
    Does anyone know of a good networking library that works with Windows Phone 7, not for XNA?
    Reply With Quote Edit / Delete Windows 7 Australia Show Events

  13. Post #1093
    RUBY OVERLORD
    swift and shift's Avatar
    November 2011
    2,115 Posts
    system.net.sockets
    Reply With Quote Edit / Delete Mac Australia Show Events Zing Zing x 7 (list)

  14. Post #1094
    Gold Member
    synthiac's Avatar
    June 2007
    1,100 Posts
    Why do you consistently use non-filled rectangles to try and blur something out? I could probably reconstruct your profile picture from your "blurred out" image.
    you mean this one?


    Edited:

    (except for the asshole text i added)
    Reply With Quote Edit / Delete Windows 7 United States Show Events Funny Funny x 29 (list)

  15. Post #1095
    Jvs
    PENISCorp's First Employee
    Jvs's Avatar
    June 2009
    1,613 Posts
    Should I keep posting updates even when the more hack-like content (ESP, aimbot, etc.) comes into play, or are people going to get upset?
    Keep posting,hacks are boring and I always dreamed of replicating addons like this (link2) in tf2,those do not hurt gameplay as much as esps and aimbots do.
    Reply With Quote Edit / Delete Windows XP Italy Show Events

  16. Post #1096
    SirCrest Sexual Enthusiast
    wingless's Avatar
    August 2008
    14,852 Posts
    I blame spritebatch for fucking that up.

    And that didn't fix it, for some reason...
    It might have been device.DepthStencilState = DepthStencilState.None;
    Reply With Quote Edit / Delete Windows 7 Australia Show Events

  17. Post #1097
    www.bff-hab.de
    Dennab
    February 2009
    7,832 Posts
    It's good that the only thing you'd find on my profile is this really emberassing picture:


    But luckily you don't have my account name so you won't ever find it
    Reply With Quote Edit / Delete Windows 7 Germany Show Events Funny Funny x 19 (list)

  18. Post #1098
    Gold Member
    Murkrow's Avatar
    April 2005
    4,905 Posts
    It's good that the only thing you'd find on my profile is this really emberassing picture:


    But luckily you don't have my account name so you won't ever find it
    This is funny for some reason
    Reply With Quote Edit / Delete Windows 7 Slovenia Show Events Funny Funny x 14 (list)

  19. Post #1099
    voodooattack's Avatar
    October 2009
    1,994 Posts
    I tried to compile perl 5.12.3 for mingw again.

    My anus is still bleeding.
    Reply With Quote Edit / Delete Windows 7 Egypt Show Events Funny Funny x 4 (list)

  20. Post #1100
    Gold Member
    Smashmaster's Avatar
    April 2005
    1,549 Posts
    I like how your first reaction to his post was to try to cyber-stalk him.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Dumb Dumb x 1 (list)

  21. Post #1101
    Reply With Quote Edit / Delete Windows 7 Egypt Show Events Funny Funny x 13 (list)

  22. Post #1102
    Strong Member
    thelinx's Avatar
    January 2007
    8,019 Posts
    It's good that the only thing you'd find on my profile is this really emberassing picture:


    But luckily you don't have my account name so you won't ever find it
    Well that was easy, http://www.facebook.com/profile.php?id=525092.
    Reply With Quote Edit / Delete Windows 8 Sweden Show Events Funny Funny x 22Winner Winner x 5Zing Zing x 1 (list)

  23. Post #1103
    open.gl
    Overv's Avatar
    February 2007
    7,431 Posts
    Scares me every single time.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events Agree Agree x 52Funny Funny x 5Disagree Disagree x 3 (list)

  24. Post #1104
    Strong Member
    thelinx's Avatar
    January 2007
    8,019 Posts
    In other news, I've actually contributed code to a open-source project now! Yay!
    Reply With Quote Edit / Delete Windows 8 Sweden Show Events Winner Winner x 5 (list)

  25. Post #1105
    Andrew McWatters
    Dennab
    March 2011
    4,658 Posts
    Holy shit that was the most annoying bug. I had the game crashing, cause being an invalid pointer (0xDDDDDDDD) in vstdlib.dll. I wasn't calling any functions from there or even linking it. The crash always happened after one of my functions returned. Otherwise it was completely random. It would happen in the menu, when I pressed a button or after a few seconds in-game. Sometimes it never happened.
    I spent over an hour trying to debug the crash, did some tests and found out that it stopped when I commented out calls to my Lua hooks. I suspected the reason to be either luabind or the hook module not existing. However, it started again later, after I had rewritten the Lua hooks in C++. Again, I spent some time debugging, when it disappeared completely. I added the hooks back, played around with the code and the game didn't crash at all. Couple hours ago the crashing came back.
    Well, this time I was determined to find the cause. I took out IDA, attached the debugger to GMod and launched. The crash was indeed in vstdlib.dll, the function was trying to use the invalid pointer. It was a virtual method of some class. I checked the vtable for hints, found "VCvarQuery001". I compared it to the vstdlib's Mac version (which contains debug info), and found out that the guilty method was ICvar::FindCommandBase. This was really helpful and I managed to fix the bug. The cause?

    local lua_run = cvar.ConCommand( "ir_lua_run", lua_run_c )
    local lua_open = cvar.ConCommand( "ir_lua_open", lua_open_c )

    Can you spot it? It took me a while.
    I'm creating the ConCommands as locals. They get added to a linked list when created. The linked list is traversed by ICvar::FindCommandBase. Yep, the garbage collector got the concommands, Luabind deleted the C++ objects, but the destructor doesn't automatically remove it from the linked list.
    The fix was simple, I just added a destructor to the ConCommand wrapper that unregisters the command from the list.
    I had to learn this the hard way for Half-Life 2: Sandbox, but you're still doing it wrong.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  26. Post #1106
    Gold Member
    raBBish's Avatar
    March 2007
    2,667 Posts
    I had to learn this the hard way for Half-Life 2: Sandbox, but you're still doing it wrong.
    I've noticed. My concommands disappear when I go in-game
    They work fine in the menu though!
    Reply With Quote Edit / Delete Windows 7 Finland Show Events Friendly Friendly x 1 (list)

  27. Post #1107
    Andrew McWatters
    Dennab
    March 2011
    4,658 Posts
    I've noticed. My concommands disappear when I go in-game
    They work fine in the menu though!
    I know, babe. I know. Shh shh shhhh, don't speak. I'll share some lovely tips with you. Prepare for a long read though. HL2:SB uses a specific design pattern to store run time created objects. This ensures a way that these objects are destroyed perfectly cleanly, even cleaner so than GMod's objects. (For instance, not even GMod cleans up ConCommands you create over the duration of its session, they just all stay there.)

    We deal with things like scripted weapons, entities, convars, concommands, effects, you name it, all the same way. It's a recycled method. Valve does this thing where they cache weapon scripts - you know those .txt files in /scripts? Those are flushed out eventually, I can't remember where, but the fact that they're cleared out of memory is the important bit.

    I reused this approach, but instead of reading weapon scripts, pushing their information into weapon data structs, and storing those structs, I tried storing weapons, concommands, etc. This is what I'm getting at.

    You need to create your ConCommands using new, and store the pointers somewhere. If you do what I did, you're using the same dictionary approach Valve used for weapon data (except for your concommands), which involves pushing those objects into a CUtlDict. Then later, unregister them and delete all of them. The ideal time to do this is during level transitions/disconnects. The proper name for that time is LevelShutdown.

    The idea is that we destroy these objects right before we destroy the Lua state. I'm under the assumption you're properly creating and destroying Lua states during the LevelInit/LevelShutdown routines.

    Edited:

    It took me a while to figure out the best way to approach this, but you just do not want to be garbage collecting these objects. That's not something that will give you the same expected behavior that you get from normal ConCommands.

    GMod's method involves creating the ConCommands in Lua once, and never unregistering them (as if they were just like any other ConCommand - something that is there for the entire game session).

    HL2:SB's method involves creating ConCommands in Lua and treating them as a part of the Lua creation and destruction process. This method makes more sense to me, because it was created in the Lua context, so it should be deleted in the same regard.

    Your method involves creating ConCommands in Lua and garbage collecting them when they're no longer accessible. (You could create them as globals and they'd be there for as long as they were accessible in _G.) This is a volatile approach, considering you have to keep track of all of your objects yourself.

    Edited:

    [Code to reference for ConVar/ConCommand objects.] Please keep in mind the C API extension functions are old and improperly written. Don't rely on things like lua_toconcommand, lua_toconvar, lua_pushconcommand, lua_pushconvar, luaL_checkconcommand, and luaL_checkconvar. Their behavior isn't proper.

    What you're looking for in that code is how I store Con* objects and delete them. That's at the bottom of the file.

    I don't know how you're going to pull that off in LuaBind (this is the part about flexibility I was mentioning) but I'm sure you can find a way.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Informative Informative x 2Useful Useful x 1 (list)

  28. Post #1108
    simie's Avatar
    March 2008
    134 Posts
    I made some lightning...



    Needs some bloom I think.
    Reply With Quote Edit / Delete Mac United Kingdom Show Events Artistic Artistic x 12Winner Winner x 1Agree Agree x 1 (list)

  29. Post #1109
    Gold Member
    dije's Avatar
    December 2008
    4,760 Posts
    Blue-ify it
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events Agree Agree x 7Disagree Disagree x 1 (list)

  30. Post #1110
    Icedshot's Avatar
    April 2010
    2,361 Posts


    Added subtle shadowing across the land -> sea borders

    Edit 2:

    Also: Planet rotation (see above)

    Reply With Quote Edit / Delete Windows Vista United Kingdom Show Events Artistic Artistic x 4 (list)

  31. Post #1111
    Mikolah's Avatar
    May 2011
    519 Posts
    I made some lightning...

    -img-

    Needs some bloom I think.
    What is that white dot sliding from the right edge?
    Reply With Quote Edit / Delete Windows 7 Ukraine Show Events Agree Agree x 1 (list)

  32. Post #1112
    Andrew McWatters
    Dennab
    March 2011
    4,658 Posts
    What is that white dot sliding from the right edge?
    I first thought it was Facepunch's snow. It took me a bit to realize a couple of reasons why that's not the case.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Funny Funny x 7 (list)

  33. Post #1113
    simie's Avatar
    March 2008
    134 Posts
    Now with more blue-oom



    What is that white dot sliding from the right edge?
    A star from the background (this is for a space game)
    Reply With Quote Edit / Delete Mac United Kingdom Show Events Artistic Artistic x 14Winner Winner x 3 (list)

  34. Post #1114
    Gold Member
    a203xi's Avatar
    January 2005
    396 Posts
    With the annoying crash fixed and Luabind integrated, I can start binding more stuff.

    local clr = Color(255, 128, 0, 255)
    local clr2 = Color(0, 128, 255, 255)
    local vec_origin = math.Vector(0)
    hook.add( "Paint", "test", function( str )
    	if not INGAME then return end
    
    	local c = vec_origin:ToScreen();
    
    	surface:SetColor( clr )
    	surface:DrawRect( 25, 25, 50, 50 )
    	surface:DrawOutlinedRect( 50, 50, 75, 75 )
    	if not c.behind then
    		surface:SetColor( clr2 )
    		surface:DrawOutlinedCircle( c.x - 10, c.y - 10, 10, 18 )
    	end
    end )



    Should I keep posting updates even when the more hack-like content (ESP, aimbot, etc.) comes into play, or are people going to get upset?
    Do what's best for science I say.
    Reply With Quote Edit / Delete Windows 7 Show Events Informative Informative x 1Optimistic Optimistic x 1 (list)

  35. Post #1115
    Gold Member
    Lord Ned's Avatar
    April 2006
    3,702 Posts
    Holy shit that was the most annoying bug. I had the game crashing, cause being an invalid pointer (0xDDDDDDDD) in vstdlib.dll. I wasn't calling any functions from there or even linking it. The crash always happened after one of my functions returned. Otherwise it was completely random. It would happen in the menu, when I pressed a button or after a few seconds in-game. Sometimes it never happened.
    I spent over an hour trying to debug the crash, did some tests and found out that it stopped when I commented out calls to my Lua hooks. I suspected the reason to be either luabind or the hook module not existing. However, it started again later, after I had rewritten the Lua hooks in C++. Again, I spent some time debugging, when it disappeared completely. I added the hooks back, played around with the code and the game didn't crash at all. Couple hours ago the crashing came back.
    Well, this time I was determined to find the cause. I took out IDA, attached the debugger to GMod and launched. The crash was indeed in vstdlib.dll, the function was trying to use the invalid pointer. It was a virtual method of some class. I checked the vtable for hints, found "VCvarQuery001". I compared it to the vstdlib's Mac version (which contains debug info), and found out that the guilty method was ICvar::FindCommandBase. This was really helpful and I managed to fix the bug. The cause?

    local lua_run = cvar.ConCommand( "ir_lua_run", lua_run_c )
    local lua_open = cvar.ConCommand( "ir_lua_open", lua_open_c )

    Can you spot it? It took me a while.
    I'm creating the ConCommands as locals. They get added to a linked list when created. The linked list is traversed by ICvar::FindCommandBase. Yep, the garbage collector got the concommands, Luabind deleted the C++ objects, but the destructor doesn't automatically remove it from the linked list.
    The fix was simple, I just added a destructor to the ConCommand wrapper that unregisters the command from the list.
    This is a random thought but: Source has support for local con-commands. I'm not sure how they link into the concommand bases though. I do understand this isn't your problem.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Disagree Disagree x 1 (list)

  36. Post #1116
    simie's Avatar
    March 2008
    134 Posts
    Bloom + that star shader from earlier...




    Bloom makes everything better.
    Reply With Quote Edit / Delete Mac United Kingdom Show Events Artistic Artistic x 10Agree Agree x 3Disagree Disagree x 2Winner Winner x 1 (list)

  37. Post #1117
    King of the Oil Refinery
    Tobba's Avatar
    December 2008
    6,229 Posts
    Needs more grain
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events Funny Funny x 4Useful Useful x 1Zing Zing x 1Agree Agree x 1 (list)

  38. Post #1118
    Gold Member
    esalaka's Avatar
    July 2007
    10,248 Posts
    Bloom + that star shader from earlier...




    Bloom makes everything better.
    Now that's a cool star
    Reply With Quote Edit / Delete Windows 7 Finland Show Events Agree Agree x 5 (list)

  39. Post #1119

    August 2011
    198 Posts
    What technique are you using for the bloom?
    Reply With Quote Edit / Delete Mac Canada Show Events

  40. Post #1120
    simie's Avatar
    March 2008
    134 Posts
    What technique are you using for the bloom?
    Pretty much this: http://create.msdn.com/en-US/educati...g/sample/bloom
    Reply With Quote Edit / Delete Mac United Kingdom Show Events