Advertisement Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

2148 Excellent

About clb

  • Rank
    Advanced Member

Personal Information

  1. I have a BenQ BL3201PT 32" UHD display that supports 10bit color channels on Windows desktop. In nVidia control panel settings, it shows up as a output color depth 10bpc in addition to 8pbc. Here is a screenshot of the control panel setting (googled from the web, that one has even 12bpc option it looks like)   As mentioned above, agree that simply having 10bpc over 8bpc doesn't mean much, unless the actual color space that the monitor can output would increase. This BenQ does not support the Rec.2020 colorspace (or even close), since I don't see any difference in anything with 10bpc vs 8bpc, i.e. 8bpc does not produce banding, nor does 10bpc mode produce any more brightness/luminance/colors/(dynamic) contrast. The TomsHardware test confirms that the display covers only 71.84% of Adobe RGB 1998 color space (and Rec.2020 is way larger than Adobe RGB 1998), and the 10bpc mode is implemented with FRC (frame rate control), so the "supports 10bpc" label on a display is not worth much alone.   Looking forward to seeing a display first hand that would support the full Rec.2020 space. Anyone knows if such displays are actually available for purchase yet?
  2.   This is called proof by example.   Game systems are complex. Yours or X-Plane's cases may not stress the same usage scenarios as Alien Isolation does. It could be difference in performance in a feature that has an easy marketed label attachable to it ("oh, it's geometry shaders that are slower", or "oh, tessellation is this much slower") which can be easy to attribute to layman terms, or it might as well not, and it could just be about some internal API call access patterns that a specific engine or a new fancy rendering technique might need to use.   What is causing the actual slowdown in this specific case, your guess is as good as anyone else's, and the only way to know is if you could ask the first-hand developers who have access to the code and have profiled the game on multiple platforms.
  3. Code snippets like the above should definitely come with a comment disambiguating the used conventions. Inherently a quaternion (nor a matrix) does not have forward, right or up vectors, but it is the semantic conventions that give such meanings. What is 'Up' in one engine can be 'Forward' in the conventions of another engine. Quickly glancing, in the conventions used by the above snippet, the function ComputeRightVector is the image of (1,0,0) or +X vector when transformed (=conjugated) by the quaternion, and ComputeUpVector is the image of (0,1,0)/+Y vector, and ComputeForwardVector is the image of (0,0,1)/+Z vector transformed by the quaternion. The coordinate system is assumed to be left-handed. Were those the assumed conventions?
  4. clb

    Sort unit vectors clockwise

    Split vectors in two halves, those with y < 0, and those with y > 0. Then first make the vectors with y < 0 always precede those with y > 0, and if the vectors have the same sign, then do the dot product. That is, something like bool compare(a,b) { if (a.y*b.y <= 0) // If a and b have different signs on their y coordinate? return a.y < b.y || (a.y == b.y && a.x < b.x); // Then the one pointing down comes before. If both have y = 0, then test x coord. else return a.x*b.y - a.y*b.x < 0; // Same y signs, establish ordering with a perpdot b. } I did not test this code in practice, but I know I use something like this in a recent project, though I don't have the source at hand now to verify. In particular, be sure to test the case when both vectors have y = 0 and only x coordinates differ.
  5. Like discussed already, there is an important distinction to be made between Frustum-AABB intersection test versus a Frustum-AABB culling test. In the first problem, we want to accurately determine whether the two objects intersect. In the second, we want to quickly find (and reject) AABBs that are certainly outside the Frustum, but don't necessarily care if there are some false positives that pass the sieve (since whatever purpose the culling is for, later stages of the pipeline will handle the few undetected cases).   The code presented by Aressera in comment 5 is the commonly presented fast culling test. If you need a precise Frustum-AABB intersection test instead of a culling test, see a precise SAT test, for example in MathGeoLib here: . The difference between the full SAT and the culling test is that the full SAT test tests the cross products of each pair of face normals of the two objects in question, which is enough to quarantee no false positives from occurring.
  6. In MathGeoLib I use Hodgman's method, see , and that has worked well in practice. For float4 type and __m128 support, I use the union approach, see . I favor using those over fancy template accesses, simply because the generated intermediate code is much straightforward, and the code also looks cleaner. (and I extensively unit test on MinGW32/MingW64/GCC/Clang/MSVCs on different platforms so I know when the code is good or not for the platforms I care. Nothing beats rigorous automated testing when it comes to having a peace of mind for correctness)
  7. If you are still targeting old Windows XP and such, then DirectX SDK June 2010 was the last released separate SDK, available here: . See also this:
  8. clb

    Triangle-AABB intersection test

    You can find Triangle-AABB intersection test in MathGeoLib, with references to sources. See
  9.   If you are trying to follow here the suggestion of Rattenhirn, just use his formulas as they were presented (in compact form below):     In particular, note how he passes the same angle value to sin() and cos(), instead of generating two different random values to pass to each.
  10. clb

    issues with binary files to VBO

    When you examine in a hex editor the file you created on disk, is the data correct?   Did the vertex data get loaded correctly upon examination after the ifstream::read() function returns?   Does glGetError() give any errors?   Do you correctly render geometry that did not come from a file? (I assume so, since you specifically point out an issue with rendering from content from a file)   What does your rendering code look like?
  11. clb

    Fast sqrt for 64bit

    Very good points. My benchmark does include loads and stores (identical in each tested variant) to hot cache, and it stresses more throughput, rather than latency. It is difficult to say which one is more important, since it depends if the computation of the overall algorithm has something else to do to hide the latency. Sometimes it's possible to hide latency that it doesn't matter, and other times it is not. Also indeed, none of the timing applies to GPUs or ARM or anything like that.
  12. clb

    Fast sqrt for 64bit

      There is a crossover penalty, or a "bypass delay" at least on Intel hardware for crossing computation of data between float and int modes, see , so float -> int punning comes at the cost of one cycle.       Testing this on a Haswell Core i7 5960X, at , with VS 2013 Community update 4 targeting AVX, yields (reposting the above numbers since different computer and compiler):   Carmack's: 6.16 clocks, precision: 1.75e-3 sqrt_ss(x): 5.92 clocks, precision: 8.4e-8 mulss(rsqrtss(x)): 2.08 clocks, precision: 3e-4 0x1FBD1DF5: 2.32 clocks, precision: 4.3e-2   Looks like using the SSE1 instructions is better at least on the Haswell.
  13. clb

    Fast sqrt for 64bit

    There's benchmarks of different sqrt versions in MathGeoLib benchmark suite. Experience gained from toying around there:     - the x87 fpu sqrt is slow, since modern math is all sse, and there's a penalty in mixing.     - the "Greg Walsh's"/"Carmack's (inv)Sqrt" method should never be used, it is slower and more imprecise than what SSE gives.     - don't assume std::sqrt or sqrtf would be fast, practice shows they might, or might not, and it depends on compiler+OS. Good compilers make these calls down to an intrinsic that gates on -msse or similar, bad ones perform a function call.     - for SSE1-capable hardware there are exactly two methods to consider: _mm_sqrt_ss(x), or _mm_mul_ss(x, _mm_rsqrt_ss(x)).     - _mm_rcp_ss(_mm_rsqrt_ss(x)) is inferior to mul+rsqrt in both performance and precision, on Intel at least.   In general, there is no free lunch, and when measuring what is fast, you are blind if you ignore the other side of the equation: precision. So whenever benchmarking for performance, remember to also benchmark for precision, since there's always a tradeoff. Custom Newton-Rhapson steps don't yield enough improvement to make any of the hacks better than SSE.   The results of the above sqrt variants on a rather old Core 2 Quad and 64-bit Win 8.1 and Visual Studio 2013 targeting 64-bit with SSE2:   Carmack's: time 10 clocks, max relative error (within x=[0, 1e20] range) to std::sqrt(): 1.7e-3 sqrtss: time 12 clocks, relative error 8.4e-8 mulss(rsqrtss): time 4.5 clocks, relative error 3.3e-4     Therefore the rule of thumb is that (on Intels at least) for precise sqrt, use _mm_sqrt_ss(x), and for the fastest possible sqrt, use _mm_mul_ss(x, _mm_rsqrt_ss(x)).
  14.   If the octree looks like as shown in your picture, don't worry, I guarantee you will have decent performance. You will at most test each other object in the node of the planet against that planet. Since the planet is huge, there won't fit many other planets inside the same node, and the number of tests in that node in general remains linear. Since the planet is a sphere, testing collision for that against other objects is dead simple, and you should be able to do in the order of 100k such tests per frame on current desktop PCs without seeing a blip anywhere.   If you have lots of planets, then you might end up in a scenario where things don't look at all like shown in your picture. Your picture is an ideal depiction of the scenario where the octree split planes fit the planet bounds perfectly. If you are doing uniform halving splits, that will most likely never be the case, and you can end up having a very tiny part of a sphere straddling over to a neighboring cell that is almost empty from that planet. If this happens for a lot of planets, there might be a way to do better by considering doing a object partition instead of a space partition, but I would not worry about that until you test your performance in practice and prove it to be a problem.   When measuring your octree performance, it is useful to compute the number of objects in it, the number of traversed nodes it has (empty or not) when doing checks, and the number of pairwise object tests you make. As long as you are seeing linear'ish performance as opposed to quadratic, there's not much chance of getting poor performance, unless your code is very inefficient otherwise (or if this is for a triple-A game with object counts nearing multiple millions).
  15. clb

    Understanding Emscripten

        Sorry, I think you are misquoting me here. The response was aimed for Vincent_M I believe.
  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!