1. Post #1161
    Gold Member
    danharibo's Avatar
    July 2006
    4,498 Posts
    You have to specify the fragment shader input as varying too, attributes are only accessible in the Vertex shader.

    Edited:

    e.g.

    Code:
    #version 120
    varying vec3 Color;
    void main(void) {
    gl_FragColor = vec4(Color, 1.0);
    }
    Reply With Quote Edit / Delete Linux United Kingdom Show Events Informative Informative x 1 (list)

  2. Post #1162
    Gold Member
    Lexic's Avatar
    March 2009
    6,123 Posts
    While I was stuck in a welsh hotel with no WiFi, no mobile signal to speak of and no TV over the weekend, I got on with my BASIC parser.
    I managed to download the wikipedia pages on RPN and the Shunting Yard algo and after quite a bit of head pounding it all clicked and I managed to quite neatly make a RPN calculator that conformed to my delayed execution model.
    Code:
    PS C:\Users\Lexi\Documents\BASIC> lua .\basic.lua WOO_EXPRCALC.BAS
    Parsing...
    10      'LET A = 3 + 4 * 2 / ( 1 - 5 ) ^ 2 ^ 3'
    Line matched pattern    ^LET%s+(%u.-)%s+=%s+(.+)$
    Expression is arithmetic:       '3','+','4','*','2','/','(','1','-','5',')','^','2','^','3'
    Expression matched pattern      ^[-+]?%d+$
    Expression matched pattern      ^[-+]?%d+$
    Expression matched pattern      ^[-+]?%d+$
    Expression matched pattern      ^[-+]?%d+$
    Expression matched pattern      ^[-+]?%d+$
    Expression matched pattern      ^[-+]?%d+$
    Expression matched pattern      ^[-+]?%d+$
    20      'REM Fun fact: ECMA-55 has different ideas about associativity to everyone else. ^ is therefore left assoc'
    Line matched pattern    ^REM.*$
    30      'PRINT A'
    Line matched pattern    ^PRINT%s+(.+)$
    Expression matched pattern      ^%u%d?$
    40      'END'
    Line matched pattern    ^END$
    Running:
    3.001953125
    Program has reached the END statement.
    Program ended on line 40
    This works in places like array subscripts
    Code:
    PS C:\Users\Lexi\Documents\BASIC> lua .\basic.lua STUPID_ARITH.BAS
    Parsing...
    10      'DIM A1 (120)'
    Line matched pattern    ^DIM%s+(%u.+)$
    19      'REM A1(2) == 12'
    Line matched pattern    ^REM.*$
    20      'LET A1(2) = 5 + 7'
    Line matched pattern    ^LET%s+(%u.-)%s+=%s+(.+)$
    Expression is arithmetic:       '5','+','7'
    Expression matched pattern      ^[-+]?%d+$
    Expression matched pattern      ^[-+]?%d+$
    Expression matched pattern      ^[-+]?%d+$
    29      'REM A1(3) == 108'
    Line matched pattern    ^REM.*$
    30      'LET A1(1 + 2) = A1(2) * 9'
    Line matched pattern    ^LET%s+(%u.-)%s+=%s+(.+)$
    Expression is arithmetic:       'A1(2)','*','9'
    Expression matched pattern      ^(%u%d?)(%b())$
    Expression matched pattern      ^[-+]?%d+$
    Expression matched pattern      ^[-+]?%d+$
    Expression is arithmetic:       '1','+','2'
    Expression matched pattern      ^[-+]?%d+$
    Expression matched pattern      ^[-+]?%d+$
    39      'REM A1(120) = 12 * 108 = 1296'
    Line matched pattern    ^REM.*$
    40      'LET A1(A1(2) + A1(3)) = A1(1 * 2) * A1(1 + 1 + 1)'
    Line matched pattern    ^LET%s+(%u.-)%s+=%s+(.+)$
    Expression is arithmetic:       'A1(1*2)','*','A1(1+1+1)'
    Expression matched pattern      ^(%u%d?)(%b())$
    Expression is arithmetic:       '1','*','2'
    Expression matched pattern      ^[-+]?%d+$
    Expression matched pattern      ^[-+]?%d+$
    Expression matched pattern      ^(%u%d?)(%b())$
    Expression is arithmetic:       '1','+','1','+','1'
    Expression matched pattern      ^[-+]?%d+$
    Expression matched pattern      ^[-+]?%d+$
    Expression matched pattern      ^[-+]?%d+$
    Expression is arithmetic:       'A1(2)','+','A1(3)'
    Expression matched pattern      ^(%u%d?)(%b())$
    Expression matched pattern      ^[-+]?%d+$
    Expression matched pattern      ^(%u%d?)(%b())$
    Expression matched pattern      ^[-+]?%d+$
    50      'PRINT A1(120)'
    Line matched pattern    ^PRINT%s+(.+)$
    Expression matched pattern      ^(%u%d?)(%b())$
    Expression matched pattern      ^[-+]?%d+$
    60      'END'
    Line matched pattern    ^END$
    Running:
    1296
    Program has reached the END statement.
    Program ended on line 60
    So that's nice.
    I was going to post this earlier, but I figured I could get the INPUT statement working, and whadayaknow I could.
    Code:
    PS C:\Users\Lexi\Documents\BASIC> lua .\basic.lua MESSAGE.BAS
    Parsing...
    10      'PRINT "Please input the message you want repeated followed by the number of repitions."'
    Line matched pattern    ^PRINT%s+(.+)$
    Expression matched pattern      ^"(.*)"$
    20      'INPUT M$, R'
    Line matched pattern    ^INPUT%s+(.+)$
    30      'IF R < 1 THEN 70'
    Line matched pattern    ^IF%s+(.+)%s+([<>=][>=]?)%s+(.+)%s+THEN%s+(%d+)$
    Expression matched pattern      ^%u%d?$
    Expression matched pattern      ^[-+]?%d+$
    40      'PRINT M$'
    Line matched pattern    ^PRINT%s+(.+)$
    Expression matched pattern      ^%u$$
    50      'LET R = R - 1'
    Line matched pattern    ^LET%s+(%u.-)%s+=%s+(.+)$
    Expression is arithmetic:       'R','-','1'
    Expression matched pattern      ^%u%d?$
    Expression matched pattern      ^[-+]?%d+$
    60      'GOTO 30'
    Line matched pattern    ^GO%s*TO%s+(%d+)$
    70      'PRINT "Would you like to repeat another message? [Y/N]"'
    Line matched pattern    ^PRINT%s+(.+)$
    Expression matched pattern      ^"(.*)"$
    80      'INPUT C$'
    Line matched pattern    ^INPUT%s+(.+)$
    90      'IF C$ = "Y" THEN 10'
    Line matched pattern    ^IF%s+(.+)%s+([<>=][>=]?)%s+(.+)%s+THEN%s+(%d+)$
    Expression matched pattern      ^%u$$
    Expression matched pattern      ^"(.*)"$
    99      'END'
    Line matched pattern    ^END$
    Running:
    Please input the message you want repeated followed by the number of repitions.
    Please enter 2 inputs:
    > HI FP, 20
    HI FP
    HI FP
    HI FP
    HI FP
    HI FP
    HI FP
    HI FP
    HI FP
    HI FP
    HI FP
    HI FP
    HI FP
    HI FP
    HI FP
    HI FP
    HI FP
    HI FP
    HI FP
    HI FP
    HI FP
    Would you like to repeat another message? [Y/N]
    Please enter 1 inputs:
    > N
    Program has reached the END statement.
    Program ended on line 99
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Programming King Programming King x 7Artistic Artistic x 1Winner Winner x 1Informative Informative x 1 (list)

  3. Post #1163
    Bang Train's Avatar
    December 2007
    209 Posts
    Reading up on GLM...it likes to use AVX on my desktop but if I distribute it do I need to disable the SSE extension compiling for others to use? What do other people do?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  4. Post #1164
    jonnopon3000's Avatar
    August 2009
    385 Posts
    You have to specify the fragment shader input as varying too, attributes are only accessible in the Vertex shader.

    Edited:

    e.g.

    Code:
    #version 120
    varying vec3 Color;
    void main(void) {
    gl_FragColor = vec4(Color, 1.0);
    }
    I had tried that before, changed it back because it didn't produce any success - but it does make sense, danke.
    Unfortunately, even with that change, the problem is still in the shader compilation (glGetError != 0 after program linking), and I have no drawn vertices.
    For further reference, in case it's important, the vertices array looks like this:

    float[] vertices = new float[] {
    0.0f, 0.5f, 1.0f, 0.0f, 0.0f, //vertex 1 - red
    0.5f, -0.5f, 0.0f, 1.0f, 0.0f, //vertex 2 - green
    -0.5f, -0.5f, 0.0f, 0.0f, 1.0f //vertex 3 - blue
    };
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  5. Post #1165
    open.gl
    Overv's Avatar
    February 2007
    7,431 Posts
    You should check the error log.

    Apart from that, unrelated to your program linking error, your vertex pointer values are off. You're specifying 5 as vertex size, but each of your vertices is 20 bytes in size (5 values * 4 bytes per float). Your pointer offset of 2 has the same problem.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events Useful Useful x 1 (list)

  6. Post #1166
    jonnopon3000's Avatar
    August 2009
    385 Posts
    You should check the error log.

    Apart from that, unrelated to your program linking error, your vertex pointer values are off. You're specifying 5 as vertex size, but each of your vertices is 20 bytes in size (5 values * 4 bytes per float). Your pointer offset of 2 has the same problem.
    Awesome, I changed the last two params on vertexAttribPointer (then looked back at the tutorial and realised that I should've known I was missing this anyway -- disclaimer: I work nights and occasionally miss small things, which I usually find at some point later with a bit of a facepalm moment), found the problem in the program linking by trial and error, and woop! I can finally move on :L

    Accessing the error log is a little weird for me, since I'm working in Java's LWJGL and it has different param requirements for many of the functions related to it. In whole, it means it works quite a bit differently, and of course it's undocumented. Found one guy's solution to it and it didn't work so I gave up. Luckily, trial and error has, so far, helped in its stead.

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

  7. Post #1167
    chimitos's Avatar
    September 2010
    2,378 Posts
    I know I'm making a fool out of myself by posting new languages I'm trying to learn and such, but this is WAYWO after all. I'm supposed to post on new things I'm learning or working on that is related to programming. Ignore me if you wish, I was just posting a cool site that I liked and thought you guys would like it as well. Again, I'm just showing my progress.
    You consider finding a website progress?

    Edited:

    AMC's post at the bottom of last page said what I meant much more clearly.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Zing Zing x 4Agree Agree x 1Dumb Dumb x 1 (list)

  8. Post #1168
    laylay's Avatar
    November 2007
    599 Posts
    Rewrote a lot of the game so everyone, including the local player is a character in the game, that means I can go thirdperson with my local player or spectate someone else in firstperson asif it was a local player.

    Also drawing the weapons players are holding. Need to make some animations so they hold weapons correctly but I'm terrible with blender.



    Edited:

    Also laserguns

    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Programming King Programming King x 17Winner Winner x 3Informative Informative x 1Artistic Artistic x 1 (list)

  9. Post #1169
    Mr Kirill's Avatar
    January 2008
    333 Posts
    Made some progress since yesterday - added menu & started working on tutorial stage!


    Edited:

    Also laserguns

    Powerpuff Orcs
    Reply With Quote Edit / Delete Windows 7 Latvia Show Events Funny Funny x 13Winner Winner x 1Agree Agree x 1 (list)

  10. Post #1170
    Gold Member
    ZenX2's Avatar
    February 2009
    5,127 Posts
    So the game is about a cat chasing it's own tail while tripping on catnip?
    Reply With Quote Edit / Delete Windows 7 United States Show Events Funny Funny x 4Agree Agree x 1 (list)

  11. Post #1171
    Richy19's Avatar
    May 2010
    5,412 Posts
    Can anyone think of any beginner-intermediate openGL project I could have a go at?
    Reply With Quote Edit / Delete Linux United Kingdom Show Events

  12. Post #1172
    ECrownofFire's Avatar
    January 2011
    2,034 Posts
    Can anyone think of any beginner-intermediate openGL project I could have a go at?
    Load a 3D model from a file (like .obj) and display it?
    Reply With Quote Edit / Delete Windows XP United States Show Events Agree Agree x 1 (list)

  13. Post #1173
    Gold Member
    danharibo's Avatar
    July 2006
    4,498 Posts
    Can anyone think of any beginner-intermediate openGL project I could have a go at?
    A model viewer with deferred lighting, HDR, bloom and lens flare.
    Reply With Quote Edit / Delete Linux United Kingdom Show Events Funny Funny x 11 (list)

  14. Post #1174
    Gold Member
    Naelstrom's Avatar
    June 2010
    2,758 Posts
    Can anyone think of any beginner-intermediate openGL project I could have a go at?
    Proper text loading and rendering (including multiple languages!).
    http://facepunch.com/showthread.php?...1#post36626273
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  15. Post #1175
    Richy19's Avatar
    May 2010
    5,412 Posts
    Load a 3D model from a file (like .obj) and display it?
    I already did that a while back, and tbh I dont really want to do file loading.
    TBH I would like to do somethink like terrain generation but:
    A) I already did basic terraig generation
    B) I dont know what else to do after the terrain has been generated and displayed, like adding controls to do stuff or something

    I wish to accomplish something like this:
    http://www.youtube.com/watch?v=mTrSz6OcMl4&feature=plcp
    http://www.youtube.com/watch?v=482Fzm-uckc&feature=plcp
    http://www.youtube.com/watch?v=1lv2y15c-as&feature=plcp
    http://www.youtube.com/watch?v=MJLPBIi7tIc&feature=plcp

    http://www.youtube.com/watch?v=cyN29IMS8Q0
    http://www.youtube.com/watch?v=0bQz5...eature=related
    http://www.youtube.com/watch?v=rL8zDgTlXso
    http://www.youtube.com/watch?v=X2dyiitk6EY

    But I can barelly make terrain generation good, I have no idea how I would turn that into a sphere, also I dont really know how I could optimize performance, I remember with my terrain a 200x200 plane was barelly running at 60fps.
    TLDR I jhave no idea how I would start with planet generation

    Edited:

    Proper text loading and rendering (including multiple languages!).
    http://facepunch.com/showthread.php?...1#post36626273
    Also did that, albeit first using null's program to get a bitmap and the positions and sizes of the characters

    Edited:

    Does anyone have a good guide/resouorce for implementing quadtrees/octrees/whatevertrees are best in a terrain/planetary situation
    Reply With Quote Edit / Delete Linux United Kingdom Show Events

  16. Post #1176
    BOSSMAN
    leontodd's Avatar
    January 2009
    4,492 Posts
    During the day, I'm not motivated to do anything. At 2 in the morning, I get all this inspiration to program but I end up going to bed because I don't want to feel like shit in the morning. Any solutions?
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 13Friendly Friendly x 1 (list)

  17. Post #1177
    Gold Member
    danharibo's Avatar
    July 2006
    4,498 Posts
    During the day, I'm not motivated to do anything. At 2 in the morning, I get all this inspiration to program but I end up going to bed because I don't want to feel like shit in the morning. Any solutions?
    Change timezones.


    Write down the ideas you get before going to bed, then plan them out the following day, fleshing out the idea with designs might help you get motivated.
    Reply With Quote Edit / Delete Linux United Kingdom Show Events Agree Agree x 1 (list)

  18. Post #1178
    Ask Rohan about rust keys!
    Bumrang's Avatar
    August 2011
    2,854 Posts
    During the day, I'm not motivated to do anything. At 2 in the morning, I get all this inspiration to program but I end up going to bed because I don't want to feel like shit in the morning. Any solutions?
    Oh my god this. This so much.
    Reply With Quote Edit / Delete Linux United States Show Events Agree Agree x 10Funny Funny x 3 (list)

  19. Post #1179
    open.gl
    Overv's Avatar
    February 2007
    7,431 Posts
    Decided to check if frame buffers in OOGL work properly by making a small shadow mapping demo.

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

  20. Post #1180
    voodooattack's Avatar
    October 2009
    1,994 Posts
    God damn it Overv, stop changing stuff while I'm trying to port it to .NET..
    Reply With Quote Edit / Delete Windows 7 Egypt Show Events Friendly Friendly x 1Funny Funny x 1 (list)

  21. Post #1181
    Gold Member
    Naelstrom's Avatar
    June 2010
    2,758 Posts
    Decided to check if frame buffers in OOGL work properly by making a small shadow mapping demo.

    Are they OGL version independent? It was a pain in the ass for me to make sure my FBOs worked on OGL 2.0.
    Reply With Quote Edit / Delete Linux United States Show Events

  22. Post #1182
    open.gl
    Overv's Avatar
    February 2007
    7,431 Posts
    Are they OGL version independent? It was a pain in the ass for me to make sure my FBOs worked on OGL 2.0.
    It could work on OGL 2.0, but OOGL uses 3.2 functions for its frame buffer implementation.

    God damn it Overv, stop changing stuff while I'm trying to port it to .NET..
    You are aware OOGL is being modelled after OpenTK/Tao?
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events Informative Informative x 1 (list)

  23. Post #1183
    Gold Member
    Naelstrom's Avatar
    June 2010
    2,758 Posts
    It could work on OGL 2.0, but OOGL uses 3.2 functions for its frame buffer implementation.
    It'd be nice if you would fall back to extensions if the version is too low without the programmer knowing. Or is that against your wrapper's philosophy?
    Reply With Quote Edit / Delete Linux United States Show Events

  24. Post #1184
    voodooattack's Avatar
    October 2009
    1,994 Posts
    You are aware OOGL is being modelled after OpenTK/Tao?
    Yeah, I'm only porting the sweet stuff OpenTK lacks. Like the VertexBuffer object.

    Edited:

    And by porting I mean wrapping it using C++/CLI.

    Edit: Nvm, It'd be easier to port it to C# directly.
    Reply With Quote Edit / Delete Windows 7 Egypt Show Events

  25. Post #1185
    open.gl
    Overv's Avatar
    February 2007
    7,431 Posts
    It'd be nice if you would fall back to extensions if the version is too low without the programmer knowing. Or is that against your wrapper's philosophy?
    It is because it needs to be forward-compatible, sorry.
    Reply With Quote Edit / Delete Windows 7 Netherlands Show Events Friendly Friendly x 2 (list)

  26. Post #1186
    Gold Member
    Naelstrom's Avatar
    June 2010
    2,758 Posts
    It is because it needs to be forward-compatible, sorry.
    As long as you print error messages and warn users that half of waywo can't run it on their laptop, I'm ok with it.
    Reply With Quote Edit / Delete Linux United States Show Events

  27. Post #1187
    Gold Member
    Jookia's Avatar
    July 2007
    6,768 Posts
    So OOGL is strictly 3.2+? Because I'll have to wait until Mesa 9 for that then.
    Reply With Quote Edit / Delete Linux Australia Show Events Agree Agree x 4 (list)

  28. Post #1188
    false prophet's Avatar
    October 2011
    962 Posts
    I made some more programming flavor youtube poop.

    Yay.. more dll injection.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Useful Useful x 1Winner Winner x 1 (list)

  29. Post #1189
    ASK ME ABOUT MY PLAYBOOK INSTEAD OF COLLEGE
    icantread49's Avatar
    April 2011
    1,626 Posts
    Reply With Quote Edit / Delete Windows XP United States Show Events Winner x 7Programming King x 2Useful x 1Informative x 1Artistic x 1Friendly x 1 (list)

  30. Post #1190
    Gold Member
    Parakon's Avatar
    November 2008
    8,520 Posts
    did the second one get stuck?
    Reply With Quote Edit / Delete Windows 7 Canada Show Events Disagree Disagree x 1 (list)

  31. Post #1191
    Gold Member
    Smashmaster's Avatar
    April 2005
    1,549 Posts
    did the second one get stuck?
    The portals are pretty hard to see because they're the same color as the blocks they're on. It wasn't stuck, it just didn't land on a portal.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 5 (list)

  32. Post #1192
    Gold Member
    ZenX2's Avatar
    February 2009
    5,127 Posts
    The portals definitely need to be more visible
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 12 (list)

  33. Post #1193
    itty-bitty pretty kitty
    Dennab
    September 2008
    9,837 Posts
    God damn it Overv, stop changing stuff while I'm trying to port it to .NET..
    if you do that

    i will love you forever


    Reply With Quote Edit / Delete Windows 7 United States Show Events Funny Funny x 1 (list)

  34. Post #1194
    my portfolio
    Dennab
    April 2012
    1,392 Posts
    if you do that

    i will love you forever


    uh, what's wrong with OpenTK?
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  35. Post #1195
    ArgvCompany's Avatar
    June 2012
    549 Posts
    uh, what's wrong with OpenTK?
    The OpenGL interface itself in it is entirely procedural.
    Reply With Quote Edit / Delete Windows 7 Germany Show Events Agree Agree x 5 (list)

  36. Post #1196
    itty-bitty pretty kitty
    Dennab
    September 2008
    9,837 Posts
    uh, what's wrong with OpenTK?
    it's harrrrrdddddd
    Reply With Quote Edit / Delete Windows 7 United States Show Events Disagree Disagree x 7Funny Funny x 4 (list)

  37. Post #1197
    Gold Member
    Darwin226's Avatar
    January 2009
    4,159 Posts
    it's harrrrrdddddd
    If you can't use OpenTK, you won't be able to use OOGL.
    Reply With Quote Edit / Delete Windows 7 Croatia Show Events Agree Agree x 4 (list)

  38. Post #1198
    voodooattack's Avatar
    October 2009
    1,994 Posts
    it's harrrrrdddddd
    More like tedious tbh. I don't like it for that reason, repetitive and tedious.
    Reply With Quote Edit / Delete Windows 7 Egypt Show Events Agree Agree x 2 (list)

  39. Post #1199
    my portfolio
    Dennab
    April 2012
    1,392 Posts
    My Nexus 7 arrived! Any Android developers have any good tutorials for developing on Android? Would greatly appreciate it! :)

    Edited:

    Also Overv, hurry with that FP app, Geels doesn't scale too well!
    Reply With Quote Edit / Delete United Kingdom Show Events Winner Winner x 4Funny Funny x 1 (list)

  40. Post #1200
    ECrownofFire's Avatar
    January 2011
    2,034 Posts
    Anybody know of a simple way to take two square PNGs of equal size and put them side by side in a new image (e.g., take two 256x256 images and make it into a 256x512 or 512x256)? Any language, I can just port it to C++. That, or a good PNG library with C or C++ bindings.
    Reply With Quote Edit / Delete Windows XP United States Show Events Dumb Dumb x 1 (list)