1. Post #241
    Nigey Nige's Avatar
    June 2010
    1,340 Posts
    When I saw that I expected dlaor_guy for some reason, nice work!
    Colour scheme.

    Edited:

    Goddammit now I've got to go get some content.

    Edited:

    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  2. Post #242
    Gold Member

    March 2005
    3,028 Posts
    Wavefront MTL loader, at least partially working:

    This ended up being a lot more work than I thought it would be. Actually loading the materials was simple enough, but I had to rework a lot of my OBJ loading code to actually split the model into smaller meshes, calculate tangents, etc.
    Reply With Quote Edit / Delete Linux Show Events Artistic Artistic x 8Programming King Programming King x 2Winner Winner x 1 (list)

  3. Post #243
    Exl
    Exl's Avatar
    October 2010
    85 Posts
    Had a lot of fun writing this unfinished "procedurally generated" shoot-em-up in JavaScript + Canvas. Not guaranteed to work in all browsers, but all of the latest major ones should do. Z to shoot, X to use the Nuke if you have one and use the arrow keys to move about. Zoom in the page (Ctrl+Scroll) if the screen is too small at your resolution.

    The enemies are placed randomly in a series of pre-programmed wave types, which in turn appear randomly as well. Most graphics were done by friends of mine, save for the HUD and some (arguably ripped) minor graphics. Sounds are courtesy of BFXR
    (http://www.bfxr.net/).



    http://www.dvdflick.net/zspace/
    http://www.dvdflick.net/zspace/zspace_dev.zip for the messy source code and a sound-enabled version, complete with terrible sound effects. Some large uncompressed images and sounds have been removed, but nothing vital.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events Winner Winner x 4Programming King Programming King x 2Informative Informative x 1Useful Useful x 1 (list)

  4. Post #244
    Der FΓΌhrer
    Quark:'s Avatar
    January 2011
    4,078 Posts
    It looks awesome but I have no idea what's going on! :P
    Therefore you must rate him artistic!
    Reply With Quote Edit / Delete Windows XP United States Show Events Agree Agree x 9 (list)

  5. Post #245
    Gold Member
    robmaister12's Avatar
    January 2008
    4,969 Posts
    oh wow I didn't know bfxr existed, it's definitely better than the already amazing sfxr.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 5 (list)

  6. Post #246
    Gold Member
    BlkDucky's Avatar
    May 2008
    6,485 Posts
    The enemies are placed randomly in a series of pre-programmed wave types, which in turn appear randomly as well. Most graphics were done by friends of mine, save for the HUD and some (arguably ripped) minor graphics. Sounds are courtesy of BFXR
    (http://www.bfxr.net/).
    Whoa. sfxr version 2.0? I never knew about this.

    Edit: Must refresh before posting. D:
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 5 (list)

  7. Post #247
    Bang Train's Avatar
    December 2007
    209 Posts
    seeing all this content makes me sad that I cant do it haha

    oh well. I got enough on my plate with my senior capstone project.

    I/O monitoring and enforcement inside a hypervisor...
    Reply With Quote Edit / Delete Windows 7 United States Show Events Programming King Programming King x 1 (list)

  8. Post #248
    Paid for a title.
    Maurice's Avatar
    June 2005
    6,175 Posts
    Vertical emancipation grills and loading.


    Yay.
    Also somehow my tiles got a different color. I'll fix that.
    The goombas die when they walk into the grill! Fun.
    Reply With Quote Edit / Delete Windows 7 Germany Show Events Programming King Programming King x 10 (list)

  9. Post #249
    Gold Member
    Dryvnt's Avatar
    February 2008
    1,763 Posts
    My life be like 000AAAh
    Reply With Quote Edit / Delete Windows 7 Denmark Show Events Agree Agree x 5Informative Informative x 1Funny Funny x 1Dumb Dumb x 1 (list)

  10. Post #250
    Felheart's Avatar
    June 2011
    353 Posts


    Catmull-Rom Splines for the curve. A particle emitter with procedural generated particles.
    And a sort of "texture generator" (the blue thing).

    I'm just programming stuff that I might need for projects / games in the future until I get a good idea for a game
    Reply With Quote Edit / Delete Windows 7 Germany Show Events Programming King Programming King x 4 (list)

  11. Post #251
    Dotmister's Avatar
    May 2008
    898 Posts
    My life be like 000AAAh
    Highly relevant.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 8Informative Informative x 1 (list)

  12. Post #252
    Felheart's Avatar
    June 2011
    353 Posts
    @Maurice: How do you detect and resolve collisions in your game?
    I tried AABBs, Pixel-Perfect and Sensors at the 4 corners of a AABB but none of the solutions work perfect in every situation.
    Reply With Quote Edit / Delete Windows 7 Germany Show Events Agree Agree x 4 (list)

  13. Post #253
    RyanDv3's Avatar
    May 2008
    999 Posts
    I'd also like to hear what Maurice does, but if my experience matters for anything, everything generally boils down to line-line checks when I'm doing collisions. Abstracted, it's generally line-"some other shape".

    Granted, I've never done a platformer so maybe there's some issues I'm not aware of.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  14. Post #254
    SupahVee's Avatar
    December 2007
    1,113 Posts
    Weapons are now generated procedurally by attaching a magazine, a stock and a grip to a core piece. They all change how the weapon behaves. Here's some generated weapons.

    Reply With Quote Edit / Delete Windows 7 Italy Show Events Programming King Programming King x 34Winner Winner x 6Artistic Artistic x 1 (list)

  15. Post #255
    Gold Member
    Dr Magnusson's Avatar
    July 2008
    2,694 Posts
    I'm very, very, very slowly working on turning my token list into an abstract syntax tree.

    So far I've managed to turn this:

    i32 hello = 10;
    
    i32 test(i32 something)
    {
        hello = 10;
    }
    
    i32 doStuff(i32 what, i32 that)
    {
        hello = what + that * 5;
    
        return 20;
    }
    

    Into this:

    Reply With Quote Edit / Delete Windows 7 Denmark Show Events Programming King Programming King x 6 (list)

  16. Post #256
    Gold Member
    ThePuska's Avatar
    October 2005
    3,418 Posts
    Did you also program the tree graph or is it some utility because I could use it as well
    Reply With Quote Edit / Delete Windows 7 Finland Show Events

  17. Post #257
    Gold Member
    Downsider's Avatar
    July 2007
    1,999 Posts
    @Maurice: How do you detect and resolve collisions in your game?
    I tried AABBs, Pixel-Perfect and Sensors at the 4 corners of a AABB but none of the solutions work perfect in every situation.
    If you can elaborate on that (i.e., what type of collision, world vs entity or entity vs entity, and when it fails most commonly), then we can definitely help you.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  18. Post #258
    SupahVee's Avatar
    December 2007
    1,113 Posts
    @Maurice: How do you detect and resolve collisions in your game?
    I tried AABBs, Pixel-Perfect and Sensors at the 4 corners of a AABB but none of the solutions work perfect in every situation.
    Remember my platform engine? I sort of improved it but it's really complex now. Collisions work almost perfectly though. I can explain to you on steam in a few hours.


    (Also added sweep collision tests, and made weapons accept ANY number of attachments.)
    Reply With Quote Edit / Delete Windows 7 Italy Show Events

  19. Post #259
    Gold Member
    Dr Magnusson's Avatar
    July 2008
    2,694 Posts
    Did you also program the tree graph or is it some utility because I could use it as well
    I didn't, I used this: http://www.ironcreek.net/phpsyntaxtree/

    It has a really simple syntax, so it's easy to have your program output a plaintext string that you can then throw at that website.
    Reply With Quote Edit / Delete Windows 7 Denmark Show Events Friendly Friendly x 1 (list)

  20. Post #260
    likesoursugar's Avatar
    January 2009
    651 Posts
    Time to give Maurice a run for his money. Or should I say Not Money.

    Recursion theoretically already works but I'm scared to test it because I think it will open a singularity or something.
    Working on something like this myself.
    Reply With Quote Edit / Delete Windows XP Sweden Show Events

  21. Post #261
    Gold Member
    esalaka's Avatar
    July 2007
    10,144 Posts
    Should that be called Not Competition, then
    Reply With Quote Edit / Delete Linux Finland Show Events Disagree Disagree x 1 (list)

  22. Post #262
    Gold Member
    TheBoff's Avatar
    September 2006
    660 Posts
    I'm very, very, very slowly working on turning my token list into an abstract syntax tree.

    So far I've managed to turn this:

    i32 hello = 10;
    
    i32 test(i32 something)
    {
        hello = 10;
    }
    
    i32 doStuff(i32 what, i32 that)
    {
        hello = what + that * 5;
    
        return 20;
    }
    

    Into this:

    Are you using an algorithmic technique (as in shift-reduce parsing of an LR(1) grammar or somesuch), or are you "making it up as you go along"?
    Reply With Quote Edit / Delete Windows 7 Russian Federation Show Events

  23. Post #263
    Gold Member
    Dr Magnusson's Avatar
    July 2008
    2,694 Posts
    Are you using an algorithmic technique (as in shift-reduce parsing of an LR(1) grammar or somesuch), or are you "making it up as you go along"?
    Making it up as I go along. Sort of.
    Reply With Quote Edit / Delete Windows 7 Denmark Show Events

  24. Post #264
    Gold Member
    thomasfn's Avatar
    July 2008
    2,960 Posts
    I am the master of strange bugs.

    Code:
    in vec3 inColour;
    out vec3 fragColour;
    
    void main()
    {
        stdTransform();
        //fragColour = inColour;
        fragColour = vec3( 0.0, 0.8, 0.0 );
    }


    Working perfect. Now, let's just uncomment that line and use colours from my array.

    Code:
    in vec3 inColour;
    out vec3 fragColour;
    
    void main()
    {
        stdTransform();
        fragColour = inColour;
        //fragColour = vec3( 0.0, 0.8, 0.0 );
    }


    Err
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Funny Funny x 20Winner Winner x 1 (list)

  25. Post #265
    Gold Member
    Dr Magnusson's Avatar
    July 2008
    2,694 Posts
    Pretty sure you'll want to make that color a vec4
    Reply With Quote Edit / Delete Windows 7 Denmark Show Events Agree Agree x 5 (list)

  26. Post #266
    Ask about my EBOLA fetish
    GameDev's Avatar
    February 2010
    12,394 Posts
    Vertical emancipation grills and loading.


    Yay.
    Also somehow my tiles got a different color. I'll fix that.
    The goombas die when they walk into the grill! Fun.
    Looking good, cant wait to try it out.
    Reply With Quote Edit / Delete United States Show Events

  27. Post #267
    Gold Member
    thomasfn's Avatar
    July 2008
    2,960 Posts
    Pretty sure you'll want to make that color a vec4
    In the frag shader:

    Code:
    in vec3 fragColour;
    out vec4 outColour;
    
    void main()
    {
        outColour = vec4( fragColour, 1.0 );
    }
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  28. Post #268
    Gold Member
    danharibo's Avatar
    July 2006
    4,488 Posts
    what is stdTransform(); ?
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 4 (list)

  29. Post #269
    Gold Member
    thomasfn's Avatar
    July 2008
    2,960 Posts
    My third vertex shader:

    Code:
    in vec3 inPosition;
    
    uniform mat4x4 mtxProjectionModelview;
    uniform mat4x4 mtxModelview;
    
    void stdTransform()
    {
        gl_Position = mtxProjectionModelview * vec4( inPosition, 1.0 );
    }
    I just found the bug though. Apparently you can't miss out any attributes in the shader declarations, and they have to be in the same order that they are mapped to the indices.

    Code:
    in vec3 inPosition;
    in vec3 inColour;
    Having that at the top of my shader fixes the bug, whereas:

    Code:
    in vec3 inColour;
    in vec3 inPosition;
    Doesn't work. inPosition and inColour are mapped to attrib index 0 and 1 respectively.

    Edited:

    So yea, I've been working on a basic OO wrapper which sits over OpenTK. A spinny coloured quad is rendered like so:

    using System;
    using System.Diagnostics;
    
    using OpenTK;
    using OpenTK.Graphics;
    using OpenTK.Graphics.OpenGL;
    
    using GLEx.Buffers;
    using GLEx.Misc;
    using GLEx.Shaders;
    
    namespace TestProject
    {
        public class TestWindow : GameWindow
        {
            private Camera viewpoint;
            private Mesh triangle;
            private ShaderProgram shader;
    
            private Stopwatch timer;
    
            private static GraphicsMode Mode
            {
                get
                {
                    return new GraphicsMode(new ColorFormat(32), 24, 8, 8);
                }
            }
    
            private static readonly string shdrVertex = @"
    in vec3 inPosition;
    in vec3 inColour;
    
    out vec4 frontColour;
    
    void main()
    {
        stdTransform();
        frontColour = vec4( inColour, 1.0 );
    }
    ";
    
            private static readonly string shdrFragment = @"
    in vec4 frontColour;
    out vec4 outColour;
    
    void main()
    {
        outColour = frontColour;
    }
    ";
    
            public TestWindow() : base(1024, 600, Mode, "GLEx Test Project") { }
    
            protected override void OnLoad(EventArgs e)
            {
                GL.Enable(EnableCap.DepthTest);
                GL.Disable(EnableCap.CullFace);
                GL.ClearColor(Color4.SkyBlue);
    
                this.VSync = VSyncMode.On;
    
                viewpoint = new Camera();
                viewpoint.UpdateProjection(this.Width, this.Height, (float)(Math.PI / 3d));
                viewpoint.Position = new Vector3(0f, 0f, -2f);
                viewpoint.Angle = new Vector3(0f, 0f, 0f);
    
                triangle = new Mesh();
                triangle.Generate(2);
    
                shader = ShaderFactory.QuickCreate(shdrVertex, shdrFragment, false);
                ShaderFactory.AttachStandardVertexShader(shader);
                shader.Compile();
    
                triangle.Usage = BufferUsageHint.StaticDraw;
                triangle.Shader = shader;
    
                triangle.BufferData(new Vector3[] {
                    new Vector3(-1f, -1f, 0f),
                    new Vector3(-1f, 1f, 0f),
                    new Vector3(1f, 1f, 0f),
                    new Vector3(1f, -1f, 0f)
                }, "inPosition");
                triangle.BufferData(new Vector3[] {
                    new Vector3(1f, 0f, 0f),
                    new Vector3(0f, 1f, 0f),
                    new Vector3(0f, 0f, 1f),
                    new Vector3(1f, 1f, 1f)
                }, "inColour");
    
                triangle.BufferIndices(new uint[] {
                    0, 1, 2,
                    0, 2, 3
                });
    
                timer = new Stopwatch();
                timer.Start();
            }
    
            protected override void OnRenderFrame(FrameEventArgs e)
            {
                GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
    
                viewpoint.ClearMatrixStack();
                viewpoint.ResetPerspective();
    
                float ang = 0.25f * (float)(timer.Elapsed.TotalSeconds * Math.PI);
    
                viewpoint.PushMatrix();
                viewpoint.Translate(Matrix4.CreateRotationY(ang));
    
                triangle.BeginRender();
                viewpoint.PrepareShader(shader, ProjectionType.Perspective);
                shader.BindFragData("outColour", 0);
                triangle.FinishRender();
    
                viewpoint.PopMatrix();
    
                this.SwapBuffers();
            }
    
        }
    }
    
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  30. Post #270
    open.gl
    Overv's Avatar
    February 2007
    7,431 Posts
    I just found the bug though. Apparently you can't miss out any attributes in the shader declarations, and they have to be in the same order that they are mapped to the indices.

    Code:
    in vec3 inPosition;
    in vec3 inColour;
    Having that at the top of my shader fixes the bug, whereas:

    Code:
    in vec3 inColour;
    in vec3 inPosition;
    Doesn't work. inPosition and inColour are mapped to attrib index 0 and 1 respectively.
    Assuming indices is never a good idea. Either fetch them using glGetAttribLocation or specify the attribute location manually. Also, what the hell is stdTransform?
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events Agree Agree x 4Late Late x 1 (list)

  31. Post #271
    Gold Member

    March 2005
    3,028 Posts
    Also, if you're writing GLSL 330 or newer, you can specify attribute locations with "layout(location=0) in vec3 color" right in GLSL code, which I thought was pretty spiffy.
    Reply With Quote Edit / Delete Windows 7 Show Events

  32. Post #272
    thf
    Gold Member
    Dennab
    June 2009
    3,331 Posts
    Also, if you're writing GLSL 330 or newer, you can specify attribute locations with "layout(location=0) in vec3 color" right in GLSL code, which I thought was pretty spiffy.
    Though I'd prefer a solution with glGetAttribLocation as it makes the code a bit easier to read in my opinion.
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events Agree Agree x 2 (list)

  33. Post #273
    Gold Member

    March 2005
    3,028 Posts
    I didn't, I used this: http://www.ironcreek.net/phpsyntaxtree/

    It has a really simple syntax, so it's easy to have your program output a plaintext string that you can then throw at that website.
    Graphviz is another good tool for visualizing structures. It also has a very simple plaintext format.
    Reply With Quote Edit / Delete Windows 7 Show Events

  34. Post #274
    Gold Member
    thomasfn's Avatar
    July 2008
    2,960 Posts
    Assuming indices is never a good idea. Either fetch them using glGetAttribLocation or specify the attribute location manually. Also, what the hell is stdTransform?
    I don't want to assume the indices, but apparently the order in which the attributes are defined in the shader must match the indices defined in code. Which completely defeats the objective of linking shaders. Unless I'm doing something wrong. Does this mean the proper way to do it involves programatically generating parts of the shader?
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  35. Post #275
    Gold Member

    March 2005
    3,028 Posts
    I don't want to assume the indices, but apparently the order in which the attributes are defined in the shader must match the indices defined in code. Which completely defeats the objective of linking shaders. Unless I'm doing something wrong. Does this mean the proper way to do it involves programatically generating parts of the shader?
    You need to manually specify the location of the attribute by using glBindAttribLocation or using the layout() syntax I mention above, or you have to retrieve the location with glGetAttribLocation.
    Reply With Quote Edit / Delete Windows 7 Show Events

  36. Post #276
    Gold Member
    Jookia's Avatar
    July 2007
    6,768 Posts
    I have a half-done converter for string encodings, since Windows uses UTF-16 and I'm using UTF-8. Ah, at least all the symbols get put to good use.

    😼
    Reply With Quote Edit / Delete Linux Australia Show Events Agree Agree x 2 (list)

  37. Post #277
    Gold Member
    thomasfn's Avatar
    July 2008
    2,960 Posts
    You need to manually specify the location of the attribute by using glBindAttribLocation or using the layout() syntax I mention above, or you have to retrieve the location with glGetAttribLocation.
    I am using glBindAttribLocation already. Using the layout syntax means programatically generating the shaders, which I'd rather avoid. I know the locations of the attributes in software, and I'm mapping the attrib indices to the respective name. OpenGL just doesn't seem to want to link it properly.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  38. Post #278
    Gold Member

    March 2005
    3,028 Posts
    I am using glBindAttribLocation already. Using the layout syntax means programatically generating the shaders, which I'd rather avoid. I know the locations of the attributes in software, and I'm mapping the attrib indices to the respective name. OpenGL just doesn't seem to want to link it properly.
    When are you calling glBindAttribLocation? It should be called before you link the program. If you call it after linking, the binds won't go into effect until you re-link it.
    Reply With Quote Edit / Delete Windows 7 Show Events

  39. Post #279
    Gold Member
    danharibo's Avatar
    July 2006
    4,488 Posts
    I am using glBindAttribLocation already. Using the layout syntax means programatically generating the shaders, which I'd rather avoid. I know the locations of the attributes in software, and I'm mapping the attrib indices to the respective name. OpenGL just doesn't seem to want to link it properly.
    You have to call glGetAttribLocation like so: this

    and then set the attribute that gets you Like so
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Useful Useful x 1 (list)

  40. Post #280
    Gold Member
    thomasfn's Avatar
    July 2008
    2,960 Posts
    You have to call glGetAttribLocation like so: this

    and then set the attribute that gets you Like so
    That fixed it, thanks. I got confused about what an attrib index really was.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events