• Advertisement

Nik02

Member
  • Content count

    4377
  • Joined

  • Last visited

Community Reputation

4356 Excellent

3 Followers

About Nik02

  • Rank
    Contributor

Personal Information

  • Interests
    Art
    Audio
    Programming
  1. If the server has only the public key of the client (which is a good and common practice), the server can't decrypt the data that it itself encrypted for the said client. Only the client's private key can decrypt. Note that commonly only the secure handshaking is asymmetric, and after secure channel is established by exchanging the public keys for each participant, the actual communication is done by negotiating a shared symmetric key because they are easier to process and manage. The shared keys can be rotated or renegotiated many times on a secure transit session.
  2. Authentication protocols often involve exchanging public keys (which look like random arrays of bytes) and negotiating shared symmetric keys (which also look like random bytes).
  3. Joystick for flight simulator.

    In airplanes without flight plane auto correction, rolling actually causes the pitch of the airplane to decrease because the lift is not applied in the neutral (upwards) direction. This is often compensated by adjusting engine throttle and using tail elevator+rudder flaps and/or other control surfaces so as to keep the altitude unchanged. In this case, though, it's probably the joystick's fault.
  4. Bitmap Graphic Needs Smoothing

    The operation you want is called "magnification filtering" or "resampling", not antialiasing. You can't avoid blockiness easily because the original image simply doesn't have enough data to uniquely fill the larger area, but you can choose a smooth filter like bicubic, to trade accuracy for visual smoothness.
  5. Voronoi Shatters results

    Voronoi cells can be concave as well, depending on the distance metric function chosen. Euclidean distance gives convex results, but Manhattan distance, for example, may not.
  6. The operations simply behave differently depending on whether or not the data type is signed. The data itself is just bits in memory, in any case.
  7. Algorithm The best Android app

    Your question is very confusing. Anyway, is your goal to monitor your cellular data usage? Modern Android versions (newer than 6 years old or so) have a statistic page built in the settings which shows you the data consumption, and you can set warnings and limits to that.
  8. Is this for a special effect or are you trying to gain performance? In the latter case, it is likely not worth the hassle, as changing the relevant render states is relatively slow and you might better off just antialiasing everything. This depends on the target system bottlenecks, though. If you want to generally mask some rendering by using arbitrary shapes, read up on stencil buffers. Using them, you would draw the star shape to the stencil buffer (to form the mask), and then setting the render states for the subsequent rendering to either pass or reject pixels based on the stencil. In this case, you'd do the antialiased rendering with the stencil configuration that would pass only the pixels within the mask. It is also possible to have more than one bit of stencil data per pixel, for multi-layered pass/reject logics. If I remember correctly, you can control antialiasing during a frame by using glEnable, glDisable and GL_MULTISAMPLE. Enabling it requires that you have a rendering context that supports antialiasing to begin with.
  9. One can already enable game-agnostic FXAA filter from both Nvidia and AMD graphics driver configuration pages, for budget cards and top tier alike. This is a hack, as (in my opinion) is the cable you mention. I strongly agree with Hodgman - the post-processing smoothing does fix a quality issue, but introduces more than one quality issue in doing that. Adding to that, most gamers - especially pro - would conceivably prefer sharper image as opposed to artificial smoothing, in order to see as much detail as possible.
  10. Apache Cordova lets you wrap your html applications to a native wrapper. It works with many platforms, including all the major desktop and mobile ones. That said, it is worth thinking if you need to do that or would it be better to run within a browser. With the latter approach, the users don't need to install anything extra in order to run your app. "Simple 2D puzzle games" do not tend to require anything that browsers won't support.
  11. You can run javascript on almost any web browser, regardless of the OS platform. The features you can access depend on the browser make and version, but there is a relatively solid baseline in HTML5.
  12. Radiosity C++ Directx 11 implementation

    The algorithm described in the linked paper requires that all geometry (and local light emitters) are static in order for the light transfer approximation to be pre-computable. If the geometry changes, then so does each transfer function of the probes that "see" the changed geometry either directly or indirectly. The environment light map (infinitely far skybox, essentially) does not need to be static, as the spherical harmonic functions are evaluated against its contribution at runtime. The algorithm allows for dynamic meshes (as in moving characters and objects) be lit with the existing radiosity data by taking n nearest probes of the mesh and evaluating the lighting of the object from them, but the dynamic objects cannot easily contribute to the radiosity solution so shadows and light bleeding of said dynamic objects would not work without further processing.
  13. 512^3 is 128MB with 8-bit texels, so it reasonably fits into GPU memory on modern hardware. 2048^3 is 8GB which does not fit into on-board memory of common gaming GPUs. It does fit into professional (as in Quadro) cards, but even in professional applications it is rare that such large individual buffers would be used. Note that the memory access is relatively much slower than shader arithmetic, if compared to 5-10 years ago. This is because memory bus width cannot be easily scaled up, but the number of shader cores has increased quite a bit. Whereas in the old days something would run better from a 3d lookup table, the same logic could now run much faster by just running the math on the shader. Depends on the program, of course.
  14. How do i access the sound buffer for win32 ?

    There is a redistributable available for XP. However, XP in general is an unsafe platform nowadays because MS does not support it with security updates anymore.
  15. How do i access the sound buffer for win32 ?

    This small XAudio2 example should work as is on Windows 10. For earlier versions, change the dll name as needed. This is not production-ready code because it does not perform any error checking whatsoever. In particular, one should check for success on every API call before proceeding, and in case of heap allocation, check that the memory was actually available. Also, typically audio APIs are used in applications with event loops (as in windows desktop apps), so that playing a single sound buffer is not the last thing the program does before exiting. // XAudioDemo.cpp : Defines the entry point for the console application. // // NO WARRANTY! The code provided is just for example purposes. // The code below skips almost all error checking so it should not be used in production applications as is. // In real code we should check for failure and success for all API calls and memory allocations. // -Niko #include "stdafx.h" /* In addition to the default console app headers, we include the following in stdafx.h: #include <Windows.h> #include "XAudio2.h" #include <cmath> */ typedef HRESULT WINAPI xaudio2_create(IXAudio2**, UINT32, XAUDIO2_PROCESSOR); int main() { CoInitializeEx(0, 0); HMODULE XAudioLib = LoadLibrary(L"xaudio2_9.dll"); // for windows 10, use XAudio 2.9 xaudio2_create* xaudiocreate; xaudiocreate = (xaudio2_create*)GetProcAddress(XAudioLib, "XAudio2Create"); IXAudio2 *pxaudio = NULL; xaudiocreate(&pxaudio, 0, XAUDIO2_DEFAULT_PROCESSOR); IXAudio2MasteringVoice *pMasteringVoice = NULL; pxaudio->CreateMasteringVoice(&pMasteringVoice, XAUDIO2_DEFAULT_CHANNELS, 22050); IXAudio2SourceVoice *pSourceVoice = NULL; WAVEFORMATEX sourceFormat; sourceFormat.cbSize = 0; sourceFormat.nAvgBytesPerSec = 22050 * 2; sourceFormat.nBlockAlign = 2; // 2 bytes per sample sourceFormat.nChannels = 1; // mono sourceFormat.nSamplesPerSec = 22050; sourceFormat.wBitsPerSample = 16; sourceFormat.wFormatTag = WAVE_FORMAT_PCM; pxaudio->CreateSourceVoice(&pSourceVoice, &sourceFormat); XAUDIO2_BUFFER buffer = { 0 }; buffer.Flags = XAUDIO2_END_OF_STREAM; INT16* sampleData = new INT16[22050 * 2]; // 2 seconds of 22050Hz mono data // sound synthesis for (int i = 0; i < 22050 * 2; ++i) { double sv = std::sin((double)i / (double)22050 * 5000.0); // sine wave sampleData[i] = sv * 32767.0; // amplify from -1...1 to sample range } buffer.AudioBytes = 22050 * 2 * 2; buffer.pAudioData = (BYTE*)sampleData; pSourceVoice->SubmitSourceBuffer(&buffer); pxaudio->StartEngine(); pSourceVoice->Start(0, XAUDIO2_COMMIT_NOW); // Since we are in a console app, we need to sleep here so as to not exit immediately. // In desktop apps, we could handle the XAudio voice callbacks instead. Sleep(2000); pxaudio->StopEngine(); delete[] sampleData; return 0; }
  • Advertisement