• What Are You Working On August 2012
    2,271 replies, posted
[QUOTE=BlkDucky;37312175]Why do you people even bother replying to Mr T's posts? Seriously, unless he specifically asks for help (and even then I'd be hesitant) I just ignore him. Far more trouble than it's worth, especially when his post is just about a site that everyone on the planet already knows about. [editline]19th August 2012[/editline] thisthisthisthis[/QUOTE] 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.
[QUOTE=Mr.T;37312912]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.[/QUOTE] It's cool that you're trying out new things, but at some point you have to settle with what you have and make something.
[QUOTE=Richy19;37310874]Mind going into detail about this?[/QUOTE] For whatever reason I could not create a simple FBO with a single stencil buffer attached, nor could I create one with a separate depth and stencil buffer attached. The only solution was to create a single render buffer and attach it to both the stencil and the depth attachment points. Which worked surprisingly well. I made sure to error check it and so far nobody has failed to create the frankenstein fbo. [QUOTE=ECrownofFire;37312800]Couple of things. 1. The character never stops drifting. 2. [url=http://i.imgur.com/c2X3E.png]Flares and a bit of the floor under them[/url] are drawn on top of the character.[/QUOTE] Both are known thanks, I'm glad it works on your system!
[QUOTE=Naelstrom;37313153][B]For whatever reason I could not create a simple FBO with a single stencil buffer attached, nor could I create one with a separate depth and stencil buffer attached.[/B] The only solution was to create a single render buffer and attach it to both the stencil and the depth attachment points. Which worked surprisingly well. I made sure to error check it and so far nobody has failed to create the frankenstein fbo.[/QUOTE] Is this an opengl 2 limitation? only I cant create one without errors either
I might have misunderstood but the only things you can do is depth only buffer like GL_DEPTH_COMPONENT24 or depth and stencil buffer such as GL_DEPTH24_STENCIL8
A tiling window manager in 200 lines. [img]http://i.imgur.com/s5KQe.png[/img]
[QUOTE=Richy19;37313194]Is this an opengl 2 limitation? only I cant create one without errors either[/QUOTE] I'm pretty sure it's a hardware limitation; according to this: [url]http://www.opengl.org/wiki/Framebuffer_Object#Completeness_Rules[/url] The video card isn't required to support all types of fbo's, so on some hardware it will report it isn't supported.
[QUOTE=Philly c;37313279]I might have misunderstood but the only things you can do is depth only buffer like GL_DEPTH_COMPONENT24 or depth and stencil buffer such as GL_DEPTH24_STENCIL8[/QUOTE] Hmm tried changing it but it doesnt seem to work either. This is how I do it [csharp] GL.BindRenderbuffer (RenderbufferTarget.RenderbufferExt, _depthBuff); GL.RenderbufferStorage (RenderbufferTarget.RenderbufferExt, RenderbufferStorage.DepthComponent24, w, h); GL.FramebufferRenderbuffer (FramebufferTarget.FramebufferExt, FramebufferAttachment.DepthAttachmentExt, RenderbufferTarget.RenderbufferExt, _depthBuff); GL.BindTexture (TextureTarget.Texture2D, _texture); GL.TexImage2D (TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, w, h, 0, PixelFormat.Rgba, PixelType.UnsignedByte, IntPtr.Zero); GL.TexParameter (TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int)TextureParameterName.ClampToEdge); GL.TexParameter (TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int)TextureParameterName.ClampToEdge); GL.TexParameter (TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear); GL.TexParameter (TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear); GL.BindTexture (TextureTarget.Texture2D, 0); GL.BindFramebuffer (FramebufferTarget.FramebufferExt, _fbo); GL.FramebufferTexture2D (FramebufferTarget.FramebufferExt, FramebufferAttachment.ColorAttachment0Ext, TextureTarget.Texture2D, _texture, 0); GL.FramebufferRenderbuffer (FramebufferTarget.FramebufferExt, FramebufferAttachment.DepthAttachmentExt, RenderbufferTarget.RenderbufferExt, _depthBuff); FramebufferErrorCode status = GL.CheckFramebufferStatus (FramebufferTarget.FramebufferExt); if (status != FramebufferErrorCode.FramebufferCompleteExt) { System.Console.WriteLine ("Couldn't create frame buffer"); GL.BindFramebuffer (FramebufferTarget.FramebufferExt, 0); ErrorChecking.ThrowErrors (); return false; } GL.BindRenderbuffer (RenderbufferTarget.RenderbufferExt, 0); GL.BindFramebuffer (FramebufferTarget.FramebufferExt, 0); ErrorChecking.ThrowErrors (); return true;[/csharp] Yet I always get invalid operation at the 3rd line
[QUOTE=Mr.T;37312912]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.[/QUOTE] We criticize you out of our own experience, not for the fun of being jerks. What the other regulars have said here is right. You need to stop playing around with all of these different languages and actually produce something. Settle on one language you enjoy the most out of the ones you've worked with thus far, and settle on one that will allow you to produce the type of work you want to produce (games, web software, etc.). Move on to other things when you're exceedingly proficient. It's good to have a diverse skill set, but an individual who is abysmal with his entire toolset is an individual who will build nothing. Good on you for not abandoning WAYWO though, and that you keep on truckin'. You don't see that around here too much with people that aren't regulars.
[QUOTE=Lexic;37312770]I'm a bit late, but look into Exuberant CTags. It goes through a codebase, notes where each function is defined and then outputs the lot into a database that can be read by all good editors so you can jump to definitions just by highlighting the function. (By which I mean Vim can do this and presumably other things can too, either natively or with plugins.)[/QUOTE] How do you generate your tags, by the way? By hand, or do you monitor the directory somehow? :make ctags?
[QUOTE=Richy19;37313526]Hmm tried changing it but it doesnt seem to work either. This is how I do it Yet I always get invalid operation at the 3rd line[/QUOTE] At line 15 you seem to be binding the framebuffer that needs to be bound before line 3.
[QUOTE=Philly c;37313759]At line 15 you seem to be binding the framebuffer that needs to be bound before line 3.[/QUOTE] :DDD Binded it first and now it works fine :D I sware i followed a tutorial for that so it must be wrong :P
[QUOTE=esalaka;37313745]How do you generate your tags, by the way? By hand, or do you monitor the directory somehow? :make ctags?[/QUOTE] Manually when I notice that it's out of date. I'm too lazy to work out a better solution. :v:
So, working on Overv's open.gl tutorials, and I find out when it hits shaders that this machine only supports GLSL 1.2. After many many googles (seriously the documentation is either crap or nil) I find that "out" doesn't exist in GLSL 1.2 as it does in 1.5, and that possibly maybe "varying" does the same thing. From then to now I've tried everything I can possibly think of given my lack of knowledge and the minimalistic coverage online, and I'm stuck. I can get uniform variables working, that's fine, just when I try to transfer data from the vertex shader to the fragment shader I am completely stuck. This is very likely extremely incorrect, but have some shader source: Vertex: [QUOTE]#version 120 attribute vec2 position; attribute vec3 color; varying vec3 Color; void main(void) { Color = color; gl_Position = vec4(position, 0.0, 1.0); }[/QUOTE] Fragment: [QUOTE]#version 120 attribute vec3 Color; void main(void) { gl_FragColor = vec4(Color, 1.0); }[/QUOTE] And I'm finding the attributes in the vertex shader with this code: [QUOTE]int posAttrib = glGetAttribLocation(shaderProgram, "position"); glEnableVertexAttribArray(posAttrib); glVertexAttribPointer(posAttrib, 2, GL_FLOAT, false, 5, 0); int colAttrib = glGetAttribLocation(shaderProgram, "color"); glEnableVertexAttribArray(colAttrib); glVertexAttribPointer(colAttrib, 3, GL_FLOAT, false, 5, 2);[/QUOTE] I miss my OpenGL 4.0 compatible laptop :(
You have to specify the fragment shader input as [i]varying[/i] too, attributes are only accessible in the Vertex shader. [editline]19th August 2012[/editline] e.g. [code] #version 120 varying vec3 Color; void main(void) { gl_FragColor = vec4(Color, 1.0); }[/code]
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[/code] 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[/code] 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[/code] [IMG]http://i.imgur.com/H2Tg5.gif[/IMG]
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?
[QUOTE=danharibo;37314215]You have to specify the fragment shader input as [i]varying[/i] too, attributes are only accessible in the Vertex shader. [editline]19th August 2012[/editline] e.g. [code] #version 120 varying vec3 Color; void main(void) { gl_FragColor = vec4(Color, 1.0); }[/code][/QUOTE] 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: [QUOTE]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 };[/QUOTE]
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.
[QUOTE=Overv;37314801]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.[/QUOTE] 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!
[QUOTE=Mr.T;37312912]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. [B]Again, I'm just showing my progress.[/B][/QUOTE] You consider finding a website progress? [editline]19th August 2012[/editline] AMC's post at the bottom of last page said what I meant much more clearly.
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. [IMG]https://dl.dropbox.com/u/99765/fortblox/fbeufrwe9.png[/IMG] [editline]19th August 2012[/editline] Also laserguns [IMG]https://dl.dropbox.com/u/99765/fortblox/fb32002l.png[/IMG]
Made some progress since yesterday - added menu & started working on tutorial stage! [media]http://www.youtube.com/watch?v=6P4ccwF-3HE[/media] [editline]19th August 2012[/editline] [QUOTE=laylay;37316114] Also laserguns [IMG]https://dl.dropbox.com/u/99765/fortblox/fb32002l.png[/IMG][/QUOTE] Powerpuff Orcs
So the game is about a cat chasing it's own tail while tripping on catnip?
Can anyone think of any beginner-intermediate openGL project I could have a go at?
[QUOTE=Richy19;37319224]Can anyone think of any beginner-intermediate openGL project I could have a go at?[/QUOTE] Load a 3D model from a file (like .obj) and display it?
[QUOTE=Richy19;37319224]Can anyone think of any beginner-intermediate openGL project I could have a go at?[/QUOTE] A model viewer with deferred lighting, HDR, bloom and lens flare.
[QUOTE=Richy19;37319224]Can anyone think of any beginner-intermediate openGL project I could have a go at?[/QUOTE] Proper text loading and rendering (including multiple languages!). [url]http://facepunch.com/showthread.php?t=1195600&p=36626273&viewfull=1#post36626273[/url]
[QUOTE=ECrownofFire;37319237]Load a 3D model from a file (like .obj) and display it?[/QUOTE] 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: [url]http://www.youtube.com/watch?v=mTrSz6OcMl4&feature=plcp[/url] [url]http://www.youtube.com/watch?v=482Fzm-uckc&feature=plcp[/url] [url]http://www.youtube.com/watch?v=1lv2y15c-as&feature=plcp[/url] [url]http://www.youtube.com/watch?v=MJLPBIi7tIc&feature=plcp[/url] [url]http://www.youtube.com/watch?v=cyN29IMS8Q0[/url] [url]http://www.youtube.com/watch?v=0bQz5ugtfLY&feature=related[/url] [url]http://www.youtube.com/watch?v=rL8zDgTlXso[/url] [url]http://www.youtube.com/watch?v=X2dyiitk6EY[/url] 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 [editline]20th August 2012[/editline] [QUOTE=Naelstrom;37319355]Proper text loading and rendering (including multiple languages!). [url]http://facepunch.com/showthread.php?t=1195600&p=36626273&viewfull=1#post36626273[/url][/QUOTE] Also did that, albeit first using null's program to get a bitmap and the positions and sizes of the characters [editline]20th August 2012[/editline] Does anyone have a good guide/resouorce for implementing quadtrees/octrees/whatevertrees are best in a terrain/planetary situation
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?
Sorry, you need to Log In to post a reply to this thread.