I has a mouse look camera that travels in the direction the camera is facing. I also have strafing! I am so happy. I never knew I could. The unit circle is the best thing I've ever learned.
[QUOTE=false prophet;51799017]I has a mouse look camera that travels in the direction the camera is facing. I also have strafing! I am so happy. I never knew I could. The unit circle is the best thing I've ever learned.[/QUOTE]
Heh, I also remember thinking "holy shit, this is finally relevant!". Happened a ton with graphics word though, so expect to keep running into things that you didn't expect to actually use
[IMG]http://i.imgur.com/vBnqJs3.png[/IMG]
IDK WHY IT HAS SHITTY QUALITY AS PIC IT JUST DOES
After about 2 hours of work I finally made it! A voxel engine in C++ / OpenGL!
Currently has:
Water,
Biomes,
Textures,
Mountains,
etc.
Its been great I learnt so much. It currently uses a perlin noise algorithim to generate the world, but I think I might go ahead and use simplex noise due to it being faster. Thoughts on this?
Increasing head size makes my synthesized voice sound fatter and fatter. It's wonderful.
[B]HeadSize = 1[/B]
[vid]https://my.mixtape.moe/uahvbo.wav[/vid]
[B]HeadSize = 2[/B]
[vid]https://my.mixtape.moe/yfzeyf.wav[/vid]
[B]HeadSize = 3[/B]
[vid]https://my.mixtape.moe/mrunft.wav[/vid]
[B]HeadSize = 4[/B]
[vid]https://my.mixtape.moe/etsttq.wav[/vid]
[QUOTE=JWki;51798296]Ehhhhh that's an interesting depth buffer. Are you maybe doing projection weirdly?[/QUOTE]
It could be, it seems to be discarding faces that are close to the camera, and the angle looks very odd. I got everything else working, just the depth buffer seems to be off.
[cpp]
GLfloat near_plane = 1.0f, far_plane = 7.5f;
glm::mat4 lightProjection = glm::ortho(-10.f, 10.f, -10.f, 10.f, near_plane, far_plane),
lightView = glm::lookAt(lightPos, glm::vec3(0.f), glm::vec3(0.f, 1.f, 0.f));
glm::mat4 lightSpaceMatrix = lightProjection * lightView;
[/cpp]
I'll get a video later as moving the camera makes everything more strange. And the shadow looks to be limited by the screen's view which shouldn't be happening.
[QUOTE=Hekefit;51799440]http://i.imgur.com/vBnqJs3.png
IDK WHY IT HAS SHITTY QUALITY AS PIC IT JUST DOES
After about 2 hours of work I finally made it! A voxel engine in C++ / OpenGL!
Currently has:
Water,
Biomes,
Textures,
Mountains,
etc.
Its been great I learnt so much. It currently uses a perlin noise algorithim to generate the world, but I think I might go ahead and use simplex noise due to it being faster. Thoughts on this?[/QUOTE]
Did you take a screenshot from this? [url]https://youtu.be/LhCb0yMNzfc?list=PLMZ_9w2XRxiYzEuz4klbm8ZR7BfjueoN2&t=43[/url]
He also made a tutorial series but the picture looks very similar to the video. Not doubting you but I'm confused as to why your screenshot would have such low quality.
[QUOTE=The Inzuki;51799527]It could be, it seems to be discarding faces that are close to the camera, and the angle looks very odd. I got everything else working, just the depth buffer seems to be off.
[cpp]
GLfloat near_plane = 1.0f, far_plane = 7.5f;
glm::mat4 lightProjection = glm::ortho(-10.f, 10.f, -10.f, 10.f, near_plane, far_plane),
lightView = glm::lookAt(lightPos, glm::vec3(0.f), glm::vec3(0.f, 1.f, 0.f));
glm::mat4 lightSpaceMatrix = lightProjection * lightView;
[/cpp]
I'll get a video later as moving the camera makes everything more strange. And the shadow looks to be limited by the screen's view which shouldn't be happening.
Did you take a screenshot from this? [url]https://youtu.be/LhCb0yMNzfc?list=PLMZ_9w2XRxiYzEuz4klbm8ZR7BfjueoN2&t=43[/url]
He also made a tutorial series but the picture looks very similar to the video. Not doubting you but I'm confused as to why your screenshot would have such low quality.[/QUOTE]
He also made a tutorial series but the picture looks very similar to the video. Not doubting you but I'm confused as to why your screenshot would have such low quality.[/QUOTE]
Nope, I used his textures.
[QUOTE=Hekefit;51799588]Nope, I used his textures.[/QUOTE]
Ah gotcha, thanks for clearing that up :)
[QUOTE=The Inzuki;51799527]It could be, it seems to be discarding faces that are close to the camera, and the angle looks very odd. I got everything else working, just the depth buffer seems to be off.
[cpp]
GLfloat near_plane = 1.0f, far_plane = 7.5f;
glm::mat4 lightProjection = glm::ortho(-10.f, 10.f, -10.f, 10.f, near_plane, far_plane),
lightView = glm::lookAt(lightPos, glm::vec3(0.f), glm::vec3(0.f, 1.f, 0.f));
glm::mat4 lightSpaceMatrix = lightProjection * lightView;
[/cpp]
I'll get a video later as moving the camera makes everything more strange. And the shadow looks to be limited by the screen's view which shouldn't be happening.
Did you take a screenshot from this? [url]https://youtu.be/LhCb0yMNzfc?list=PLMZ_9w2XRxiYzEuz4klbm8ZR7BfjueoN2&t=43[/url]
He also made a tutorial series but the picture looks very similar to the video. Not doubting you but I'm confused as to why your screenshot would have such low quality.[/QUOTE]
Convienent place to link at: I'm trying to decide how to store chunk data and changed block data and a hashmap was my choice as well :D
I found out Boost has a polygon library, and one that supports all of the operations I currently perform through Polyclipper. It also has a couple additional features: slic3r uses it to make a voronoi diagram for motion planning, for one thing, and it also supports features that could solve a lot of problems I have with my polygons now. It would also allow me to replace the really gross framework I outright stole from Cura.
Urge to rewrite core parts of my codebase is high but I'm trying so hard to resist - I've begun writing classes and methods that take care of writing Gcode to files, and motion planning means I'm getting really close to finishing up the backend of this application. A rewrite now would probably not be smart :/
[editline]9th February 2017[/editline]
I can't quite state how badly I want to try this Boost library
[vid]https://zippy.gfycat.com/SoupyAdorableDragon.webm[/vid]
Yeah, something's weird :v: seems to be getting cut off when it gets near the camera. It only applies shadows to the objects shown in the scene, which is odd
[QUOTE=Berkin;51799498]Increasing head size makes my synthesized voice sound fatter and fatter. It's wonderful.
[B]HeadSize = 1[/B]
[vid]https://my.mixtape.moe/uahvbo.wav[/vid][/QUOTE]
[t]http://gunshowcomic.com/comics/20120227-robotthatscreams.png[/t]
[editline]9th February 2017[/editline]
[QUOTE=The Inzuki;51799845]
Yeah, something's weird :v: seems to be getting cut off when it gets near the camera. It only applies shadows to the objects shown in the scene, which is odd[/QUOTE]
Check your shadow camera's projection matrix, ensure it's far plane is far enough away.
[QUOTE=Berkin;51799498]Increasing head size makes my synthesized voice sound fatter and fatter. It's wonderful.
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA[/QUOTE]
Can I have this pls? We have a [URL="http://www.rethinkrobotics.com/baxter/"]Baxter[/URL] at work that is acting funky. We call him "Baxter the Palsy Robot", and now I want to make him emit this sound whenever he gets stuck or isn't strong enough to lift something
idk how I missed this earlier lmao
[QUOTE=paindoc;51800115]Can I have this pls? We have a [URL="http://www.rethinkrobotics.com/baxter/"]Baxter[/URL] at work that is acting funky. We call him "Baxter the Palsy Robot", and now I want to make him emit this sound whenever he gets stuck or isn't strong enough to lift something
idk how I missed this earlier lmao[/QUOTE]
Go for it dude. I could even generate different ones too if you want a different vowel, head size, pitch, etc.
[QUOTE=Berkin;51800149]Go for it dude. I could even generate different ones too if you want a different vowel, head size, pitch, etc.[/QUOTE]
Alas, I was joking, mostly. I don't work with the robot and would probably break him if I tried to add that, as funny as it would be.
On another topic, Voronoi diagrams are pretty neat. Despite my reluctance to refactor working code, nearest-neighbor queries in 2D planes happen a lot in my application and the boost voronoi stuff seems like it would be faster and less prone to error than my current methods.
[QUOTE=Berkin;51799498]Increasing head size makes my synthesized voice sound fatter and fatter. It's wonderful.
[B]HeadSize = 1[/B]
[vid]https://my.mixtape.moe/uahvbo.wav[vid]
[B]HeadSize = 2[/B]
[vid]https://my.mixtape.moe/yfzeyf.wav[vid]
[B]HeadSize = 3[/B]
[vid]https://my.mixtape.moe/mrunft.wav[vid]
[B]HeadSize = 4[/B]
[vid]https://my.mixtape.moe/etsttq.wav[vid][/QUOTE]
number 4 resonates with my soul
[QUOTE=Berkin;51799498]Increasing head size makes my synthesized voice sound fatter and fatter. It's wonderful.[/QUOTE]
play them all at once for maximum enjoyment
[QUOTE=false prophet;51799017]I has a mouse look camera that travels in the direction the camera is facing. I also have strafing! I am so happy. I never knew I could. The unit circle is the best thing I've ever learned.[/QUOTE]
Wait until you upgrade to quaternions.
[QUOTE=Karmah;51799875]Check your shadow camera's projection matrix, ensure it's far plane is far enough away.[/QUOTE]
Getting there!
[vid]https://zippy.gfycat.com/SpicySleepyErne.webm[/vid]
I just want this done so I can get back to finishing the networking portion.
[QUOTE=Radical_ed;51800299]Wait until you upgrade to quaternions.[/QUOTE]
they may be an upgrade, but they are hard as fuck to grasp at first imo. I'm really glad GLM has good support for them, they're pretty much required for making a decent arcball camera.
I decided that I wanted a dither shader so I made one in a day
I think it looks pretty good
[IMG]http://i.imgur.com/PW6NLC9.png[/IMG]
[QUOTE=Hekefit;51799440][IMG]After about 2 hours of work I finally made it! A voxel engine in C++ / OpenGL!
Currently has:
Water,
Biomes,
Textures,
Mountains,
etc.
Its been great I learnt so much. It currently uses a perlin noise algorithim to generate the world, but I think I might go ahead and use simplex noise due to it being faster. Thoughts on this?[/QUOTE]
spotted the Verideth
[QUOTE=zerf;51801269]spotted the Verideth[/QUOTE]
huh? sorry I Dont understand.
[QUOTE=zerf;51801269]spotted the Verideth[/QUOTE]
[URL="https://facepunch.com/showthread.php?t=1550856&p=51790294&viewfull=1#post51790294"]I can't believe none of you noticed this.[/URL]
Recently I found out about a possibly major source of unoptimization in my engine
Turns out binding textures is really costly, and for every model I need to render they use 5 textures (Diffuse, normal, specular, roughness, and emissive). Apparently I can congregate them into a single texture array per model, dropping the amount of texture binds per model from 5 to 1.
Further, I also learned that bindless textures are a thing so I can probably squeeze even more perf by using them instead
Since I never thought texture binding would be a huge problem, I never organized my model rendering loop to only bind common materials only once, ie:
[code]
for each render target {
for each material {
bind_texture;
for each model {
bind_model;
draw();
}
}
}
[/code]
However if I use bindless textures I shouldn't even need to organize my data like that anyways.
As it is I've managed to improve frame time by multithreading my visibility checks at the cost of more variance in frame times due to the visibility list synchronization points and other lock guards.
[QUOTE=Hekefit;51799440][IMG]http://i.imgur.com/vBnqJs3.png[/IMG]
IDK WHY IT HAS SHITTY QUALITY AS PIC IT JUST DOES
After about 2 hours of work I finally made it! A voxel engine in C++ / OpenGL!
Currently has:
Water,
Biomes,
Textures,
Mountains,
etc.
Its been great I learnt so much. It currently uses a perlin noise algorithim to generate the world, but I think I might go ahead and use simplex noise due to it being faster. Thoughts on this?[/QUOTE]
If you could make your game look like that, you'd have a rad vaporwave aesthetic.
Back to the C++ topic a couple of pages ago,
Does anyone have any strong opinions on the idea of there being "modern C++", and C++03 and prior? [URL="https://twitter.com/jonathan_blow/status/725722940185022464"]Jonathan Blow[/URL] clearly doesn't like the phrase.
Today I wrote a small program for Cooler Master Mechanical LED Keyboard's. It lights up regions of the keyboard to give an indication of the current weather, getting its info from bom.gov.au (Australia). The color of the keyboard in general represents max temperature, the number row the percentage of rainfall in increments of 10%, and the Home/End/Del etc. grouping cloud coverage. City and State specifiable in options XML doc.
[IMG]http://i.imgur.com/sWJCyO2.png[/IMG]
So for today there's a 10% chance of rain, it's fucking hot, but it's slightly cloudy (it's a light grey on the far right, bit hard to tell from the picture).
Uses my XML parser for the HTML docs, good to get some more use out of it. I know there's probably a better way of finding the relevant portion of the HTML doc, but this will do for now.
[code]
struct Forecast { int maxTemp; int rainChance; bool cloud; };
Forecast getForecast()
{
URLDownloadToFile(NULL, TEXT(optionDoc.getRoot().getChildDelim("local/url").getDataString().c_str()), TEXT("get.shtml"), 0, NULL); //download page
XMLDoc htmlDoc("get.shtml"); //parse XML
//get appropriate forecast div from HTML document
Forecast readForecast;
auto &forecast = htmlDoc.getRoot().getChild("body").
getChild("div", "id", "pageheight").
getChild("div", "id", "pagewrap").
getChild("div", "id", "columns").
getChild("div", "id", "container").
getChild("div", "id", "content").
getChild("div", "class", "day main").getChild("div", "class", "forecast"); //TOFIX: varies depending on time of day
for (auto info : forecast.getChild("dl").getChildren("dd"))
{
string attribClass = info->attribute("class");
if (info->getDataString() == "Chance of any rain: ")
{
string strChance = info->getChild("em").getDataString();
readForecast.rainChance = ceil(std::stoi(string(&strChance[0], strChance.find('%'))) / 10.0);
}
else if (info->getDataString() == "Max ")
readForecast.maxTemp = info->getChild("em").getDataInt();
else if (attribClass == "image")
readForecast.cloud = (info->getChild("img").attribute("src") == "/images/symbols/large/partly-cloudy.png");
}
return readForecast;
}
[/code]
Does anyone know of any generic library that acts as an interface to the various LED keyboards out there on the market? It'd be nice if once I've worked on it a bit more it was usable for people who don't have a very specific keyboard model.
I decided these days that I would have some fun with OpenGL ES "optimizations". I hacked quickly an algorithm to subdivide a big texture in chunks and use that as an atlas, then added a quick'n'dirty draw call batcher.
[url]https://github.com/JohnnyonFlame/f2bgles/commits/master[/url]
I gotta measure the performance improvements properly, but the difference is so big that it went from totally unplayable to okay.
There is a lot that can be done to make this code properly performant, but it's sorta out of the scope of my experiments really.
[editline]10th February 2017[/editline]
Remember kids, draw calls are costly bitches and should be lowered as much as you can.
[QUOTE=gayNightOwl;51802954]Back to the C++ topic a couple of pages ago,
Does anyone have any strong opinions on the idea of there being "modern C++", and C++03 and prior? [URL="https://twitter.com/jonathan_blow/status/725722940185022464"]Jonathan Blow[/URL] clearly doesn't like the phrase. [/QUOTE]
He says "Yeah but "modern C++" specifically means "don't use bare pointers, use RAII everywhere, shitloads of templates, etc"." which is not at all what modern C++ means to most people. RAII everywhere is [B]the[/B] mantra of C++, modern and otherwise. Bare pointers are not frowned upon in modern C++, just owning bare pointers (for which smart pointers are preferred). I really don't see why anyone would be against smart pointers and ownership semantics. And modern C++ as most people know it (lambdas, smart pointers, move semantics, auto, constexpr) has almost no reliance on templates, or rather has no more reliance than C++03 and below. The standard library is chock full of templates and if people don't like templates they really aren't using C++ to the fullest, regardless of how modern it is. All in all this just seems a bit like the ramblings of a guy who uses C++ as C with classes, I mean really what are you being indoctrinated into? Making the compiler do more work for you?
[QUOTE=WTF Nuke;51803138]He says "Yeah but "modern C++" specifically means "don't use bare pointers, use RAII everywhere, shitloads of templates, etc"." which is not at all what modern C++ means to most people. RAII everywhere is [B]the[/B] mantra of C++, modern and otherwise. Bare pointers are not frowned upon in modern C++, just owning bare pointers (for which smart pointers are preferred). I really don't see why anyone would be against smart pointers and ownership semantics. And modern C++ as most people know it (lambdas, smart pointers, move semantics, auto, constexpr) has almost no reliance on templates, or rather has no more reliance than C++03 and below. The standard library is chock full of templates and if people don't like templates they really aren't using C++ to the fullest, regardless of how modern it is. All in all this just seems a bit like the ramblings of a guy who uses C++ as C with classes, I mean really what are you being indoctrinated into? Making the compiler do more work for you?[/QUOTE]
Having a mantra in general is a bit smelly isn't it. As mentioned in the twitter thread, relying on anything specific too much should be avoided, and RAII isn't a good tool in every situation. Being able to have automatic cleanup at scope exit is nice for some things and using RAII is the C++ way of doing it, but having everything being wrapped into RAII doesn't make a lot of sense to me either. I think there's definitely situations where you want explicit cleanup for things. Plus, there's situations where you don't necessarily want cleanup at all - at program exit for example. It may sound hilarious but there's software out there that has a delay when closing it because it has to work through two thousand destructor calls that do nothing but cleaning up resources that the OS will wipe anyways when the program quits. So that's one of the points against RAII everywhere.
Ownership semantics are nothing that anyone has anything against I think, rather how they are implemented in the STL. There's ways to hierarchically structure your code in a way that ownership is clearly handled on a larger scale then per-object or per-pointer so no pointer will be "owning" anything at all. This makes much more sense to me than smart pointers, and I do have experiences to back that viewpoint up - I used smart pointers extensively in a bigger project, both the STL variants as well as some custom ones, and it was not very pleasant. After refactoring everything to use raw pointers ("non-owning" ones I guess) and managing object lifetimes in an explicit, hierarchical way, the code was much nicer and a lot of edge cases were gone. You could argue I misused them maybe, and I will admit that there is problems where I'd say they are a fitting solution BUT for each of these problems I can think of a solution that I personally find better suited.
Now this is all very subjective but I guess it comes from a similar place as Jon Blow's opinions. And he is a moderate specimen I can tell you that. If you look at what Casey Muratori or Sean Barret have to say about C++ in general, they have MUCH stronger opinions - but they do make some good points as well, and they are involved in the development of game development tools that are widely used in the industry and known to be excellent in terms of usability of performance, so they do know a thing or two about how to write good code and good APIs.
Personally I like a lot of the modern language features that C++ has - I like auto way too much, I like constexpr, I love lambdas even though I limit my usage to non-capturing lambdas in my own code because I don't like dynamic allocations to happen behind my back, move semantics are a good thing, especially when you HAVE To use the STL, and I'm exploiting them heavily for my thesis project - I rely a lot on std::vector and std::string instances being moved instead of copied.
But in personal projects I do avoid using STL containers and I'm done with my template metaprogramming magic phase as well - templates are nice for generic containers, but they're not the optimal tool for metaprogramming which makes sense because they just weren't designed for that use originally.
I'd recommend taking a look at Jon Blow's streams, especially his original language design talks from like 2 or 3 years ago. He gives a much more differentiated outline of his opinions there, so if you're really curious on where that's coming from check it out. It's certainly a good watch in any case.
But I don't see how this has to do with modern C++ as opposed to C++ in general. RAII isn't new by any stretch of the imagination. Smart pointers are ways to model already existing ownership relationships, they certainly aren't the only way. They just make what people did do and continue to do pre C++11 easier. Templates haven't changed much, they just got more powerful. People could already model variadic templates in C++03, it was just a lot slower and uglier. I don't really see how modern C++ changed the things you and him are against.
[QUOTE=WTF Nuke;51803211]But I don't see how this has to do with modern C++ as opposed to C++ in general. RAII isn't new by any stretch of the imagination. Smart pointers are ways to model already existing ownership relationships, they certainly aren't the only way. They just make what people did do and continue to do pre C++11 easier. Templates haven't changed much, they just got more powerful. People could already model variadic templates in C++03, it was just a lot slower and uglier. I don't really see how modern C++ changed the things you and him are against.[/QUOTE]
Yeah I see your point there and I don't actually think what Blow said in the twitter statement was meant to draw a line between pre-11 C++ and "modern" C++ necessarily - what he was expressing I think was his view on the C++ ecosystem in general. Like, someone coming at you telling you what you'd do in "modern" C++ clearly is aligned with that ecosystem and that's fair enough but when you're really at a point where you just despise that ecosystem and want to get away from it - and I assume taking on the task of designing and implementing a new production grade programming language is a clear enough symptom of that - taking that as a sign not to engage in discussion with such a someone is only healthy I guess.
One reason why most people that aren't really that convinced of C++ as a good language in general tend to avoid the modern flavour might be that a LOT of the new language features and STL elements are either a) a clear attempt to fix obvious design flaws that happened earlier in the development of the language or b) embracing the things people tend to not like about C++.
While a) is just a symptom that C++ has some issues in it's basic design, b) is what might be offputting about recent language developments to people like Jon Blow.
Sorry, you need to Log In to post a reply to this thread.