• What are you working on? v19
    6,590 replies, posted
I decided to write a simple raytracer today, simply because I've never done one before. [img]http://i.imgur.com/OG8RA.gif[/img] Code to create the scene: [cpp]scene::camera cam = scene::camera( math::vec3( 3, 3, 3 ), math::vec3( -3, -3, -4 ), math::vec3( -0.7, -0.7, 1 ), 1, 1, 90 ); scene::world world = scene::world(); world.addPrimitive( new scene::box( math::vec3( -3, -3, -0.1f ), math::vec3( 3, 3, 0 ) ) ); world.addPrimitive( new scene::sphere( math::vec3( -1, 0, 0.5f ), 0.5f ) ); world.addPrimitive( new scene::sphere( math::vec3( cos(time)*1.0f+1, sin(time)*1.0f, 0.5f ), 0.5f ) ); world.addPrimitive( new scene::sphere( math::vec3( 1, 0, 0.5f ), 0.5f ) ); world.addLight( scene::light( math::vec3( cos(time)*3.0f, sin(time)*3.0f, 2 ), 1, 1, 1 ) );[/cpp] [url=http://hosting.overvprojects.nl/raytracer.zip]Could you guys check what kind of performance you get with it?[/url]
[QUOTE=Overv;31536195]I decided to write a simple raytracer today, simply because I've never done one before. [img]http://i.imgur.com/OG8RA.gif[/img] Code to create the scene: [cpp]scene::camera cam = scene::camera( math::vec3( 3, 3, 3 ), math::vec3( -3, -3, -4 ), math::vec3( -0.7, -0.7, 1 ), 1, 1, 90 ); scene::world world = scene::world(); world.addPrimitive( new scene::box( math::vec3( -3, -3, -0.1f ), math::vec3( 3, 3, 0 ) ) ); world.addPrimitive( new scene::sphere( math::vec3( -1, 0, 0.5f ), 0.5f ) ); world.addPrimitive( new scene::sphere( math::vec3( cos(time)*1.0f+1, sin(time)*1.0f, 0.5f ), 0.5f ) ); world.addPrimitive( new scene::sphere( math::vec3( 1, 0, 0.5f ), 0.5f ) ); world.addLight( scene::light( math::vec3( cos(time)*3.0f, sin(time)*3.0f, 2 ), 1, 1, 1 ) );[/cpp] [url=http://hosting.overvprojects.nl/raytracer.zip]Could you guys check what kind of performance you get with it?[/url][/QUOTE] about 20-25 fps. Console give me a 0
[QUOTE=Overv;31536195]I decided to write a simple raytracer today, simply because I've never done one before. [img]http://i.imgur.com/OG8RA.gif[/img] Code to create the scene: [cpp]scene::camera cam = scene::camera( math::vec3( 3, 3, 3 ), math::vec3( -3, -3, -4 ), math::vec3( -0.7, -0.7, 1 ), 1, 1, 90 ); scene::world world = scene::world(); world.addPrimitive( new scene::box( math::vec3( -3, -3, -0.1f ), math::vec3( 3, 3, 0 ) ) ); world.addPrimitive( new scene::sphere( math::vec3( -1, 0, 0.5f ), 0.5f ) ); world.addPrimitive( new scene::sphere( math::vec3( cos(time)*1.0f+1, sin(time)*1.0f, 0.5f ), 0.5f ) ); world.addPrimitive( new scene::sphere( math::vec3( 1, 0, 0.5f ), 0.5f ) ); world.addLight( scene::light( math::vec3( cos(time)*3.0f, sin(time)*3.0f, 2 ), 1, 1, 1 ) );[/cpp] [url=http://hosting.overvprojects.nl/raytracer.zip]Could you guys check what kind of performance you get with it?[/url][/QUOTE] I got 20 to 25 fps. Console outputted 0
[QUOTE=icantread49;31536101]i just wanna say, after working in the beautiful land of C# for so long, even with several years of experience C++ looks like a horrible disgusting pile of shit[/QUOTE] What horrid code are you writing? Mine looks clean and easily readable.
HUD :D [img]http://i3software.org/s/SS-2011-08-04_16.56.57.png[/img] A HUD Component acts as two separate layers: Background and Overlay. Background is used for the background of the HUD. (Duh) Overlay is used for adding objects over the background. (Again, Duh) Since the HUD of my game consists of meters, I decided to use a block based approach again. [code] enum HUDColor { Blank, Border, Background, Brown, Red } class HUDItem { protected HUDColor[][] Background; protected HUDColor[][] Overlay; } [/code] [editline]n[/editline] [img]http://i3software.org/s/SS-2011-08-04_17.23.49.png[/img] It fills up too! I'm getting a lot of work done today.
[QUOTE=Xerios3;31532136]now MAKE A LEVEL OF WHAT HE JUST SAID Actually I just realized that you're whole game is about that, sperm flying into eggs...[/QUOTE] Hey, maybe that's why Steam rejected it. They thought it was some kind of sexual innuendo.
[QUOTE=Ortzinator;31537454]Hey, maybe that's why Steam rejected it. They thought it was some kind of sexual innuendo.[/QUOTE] Rated M for Sexual Innuendo
[QUOTE=Jookia;31536897]What horrid code are you writing? Mine looks clean and easily readable.[/QUOTE] ever worked with C# in a remotely large project?
[QUOTE=icantread49;31537903]ever worked with C# in a remotely large project?[/QUOTE] Dodging questions, awesome. Just for fun, nope. Have you ever worked with C++ in a remotely large project?
[QUOTE=Jookia;31538014]Dodging questions, awesome. Just for fun, nope. Have you ever worked with C++ in a remotely large project?[/QUOTE] Yes and it usually looks like someone threw up on the screen.
Then stop writing messy code. Simple. It's not a language barrier, it's that people suck at writing clean code.
Holy fuck. I don't know if I'm doing things I shouldn't be, but C++0x kicks ass. Initializer lists for the standard STL containers was probably the greatest idea ever. [cpp]#include <iostream> #include <vector> using namespace std; int main() { vector<vector<int>> vec = {{1,2,3,4,5}, //PURE {1,2,3,4,5}}; //SEX for (vector<vector<int>>::iterator i = vec.begin(); i < vec.end(); ++i) { for (vector<int>::iterator j = i->begin(); j < i->end(); ++j) { cout << *j; } cout << endl; } return 0; }[/cpp] I got inspired by everyone making roguelike dungeon generators, so I wanted to start work on one.
Well, there goes my premise.
[QUOTE=Jookia;31538014]Dodging questions, awesome. Just for fun, nope. Have you ever worked with C++ in a remotely large project?[/QUOTE] yes, multiple in fact (both my own and foreign code bases) the irony is that i used to feel the same way as you before i really started using C# for large projects you can't judge something without giving it a really good effort
[QUOTE=Jookia;31538259]Well, there goes my premise.[/QUOTE] I tried to make it look as nice as possible. :v: What would look better?
[QUOTE=Overv;31536195]I decided to write a simple raytracer today, simply because I've never done one before. [img]http://i.imgur.com/OG8RA.gif[/img] Code to create the scene: [cpp]scene::camera cam = scene::camera( math::vec3( 3, 3, 3 ), math::vec3( -3, -3, -4 ), math::vec3( -0.7, -0.7, 1 ), 1, 1, 90 ); scene::world world = scene::world(); world.addPrimitive( new scene::box( math::vec3( -3, -3, -0.1f ), math::vec3( 3, 3, 0 ) ) ); world.addPrimitive( new scene::sphere( math::vec3( -1, 0, 0.5f ), 0.5f ) ); world.addPrimitive( new scene::sphere( math::vec3( cos(time)*1.0f+1, sin(time)*1.0f, 0.5f ), 0.5f ) ); world.addPrimitive( new scene::sphere( math::vec3( 1, 0, 0.5f ), 0.5f ) ); world.addLight( scene::light( math::vec3( cos(time)*3.0f, sin(time)*3.0f, 2 ), 1, 1, 1 ) );[/cpp] [url=http://hosting.overvprojects.nl/raytracer.zip]Could you guys check what kind of performance you get with it?[/url][/QUOTE] 15fps - i7 2600k / GTX570 [editline]4th August 2011[/editline] according to fraps anyways, the console says 0...
[QUOTE=Ltp0wer;31538426]I tried to make it look as nice as possible. :v: What would look better?[/QUOTE] Use C++0x's ranged-based for loops. [editline]5th August 2011[/editline] [QUOTE=icantread49;31538377]the irony is that i used to feel the same way as you before i really started using C# for large projects you can't judge something without giving it a really good effort[/QUOTE] Well thinks to various concerns I have about C# and .NET on Linux, I'm not really going to give it an effort.
[QUOTE=robmaister12;31538538]15fps - i7 2600k / GTX570 [editline]4th August 2011[/editline] according to fraps anyways, the console says 0...[/QUOTE] That's weird, Fraps said 20 to 25 FPS for me. Same exact specs.
I tried feeding the Batman Equation and it was too big for Wolfram Alpha. So about that nullular grapher?
[QUOTE=Jookia;31538605]Use C++0x's ranged-based for loops.[/QUOTE] I would love to, but the latest MinGW only has GCC 4.4, and I need GCC 4.6 for range-based for loops. I'm open to compiler suggestions though.
[QUOTE=Ltp0wer;31538793]I would love to, but the latest MinGW only has GCC 4.4, and I need GCC 4.6 for range-based for loops. I'm open to compiler suggestions though.[/QUOTE] Ah, a Windows user? Download [url=http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/4.6.2-1/i686-w64-mingw32-gcc-4.6.2-1_rubenvb.7z/download]this[/url] if you're on 32bit Windows, or [url=http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/rubenvb/4.6.2-1/x86_64-w64-mingw32-gcc-4.6.2-1_rubenvb.7z/download]this[/url] if you're on 64bit Windows, then add it as a new compiler in CodeBlocks.
[IMG]http://dl.dropbox.com/u/9317774/Blue%20shift.png[/IMG] Blue shifting here takes into account the speeds of the viewer and the moving object. This is a picture of the planet when the viewer is moving towards the object at the speed of light Edit: The shadows that ill definitely need to fix make this an alright looking oceanic planet when the observer and object are moving towards each other at the speed of light [IMG]http://dl.dropbox.com/u/9317774/Maximum%20blue%20shift.png[/IMG] Surprisingly enough, the whole doppler effect only adds 0.0015ish seconds to the frametime (currently ~0.058), which is quite fast
[QUOTE=Hypershadsy;31538768]I tried feeding the Batman Equation and it was too big for Wolfram Alpha. So about that nullular grapher?[/QUOTE] here: [url]http://filesmelt.com/dl/NullularGrapher.zip[/url] just type in the equation and have fun, be sure to post a pic for us :D might have to raise the 2D resolution a bit in the options panel [editline]5th August 2011[/editline] [QUOTE=Jookia;31538605] Well thinks to various concerns I have about C# and .NET on Linux, I'm not really going to give it an effort.[/QUOTE] what concerns? i ported a large code base of mine containing an editor using winforms and a game using opentk (and even a native c library) and it works great
[QUOTE=icantread49;31539085]what concerns? i ported a large code base of mine containing an editor using winforms and a game using opentk (and even a native c library) and it works great[/QUOTE] Just concerns.
i tried typing in the batman equation but i only got to the second parenthesis before giving up :v: someone else do it
[QUOTE=icantread49;31539304]i tried typing in the batman equation but i only got to the second parenthesis before giving up :v: someone else do it[/QUOTE] Somebody posted the full equation on the reddit thread about it. [editline]4th August 2011[/editline] [code]((x/7)2 Sqrt[Abs[Abs[x] - 3]/(Abs[x] - 3)] + (y/3)2 Sqrt[Abs[y + (3 Sqrt[33])/7]/(y + (3 Sqrt[33])/7)] - 1) (Abs[x/2] - ((3 Sqrt[33] - 7)/112) x2 - 3 + Sqrt[1 - (Abs[Abs[x] - 2] - 1)2 ] - y) (9 Sqrt[Abs[(Abs[x] - 1) (Abs[x] - 3/4)]/((1 - Abs[x]) (Abs[x] - 3/4))] - 8 Abs[x] - y) (3 Abs[x] + .75 Sqrt[Abs[(Abs[x] - 3/4) (Abs[x] - 1/2)]/((3/4 - Abs[x]) (Abs[x] - 1/2))] - y) (9/4 Sqrt[Abs[(x - 1/2) (x + 1/2)]/((1/2 - x) (1/2 + x))] - y) ((6 Sqrt[10])/7 + (3/2 - Abs[x]/2) Sqrt[Abs[Abs[x] - 1]/(Abs[x] - 1)] - (6 Sqrt[10])/14 Sqrt[4 - (Abs[x] - 1)2 ] - y) == 0[/code]
[QUOTE=Jookia;31538832]Ah, a Windows user? Download [url=http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/4.6.2-1/i686-w64-mingw32-gcc-4.6.2-1_rubenvb.7z/download]this[/url] if you're on 32bit Windows, or [url=http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/rubenvb/4.6.2-1/x86_64-w64-mingw32-gcc-4.6.2-1_rubenvb.7z/download]this[/url] if you're on 64bit Windows, then add it as a new compiler in CodeBlocks.[/QUOTE] I love you. :dance: [cpp]#include <iostream> #include <vector> using namespace std; int main() { vector<vector<int>> vec = {{1,2,3,4,5}, //EVEN MORE {1,2,3,4,5}}; //PURE SEX for (auto i : vec) { for (auto j : i) { cout << j; } cout << endl; } return 0; }[/cpp]
[img]http://filesmelt.com/dl/batman2.png[/img] not perfect but oh well :v:
[QUOTE=Ltp0wer;31539472]I love you. :dance: [cpp]#include <iostream> #include <vector> using namespace std; int main() { vector<vector<int>> vec = {{1,2,3,4,5}, //EVEN MORE {1,2,3,4,5}}; //PURE SEX for (auto i : vec) { for (auto j : i) { cout << j; } cout << endl; } return 0; }[/cpp][/QUOTE] heck, is that for real?
[QUOTE=icantread49;31538377]yes, multiple in fact (both my own and foreign code bases) the irony is that i used to feel the same way as you before i really started using C# for large projects you can't judge something without giving it a really good effort[/QUOTE] Aaaand he's back. Note the large projects he's talking about are just a couple of his own projects, basically a grapher and probably whatever that simple cartoony game was we saw earlier. Please leave acting like you're some pro with industry experience to real pros with industry experience. [editline]4th August 2011[/editline] [QUOTE=icantread49;31539085] what concerns? i ported a large code base of mine containing an editor using winforms and a game using opentk (and even a native c library) and it works great[/QUOTE] As a Linux user I don't have a problem with Mono's implementation, it runs fine. I do not like the insane amount of software patents around C# or Mono. A nice article by the FSF: [url]http://www.fsf.org/news/2009-07-mscp-mono[/url] Some of their wording is extreme, but nothing they say is untrue.
Sorry, you need to Log In to post a reply to this thread.