Jump to content
  • Advertisement

BFG

Member
  • Content count

    56
  • Joined

  • Last visited

Community Reputation

1302 Excellent

About BFG

  • Rank
    Member

Personal Information

  • Role
    Programmer
  • Interests
    Art
    Audio
    Business
    Design
    Production
    Programming
  1. Ideally you should use the most recent version of Visual Studio. If for some reason you cannot, you should at least upgrade to a Visual Studio version that implements the C++ features you are using (see https://msdn.microsoft.com/en-us/library/hh567368.aspx). If for some reason you are stuck with VS 2010, you have to change all your code so it only uses the C++ features it supports.
  2. zlib (specifically contrib/minizip) can create zip files. Use a zero compression level if you really want the files in the zip file to be uncompressed. PAK files are usually just zip files.
  3. I remember facing this problem. If I recall correctly it boils down to finding the inverse of a function of the form f(x) = a*x + b*cos(c*x) for which I believe there is no analytic solution. If you find one though let me know! Without an analytic solution you have a couple of options. Probably the best option is to formulate some approximation. A simple option though is to just displace a mesh on the CPU around where you need to sample heights and use that (e.g., if you need the heights for a boat, create a "collision mesh" around the boat extending beyond the boat boundary by the maximum horizontal wave displacement).
  4. Looks like a gamma problem, e.g., your algorithm expects linear pixel data and you are using non-linear sRGB pixel data.
  5. cell.x = layeroffset % numcells.x; In HLSL the modulus operator gives different results for floats and integers.  Try casting numcells.x in the above line to a uint. See: https://msdn.microsoft.com/en-us/library/windows/desktop/bb509631(v=vs.85).aspx#Additive_and_Multiplicative_Operators
  6. You might have better luck using the VS solutions in the curl-XXX/projects/Windows/ directory and compiling for the static LIB configurations.  The last time I did this was a few years ago so maybe things have changed.  Anyway I compiled with Windows Secure Channel for SSL (see https://curl.haxx.se/docs/ssl-compared.html) and add the following to Preprocessor Definitions: USE_SCHANNEL USE_WINDOWS_SSPI HTTP_ONLY   This worked and added only 100K or so to the executable size.  Using OpenSSL also worked but add a megabyte.   Good luck!   
  7.   That's certainly a bug but I wouldn't say it's the main problem.  It wouldn't cause the discontinuities OP was getting.   Check out what happens when you do (1) floorf, (2) the "improved" second FAST_FLOOR macro above, and (3) the "original" first FAST_FLOOR macro above on the following arguments respectively: #define FAST_FLOOR_ORIGINAL(x) ((x>0) ? (int)x : ((int)x-1)) #define FAST_FLOOR_IMPROVED(x) (((x)>0) ? ((int)(x)) : (((int)(x))-1)) // but still incorrect for floating point values that are exactly nonpositive integers for (float x = -1.5f; x < 2.f; x += 0.1f) { const int a = floorf(x + 1.2f); const int b = FAST_FLOOR_IMPROVED(x + 1.2f); const int c = FAST_FLOOR_ORIGINAL(x + 1.2f); fprintf(fp, "(%f + 1.2f): %d %d %d\n", x, a, b, c); } (-1.500000 + 1.2f):  -1 -1 0 (-1.400000 + 1.2f):  -1 -1 0 (-1.300000 + 1.2f):  -1 -1 0 (-1.200000 + 1.2f):  0 0 0 (-1.100000 + 1.2f):  0 0 0 (-1.000000 + 1.2f):  0 0 1 (-0.900000 + 1.2f):  0 0 1 (-0.800000 + 1.2f):  0 0 1 (-0.700000 + 1.2f):  0 0 1 (-0.600000 + 1.2f):  0 0 1 (-0.500000 + 1.2f):  0 0 1 (-0.400000 + 1.2f):  0 0 1 (-0.300000 + 1.2f):  0 0 1 (-0.200000 + 1.2f):  1 1 1 (-0.100000 + 1.2f):  1 1 1 (0.000000 + 1.2f):  1 1 1 (0.100000 + 1.2f):  1 1 1 (0.200000 + 1.2f):  1 1 1 (0.300000 + 1.2f):  1 1 1 (0.400000 + 1.2f):  1 1 1 (0.500000 + 1.2f):  1 1 1 (0.600000 + 1.2f):  1 1 1 (0.700000 + 1.2f):  1 1 1 (0.800000 + 1.2f):  2 2 1 (0.900000 + 1.2f):  2 2 1 (1.000000 + 1.2f):  2 2 2 (1.100000 + 1.2f):  2 2 2 (1.200000 + 1.2f):  2 2 2 (1.300000 + 1.2f):  2 2 2 (1.400000 + 1.2f):  2 2 2 (1.500000 + 1.2f):  2 2 2 (1.600000 + 1.2f):  2 2 2 (1.700000 + 1.2f):  2 2 2 (1.800000 + 1.2f):  3 3 2 (1.900000 + 1.2f):  3 3 2  
  8. If your macro looks like this... #define FAST_FLOOR(x) ((x>0) ? (int)x : ((int)x-1)) ...then trying changing it to: #define FAST_FLOOR(x) (((x)>0) ? ((int)(x)) : (((int)(x))-1))
  9. I did it.  It's not hard but can take a lot more time than you might think. Consider all the changes and how they might impact your project: https://msdn.microsoft.com/en-us/library/windows/desktop/bb205073(v=vs.85).aspx.  I would never do it near the end of a project...because then I would no longer be near the end of the project.
  10. You will probably create more problems than you solve by making a heightmap be an actor.  It's likely to be a special case in every scenario (collision, rendering, etc.).
  11. Note that "nointerpolation" uses the value from the first vertex of a primitive.  If that doesn't work for you, then the "normal" approach is to duplicate vertices.
  12. Sounds like you're mapping straight to noise.  Noise by itself is boring and repetitive especially at low frequencies.  The trick is to build a sufficiently complex (and interesting) function using various transformations and combinations of noise, e.g., http://http.developer.nvidia.com/GPUGems3/gpugems3_ch01.html.
  13. You can "seed" Perlin/Simplex noise by shuffling the permutation table using a PRNG with a given seed.  It's immutable after that.  For speed look at SIMD implementations.    Not sure I understood your input requirements.  Sounds like the appropriate hash of your input would do what you want.
  14.   [attachment=33705:ocean.png]
  15. BFG

    Random

    Random
  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!