• What Are You Working On August 2012
    2,271 replies, posted
[QUOTE=Richy19;37446352]Anything is possible with programming :P[/QUOTE] [t]http://i45.tinypic.com/34yvjte.png[/t] Two can play at that game.
[IMG]http://puu.sh/ZMcH[/IMG] :smile:
[img]http://puu.sh/ZMf9[/img]
I Bring you PONG in QBasic, Recently I dug out an old laptop of mine - an Elonex LT-320x and decided to have a go, Its my first finished thing in BASIC, took about a day. Next Tetris! [IMG_THUMB]http://a3.sphotos.ak.fbcdn.net/hphotos-ak-ash4/424582_480704728615711_994008417_n.jpg[/IMG_THUMB] SOURCE: [URL]http://pastebin.com/a1wBKB0y[/URL] VIDEO: [video=youtube;4TSF5sIgorA]http://www.youtube.com/watch?v=4TSF5sIgorA&feature=plcp[/video]
[img]http://dl.dropbox.com/u/45554193/images/I%20win%20at%20trosh.png[/img] It's over
[b]Negative[/b] not-a-number? Impressive!
I was mashing my head trying to understand how the shaders work in shadow mapping(ith overbs sample [url]https://github.com/Overv/OOGL/blob/master/samples/ShadowMapping/main.cpp[/url]) and was having no luck... Sudenly tried visualizing it and bamn, I know how it works :D Not a hundred percent how this converts a 3d vector into a 2d point but that can be looked at a nother time [cpp] // Read depth from shadowmap vec4 lightCoord = lightTrans * vec4( Pos, 1.0 ); lightCoord.xyz = lightCoord.xyz / lightCoord.w; lightCoord.x = ( lightCoord.x + 1.0 ) / 2.0; lightCoord.y = ( lightCoord.y + 1.0 ) / 2.0; lightCoord.z = ( lightCoord.z + 1.0 ) / 2.0; float lightDepth = texture( texLight, lightCoord.xy ).z; [/cpp]
[img]http://puu.sh/ZOBF[/img] This was fucking hard The battle sprites were compressed using an obscure algorithm, but I found [url=https://github.com/ubitux/pokanalysis/blob/master/libpokerom/sprites.c]this[/url] C program someone had written from analysing the disassembled algorithm from the original ROMs. I had to port that to CSharp, then get the output in the same format as how I have been reading it from the raw ROM. Next I need to be able to decompress a selected section from the ROM. This is currently decompressing a separated compressed sprite.
I feel like being slightly less lurky, so some rather shitty content. [thumb]https://dl.dropbox.com/u/78160842/content.png[/thumb] Per frame generated incoherent noise! Gotta say, if you watch it, its rather trippy aha.
Having another shot at writing an EDGE Level Editor. Bitches love pixelart. [IMG]https://dl.dropbox.com/u/3770169/screens/2012/08/2012_08_29_02_50_08.png[/IMG]
[QUOTE=ShaunOfTheLive;37447646][b]Negative[/b] not-a-number? Impressive![/QUOTE] A mathemagician never reveals the roots of his equations [editline]28th August 2012[/editline] I added OnClick to Astrostruct entities, I can't do much with pictures but the functionality options are eeeendless [editline]28th August 2012[/editline] I need to remember how to git so I can upload this to my fork and get it meaureged into everything
Is there a good way in OpenGL to draw multiple objects with an arbitrary (unknown at compilation) amount of textures? Preferably without setting a different vbo for every object that uses a different texture or something.
Thought it'd be fun to ray march the distance estimator for the (now) common mandelbulb that surfaced a few years back. [video=youtube;-cljw5n-YQ4]http://www.youtube.com/watch?v=-cljw5n-YQ4[/video] Turns out it was really boring. I had to force myself to finish it just so I didn't have another half-written monstrosity of code sitting in a folder somewhere as usual. Nothing much interesting in the implementation except that I managed to get adaptive resolution working semi-well so you can zoom in as far as you want and see more detail without really reducing framerate much. It'll zoom much farther than I show in the video before floating point errors start to overwhelm it, but I'm always shocked at just how little you can do with a 32-bit float. You exhaust it's potential for things like this extremely quickly. Also excuse the framerate, my laptop is shit for this kind of thing.
Wait... Is that a youtube video of a youtube video of the distance estimater?
[QUOTE=ZenX2;37451043]Wait... Is that a youtube video of a youtube video of the distance estimater?[/QUOTE] Nice catch. Youtube fucked up the first attempt pretty bad and I had to re-record the video at a different resolution so it didn't have horrible artifacts. Also I manually closed CamStudio after I closed the window and I happened to have the page still open behind it.
After i installed XNA, i opened up some old project which happened to be the ASDTD. Did nothing much, edited the bullet system so if you have two towers shooting the same kind of bullet, they both do the same amount of damage. I will soon add waves and more enemies. [editline]asd[/editline] This post sounds like a post on a lame developer blog :v:
I added OnTick to tiles for the sole purpose of PARTY HARD [img]http://dl.dropbox.com/u/45554193/images/PARTY%20HARD.png[/img] It's much cooler when it's being strobarific
[QUOTE=Richy19;37428414]facepunch for android seems to have been released? [url]https://play.google.com/store/apps/details?id=com.russellsoftworks.facepunch&feature=search_result[/url][/QUOTE] i finally put a week aside to release fpmobile beta and apparently overv has completed an app?? idk im happy, overvs app is awesome and you should deffo use it instead of fpmobile ios dudes should still look out because hexxeh has it on cydia or something so we'll probably make a GD thread and just announce it as FP for iOS [editline]29th August 2012[/editline] also waywo related im gonna rewrite a bunch of kopengi in a few months and in the meantime ill probably have more of "mirrors edge 2" (fuck you icemaz) to post!
[QUOTE=qqqqqqqq;37427794]Only if you're doing it wrong. [editline]28th August 2012[/editline] This isn't a very good example and is really just a case of working around horrific design. Your first example involving colour format conversions is much better. [editline]28th August 2012[/editline] Actually here's a better but still simple example. [cpp] static inline vec4 sg_vec4_dot(vec4 lhs, vec4 rhs) { vec4 temp0 = _mm_mul_ps(lhs, rhs); vec4 temp1 = _mm_shuffle_ps(temp0, temp0, _MM_SHUFFLE(1,0,3,2)); vec4 temp2 = _mm_add_ps(temp0, temp1); vec4 temp3 = _mm_shuffle_ps(temp2, temp2, _MM_SHUFFLE(2,3,0,1)); return _mm_add_ps(temp2, temp3); } [/cpp] It'd be much nicer if it could look like [cpp] static inline vec4 sg_vec4_dot(vec4 lhs, vec4 rhs) { vec4 temp0 = _mm_mul_ps(lhs, rhs); vec4 temp1 = temp1.yxwz; vec4 temp2 = _mm_add_ps(temp0, temp1); vec4 temp3 = temp2.zwxy; return _mm_add_ps(temp2, temp3); } [/cpp] And yes I have been too lazy to generate swizzle functions.[/QUOTE] what the fuck... why would you pass an entire class instance AND then do the same with the return value?!? references were added for a reason you dimwit!
[QUOTE=Richy19;37448300]I was mashing my head trying to understand how the shaders work in shadow mapping(ith overbs sample [url]https://github.com/Overv/OOGL/blob/master/samples/ShadowMapping/main.cpp[/url]) and was having no luck... Sudenly tried visualizing it and bamn, I know how it works :D Not a hundred percent how this converts a 3d vector into a 2d point but that can be looked at a nother time [cpp] // Read depth from shadowmap vec4 lightCoord = lightTrans * vec4( Pos, 1.0 ); lightCoord.xyz = lightCoord.xyz / lightCoord.w; lightCoord.x = ( lightCoord.x + 1.0 ) / 2.0; lightCoord.y = ( lightCoord.y + 1.0 ) / 2.0; lightCoord.z = ( lightCoord.z + 1.0 ) / 2.0; float lightDepth = texture( texLight, lightCoord.xy ).z; [/cpp][/QUOTE] That code is mostly equivalent to what gluProject does, which is described [url=http://www.opengl.org/sdk/docs/man/xhtml/gluProject.xml]here[/url] only with the additional perspective division at the beginning. (The math thing only seems to work in Firefox.)
[QUOTE=Hayburner;37451765]what the fuck... why would you pass an entire class instance AND then do the same with the return value?!? references were added for a reason you dimwit![/QUOTE] A vec4 is 16 bytes, aligned, on an x86 or amd64 machine if the code is targetting SSE2 or later (which, due to the use of SSE intrinsics means, it is :v:). Because of the use of SSE intrinsics, this means the data being based via registers is going to go into the SIMD registers, which take 16 bytes of data each. basically, you're adding unnecessary instructions into your code if you pass by reference here (or anywhere where the data is less than 16 bytes). What you need to take into account, is that in his code, vec4 is just a light wrapper around __m128 or the platform's equivalent, which can be viewed as an integral data structure (no different than a float or integer). Passing by reference for a float is overkill, and so would doing the same for an __m128. You can find some reading material on it [url=http://molecularmusings.wordpress.com/2011/10/18/simdifying-multi-platform-math/]here[/url]. You also have to take into account rvalue references. In a block of code like: [cpp] auto x = sg_vec4_dot(some_vec, some_vec); [/cpp] x will have its move operator = equivalent called, because sg_vec4_dot returns an unnamed vec4, which when assigned to x, becomes bound to an lvalue. So a proper compiler wouldn't perform a copy with the return value, and an aggressively optimizing compiler wouldn't actually create anything outside of temp0. And if you say "Well, what if I don't trust the compiler? What if it sneaks into my room at night to hurt me when my back is turned to the door with me facing the wall while I lie in bed?", then you should seek help, because you are giving a compiler human features, and sleeping in your bed the wrong way. (And if the compiler isn't obeying intrinsics or giving expected behavior, then you're boned! wamp wamp :[)
[QUOTE=Chandler;37452248]A vec4 is 16 bytes, aligned, on an x86 or amd64 machine if the code is targetting SSE2 or later (which, due to the use of SSE intrinsics means, it is :v:). Because of the use of SSE intrinsics, this means the data being based via registers is going to go into the SIMD registers, which take 16 bytes of data each. basically, you're adding unnecessary instructions into your code if you pass by reference here (or anywhere where the data is less than 16 bytes). What you need to take into account, is that in his code, vec4 is just a light wrapper around __m128 or the platform's equivalent, which can be viewed as an integral data structure (no different than a float or integer). Passing by reference for a float is overkill, and so would doing the same for an __m128. You can find some reading material on it [url=http://molecularmusings.wordpress.com/2011/10/18/simdifying-multi-platform-math/]here[/url]. You also have to take into account rvalue references. In a block of code like: [cpp] auto x = sg_vec4_dot(some_vec, some_vec); [/cpp] x will have its move operator = equivalent called, because sg_vec4_dot returns an unnamed vec4, which when assigned to x, becomes bound to an lvalue. So a proper compiler wouldn't perform a copy with the return value, and an aggressively optimizing compiler wouldn't actually create anything outside of temp0. And if you say "Well, what if I don't trust the compiler? What if it sneaks into my room at night to hurt me when my back is turned to the door with me facing the wall while I lie in bed?", then you should seek help, because you are giving a compiler human features, and sleeping in your bed the wrong way. (And if the compiler isn't obeying intrinsics or giving expected behavior, then you're boned! wamp wamp :[)[/QUOTE] Sounds like premature optimization.
[QUOTE=Jookia;37452257]Sounds like premature optimization.[/QUOTE] Really? Come on... SSE instructions are usually written for functions that are called many times per second.
[QUOTE=Jookia;37452257]Sounds like premature optimization.[/QUOTE] How is not using references on values that don't need to be references premature optimization?
[IMG]http://img1.uploadscreenshot.com/images/orig/8/24019455763-orig.png[/IMG] Having too much fun with this. Replaced shoulders with facial accessories due to a game mechanic we changed. Also added the "Novice" class equipment for the "good/bad" factions (which are unnamed yet). No more running around naked :v: Also added 20 headgears and 20 new weapons Edit: And can't forget the disappearing head syndrome bug: [IMG]http://img1.uploadscreenshot.com/images/orig/8/24019520926-orig.png[/IMG]
By the way guys, that was all written in C so get out with your dirty classes and references. Otherwise though what Chandler said. Oh and Jookia you might want to read the whole quote from Knuth: [quote] We should forget about small efficiencies, say about 97% of the time: pre-mature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%. A good programmer will not be lulled into complacency by such reasoning, he will be wise to look carefully at the critical code; but only after that code has been identified. [/quote]
[QUOTE=gparent;37452303]Really? Come on... SSE instructions are usually written for functions that are called many times per second.[/QUOTE] [QUOTE=Lexic;37452407]How is not using references on values that don't need to be references premature optimization?[/QUOTE] Woops, I assumed it was a vector class rather than a typedef. My bad. [editline]29th August 2012[/editline] [QUOTE=qqqqqqqq;37452903]Oh and Jookia you might want to read the whole quote from Knuth:[/QUOTE] Couldn't agree more.
[QUOTE=Jookia;37452935]Woops, I assumed it was a vector class rather than a typedef. My bad. [editline]29th August 2012[/editline] Couldn't agree more.[/QUOTE] One should also note that a vector class isn't inherently heavier than a typedef. Above would work the same if it were a struct/class containing the value or just the value itself. Classes don't add any overhead to the structure unless you use virtual methods.
Probably late for vector discussion, but I made a vector class in C++ which allows simple maths and can be used as base for like, a color class. [cpp] class color: public math::vector<4> { public: float& r; float& g; float& b; float& a; color(float r = 1, float g = 1, float b = 1, float a = 1): r(data[0]), g(data[1]), b(data[2]), a(data[3]) { this->r = r; this->g = g; this->b = b; this->a = a; } color(const vector& c): color(c.data[0], c.data[1], c.data[2], c.data[3]) {} color& operator = (const color& c){ r = c.r; g = c.g; b = c.g; a = c.a; return *this; } }; int main(){ color whatever = color(0.1, 0, 1, 0.7); color whatever2 = whatever; color mul = color(1, 1, 1, 0.5); std::cout << mul * whatever2 << std::endl; // I guess we have that too return 0; } [/cpp] Ugly as fuck, but try to tell that the C++ standard consortium. I think I'll switch to D for future projects. [url]http://pastebin.com/xCNXEEjT[/url] Doesn't really depend on anything, but too lazy to fix it up for you. :D
why are all the members references wtf
Sorry, you need to Log In to post a reply to this thread.