Nik02

Member
  • Content count

    4372
  • Joined

  • Last visited

Community Reputation

4353 Excellent

3 Followers

About Nik02

  • Rank
    Contributor

Personal Information

  • Interests
    Art
    Audio
    Programming
  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. 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.
  9. 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.
  10. 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; }
  11. How do i access the sound buffer for win32 ?

    XAudio is effectively the successor to DirectSound, and it is a separate library in the same sense as XAudio is. BOTH of them are pre-installed in modern Windows versions. Moreover, XAudio is easier to use than DS, and has lower latency as well
  12. How do i access the sound buffer for win32 ?

    XAudio is a system component that, I believe, is installed as part of Windows. Any applications that play sound effectively need to go through the system-supplied interfaces, be it XAudio or something equivalent. Applications generally don't call drivers directly; there is always at least one abstraction layer between them. DirectSound, SDL, Core Audio and DirectShow are examples of alternatives for XAudio, but not one of them provides you direct access to the primary sound buffer. And for a good reason.
  13. How do i access the sound buffer for win32 ?

    You don't have direct access to the kernel mixer from user-mode applications. Instead, use a low-level API such as XAudio. This allows you to submit your own buffers to be mixed to the audio output.
  14. Image Processing Server

    Video compression would create latency and quality loss.
  15. Image Processing Server

    Http-like (or actual http) protocol would be a good choice here, as you could send the metadata in the headers and the image data in the request body.