Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

9833 Excellent

About samoth

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. They're different from the ones that the WayBackMachine shows for December 17, 2016 (and certainly different from the ones I agreed to in 2008 or so). Be that as it may, little does it matter. I bid you farewell.
  2. The technical issues of which there are many, the inability to use the site at all without javascript and the immense reduction of the signal/noise ratio that came with this update are not the dominating problems which makes me consider leaving the community in all seriousness. The main issue with the site upgrade are the modified terms and conditions that you piggy-backed onto the update. Among these are several terms and conditions which, frankly, are barely acceptable if at all. In particular, I find paragraph 3, paragraph 5.1, and the last sentence of 11.1 objectionable.
  3. samoth


    They're an attempt to keep activity up. An ill-advised attempt, in my opinon. You no longer get reputation for activity, only for upvotes. But you get "pixels" for activity. And, to "encourage" you, you're losing pixels for inactivity.
  4. samoth

    Oh the union woes

    That must be the funniest ever error message I've seen in my life. And maybe the longest (standard library template errors with 5,000 lines of "instantiated from", doesn't really count). But you can't say it doesn't tell you exactly what's wrong in the compiler's opinion or what you have to do. The compiler I used to get the above was GCC 7.1, I didn't bother trying clang... was too frustrating with a single compiler already.
  5. samoth

    Shoreline waves?

    You have foam where waves are breaking, so that is what you want to simulate. There exist other papers about this up to 10-15 years old, but I can't find the particular one that I have in mind (which was very good) right now... This one however seems to describe the principle, too: http://matthias-mueller-fischer.ch/publications/breakingWaves.pdf The images in the paper are a bit coarse, you'd probably need 5-10 times as many particles, and have them textured in a way so there's a bit of a smooth falloff to make them look less artificial and to "multiply" them. Plus, texture the breaking wave body with a "foamy" texture on top. But in principle, that's it.
  6. samoth

    Where is this Hot Teacher Trend coming from?

    The only problem I see is that she had sex with people who are in a state of dependence with herself (being their teacher, giving them grades and such). Which is unethical, and at least here it is also against the law. Calling someone who has sex with 17 year olds "pedophile" is a typical US joke (even more so if the "pedophile" is only 25). I mean, get real, it's not like the boys were 10 or 11 years old, and the teacher was 47. The boys are old enough to drive a car, and almost old enough to buy a gun. Also, you can bet they had sex before, too. Having been to NC once (in a city 3x the size compared to Rocky Mount) I'm not surprised anyway. What, apart from drinking booze and having sex, can you do in the evening? And booze is more rigidly limited than guns in NC... for 17 year olds it's definitively illegal, no matter how you look at it.
  7. samoth

    Oh the union woes

    Yes, obviously... except, no. :) Trying struct alignas(8) foo {...} which should align the struct compatibly to CMPXCHG8B has exactly the same effect. In a union, it works (well it works either way...) but as a sole struct, it calls into library functions.
  8. samoth

    Oh the union woes

    What is the difference between...?       struct foo     {             uint16_t a;             uint16_t b;             uint16_t c;             uint16_t not_used;     }; and     union foo     {         uint64_t dont_care;         struct         {                 uint16_t a;                 uint16_t b;                 uint16_t c;                 uint16_t not_used;         };     };     Well yes, 47 characters. But apart from that, what if you e.g. make a std::atomic<foo>? For a compare-exchange, the difference is around 200 instructions! And no, the union is not the one with more instructions. :) It is of course well-known that std::atomic doesn't guarantee that just about everything be atomic, in particular it gives no guarantees whatsoever except on atomic_flag. How could one guarantee every possible thing being atomic, anyway -- the hardware doesn't necessarily even support that. OK. Accepted. But you can somewhat expect that something that easily fits within the instruction set's capabilities (an integer, a struct of two integers, four smaller integers) is "just atomic" anyway. Well, that's not the case. But what's really stunning is not so much that the compiler fails to emit e.g. a single CMPXCHG8B when it could just do that in the first case. What truly does me is that if you give the compiler a "hint" by aliasing with an uint64_t as in the second case, then all of a sudden, as if by magic, it works... How did I find out? You don't want to know. :lol:
  9. Yep, that exactly. Manual fetch is practically none different in performance nowadays from fixed-function (hardly measurable). which is very nice. So "all meshes must be the same" is no longer really true for instancing. Or rather, it is true insofar as all meshes are the same, having no vertex data at all. You pull what you need from a buffer, using the vertex id and the instance id. You still need the same number of vertices since that is the way instancing works. However... ...there's primitive restart, and there's points at infinity (or, you could just manually cull vertices above some threshold). So, the requirement is really only "approximately the same count", you just leave the last bunch of vertices go waste. In principle, you could even combine any number, only just that might be wasteful. Imagine instancing objects with 50 and with 5,000 vertices together. The 50-vert instances will burn 4950 vertices to no effect. But if you have, say, 4,875 and 5,000 vertices (and completely different vertex positions, of course) then... who cares. Burning a couple of vertices will be way faster than drawing the meshes in separate batches.
  10. *cough* https://raw.githubusercontent.com/KhronosGroup/Vulkan-Hpp/master/vulkan/vulkan.hpp Sorry, I couldn't resist :)   But on a more serious note, to the OP: exception handling is not inherently bad, or slow. Exceptions on consoles suck because they use shitty 10-12 year old compilers. Exceptions under Win32 are slow if you don't use the Microsoft compiler because SEH Exceptions for 32-bit Windows are patented (so the other compilers default to using setjump/longjump which is insane). Exception handling under Win64 is (almost) zero overhead execution-time wise (not binary size wise, unluckily) unless you actually throw. Go ahead and time it, if calling a non-optimized-out small function some million times takes, say, 4.53 +/- 0.01 seconds, then calling the same function with exception handling will take 4.53+/- 0.01 seconds. Only if you actually throw, things look different. But throwing is an exceptional thing, so that is alright.   More important than the fact that exceptions are slow (they are not) is the fact that it is impossible to predict how long the handling will take. It can be anywhere from a dozen cycles to milliseconds (if, for example, a destructor flushes and closes files). Depending on the situation, and in particular depending on your realtime-requirements, this uncertainity may be the one thing that makes them forbidding.
  11. samoth

    Using Exceptions

    I'd strongly suggest stepping away from "ellipsis catch". This is bad, so bad I can't understand why it was even included in the language. As Alberth pointed out already, exceptions can be a tough thing to handle. Now imagine how hard it is to handle exceptions if you don't know. You don't know what failed, or in the most commonly usedantipattern, you don't know if, Errors that probably should be reported are silenced so you never see them. Again, I can't understand why this was ever included in the standard. Alas, the best thing is to stay far away from that. On the other hand, there's nothing wrong with catching a known type if you have a hope of being able to do something meaningful. And, of course, there's nothing wrong with using exceptions in the first place. If, however, puts("Error"); exit(); is all you basically do in a handler, then better just let the program terminate with an uncaught exception! Same effect, less work, less opportunity of doing something wrong, and you don't throw away the stack info. Ignoring exceptions altogether is nowadays an almost viable option (since in practice, you almost never see exceptions any more, used to be you'd occasionally get bad_alloc, but on multi-gigabyte 64-bit systems, that's almost only theoretical any more. Well, almost...). Ironically, there's an explicit mechanism to handle allocation failure when it occurs before it occurs. Of which I'm not sure whether to say "facepalm" or "woah, fucking cool". Maybe a bit of both. Still, I am personally not in favour of ignoring the matter altogether from the beginning, or even disabling exceptions as a lot of people do because exceptions are part of the language (so you could as well use a different language!) and because there exist non-fatal cases where you get exceptions, and well-written code can indeed do something meaningful with it. But your code must be prepared not to break when an exception occurs (read up on "exception guarantees", you do not need all guarantees at all times (which is excruciatingly hard), but if you can guarantee at least that your program is still in a sane state at all times, exception or not, that's definitively a desirable thing). There are idioms that you just learn to use as if they are the most natural thing when keeping in mind that exceptions exist and may occur. (such as for example copy-swap). Even when not doing everything 100% perfectly from the beginning, having the possibility of exceptions in mind finally makes your code quality better. If nothing else, you will get a better understanding of why some parts of the standard library are the way they are (for example why vector's pop_back() doesn't return the popped element -- be honest, you thought it would, didn't you!).
  12. samoth

    Thoughts on the new XBOX One X?

    They should fire the guy who comes up with these shitty names. XBox is followed by XBox 360... OK, well. turning around 360 degrees leaves you where you started from. The next thing after that was not XBox 480 or XBox 720, no... it was XBox One. How come 1 follows after 360? And now it's One X... seriously... fire the guy who comes up with that crap :lol: What's next, XBox Triple X? Oh wait, that's already taken... Reminds me of the guy at Mistubishi who came up with the name Pajero.
  13. samoth

    silly question about vertex coords

    The original question (although I believe without intent) is already a trick question in the OpenGL/Vulkan forum, without mentioning which of the two it refers to. :lol: Why? Because while both place the origin in the middle of the screen, in OpenGL the Y axis per definition points up (see missionctrl's answer) whereas in Vulkan, it points down.
  14. There are at least two possible reasons why you might not want to do it on all skinned meshes: You do not have hundreds or even thousands of instances. Instancing is not free of overhead, for only a handful of instances it will be the same performance, possibly slower. It's more trouble to get it to work, too. So, if all you have is a dozen characers on scren, you may as well not bother. Your meshes vary greatly in their number of vertices. Note that instanced meshes do not need to be identical (on modern hardware) nor do they even have to have the same number of vertices. But they should at least have approximately the same number of vertices because in every batch you must submit as many vertices as in the largest mesh. So, huge differences means either being wasteful on bandwidth and vertex stage or many batches. Otherwise, sure. You can draw more stuff in the same time.
  15. by "altitude" i mean distance from the ground below the object to the object. not from sea level or some other arbitrary value, such as y=0 in a left hand 3D system.Why, though? It's perfectly OK if you have a "high altitude" while standing on a mountain. The stratosphere starts anywhere from 10km altitude to 18km altitude (depending on whether you're closer to the equator or the poles). A high mountain might be, for example, 8611 or even 8848 meters high, so you are indeed darn close to entering the stratosphere. You need breathing support as well. So... is it really wrong to consider standing on that mountain that "high up" and prevent the player from going much higher? I think not. I think that's just how it should be.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!