Soul Reaver

  • Content count

  • Joined

  • Last visited

Community Reputation

108 Neutral

About Soul Reaver

  • Rank
  1. Issues with XAudio2 & mono Ogg Vorbis

    So, this thread is old but I've encountered this problem again. I had to rewrite parts of my audio engine and the same exact issue appeared with mono vorbis files. But I could fix it by aligning the data to 2 bytes. My struct to save pcm data now looks like this: [source lang="cpp"] struct PCM_BUFFER { bool submitted; UINT size, flags; __declspec( align(2) ) BYTE data[BUFFER_SIZE]; }; [/source] Just wanted to share this with you in case you have the same problem.
  2. [ps1.4] Cubemap not sampling properly

    Seems like I have to abandon bump mapping then. Thanks for your help anyway.
  3. [ps1.4] Cubemap not sampling properly

    [quote name='MJP' timestamp='1315947490' post='4861253'] The first thing I would do would be to make sure that the cubemap is getting filled properly. I'm guessing PIX doesn't work with DX8? If not, you could just save out the cubemap as a .DDS and then look at it with DXTex to make sure it looks like what you're expecting. [/quote] I tried that and it looks like the cubemap is being filled like expected. Are there any render or sampler states which could cause my problem? Maybe the engine screws that up without me knowing about it.
  4. [ps1.4] Cubemap not sampling properly

    Unfortunately that's not possible. I didn't develop the engine and it isn't open source, so changing the engine would mean rewriting the whole game as this engine offers much high level functionality.
  5. Hi, currently I'm trying to implement bump mapping in a topdown game of mine. Unfortunately the engine of this game is based on DirectX 8.1 so I'm forced to use ps.1.4 & vs.1.1 as shader model. As you may or may not know ps.1.4 doesn't have functions like sqrt() or pow() so it's a real pain in the ass to implement the specular component of the blinn phong lighting model. To avoid these restrictions I decided to use a renormalization cubemap which is then used to renormalize the half vector which is passed from the vertex shader to the pixel shader. The problem is that sampling the cubemap returns always black, thus (0, 0, 0, a). I create my cubemap on the fly as follows: [source lang=cpp] // Create the cube map and fill it pDevice->CreateCubeTexture(512, 0, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &m_pNormalizationCubemap); D3DXFillCubeTexture(m_pNormalizationCubemap, FillCubeMap, NULL); // Fill callback void FillCubeMap(D3DXVECTOR4 *pOut, D3DXVECTOR3 *pTexCoord, D3DXVECTOR3 *pTexelSize, LPVOID pData) { // For testing purposes I set every texel to red pOut->x = 1.0f; //pTexCoord->x * 0.5f + 0.5f; pOut->y = 0.0f; //pTexCoord->y * 0.5f + 0.5f; pOut->z = 0.0f //pTexCoord->z * 0.5f + 0.5f; pOut->w = 0; } [/source] Both functions return S_OK, I bind this texture to texture stage 2 with IDirect3DDevice8::SetTexture() which also returns S_OK and let the pixel shader sample it as follows: [source] texld r2, t2 mov r0, r2 [/source] The primitives should now be rendered in bright red but instead everything is black, which means that the sampling returned black. But why? I really have no idea what I'm doing wrong.
  6. [DX8] Strange filling behavior

    Thank you very much, even though I have read [url=""]this article[/url] already some time ago I just forgot it. Thanks again, now everything works as expected.
  7. [DX8] Strange filling behavior

    [quote name='Nanoha' timestamp='1312410224' post='4844236'] Did you try adding 32 instead of 31? Also a picture might describe the problem better. [/quote] Then the cells would be of size 33 and the texture would get distorted. A picture would only show tiles with gaps of 1px between them.
  8. Hi, currently I'm wondering about a strange issue I recently encountered. I'm trying to render a field of 32 * 32 cells for a topdown game. So the generation of the vertices looks something like this: [source lang="cpp"] for(int x = 0; x < map_width; x++) { for(int y = 0; y < map_height; y++) { add_vertex(x * 32, y * 32); add_vertex(x * 32 + 31, y * 32); add_vertex(y * 32 + 31, y * 32 + 31); add_vertex(x * 32, y * 32 + 31); } } [/source] When I render these vertices there a gaps between the individual cells even though they are all of the dimension 32 * 32. What's really strange is that those gaps don't exist if I render in wireframe mode. Consequently, there are no gaps if I first render the scene normally and then in wireframe mode. So, what is happening here? Why is the "outline" not rendered in solid fillmode? Any idea what I can do? Enlarging the cells isn't an option because the 32 * 32 texture will get distorted.
  9. MinGW and DirectX9SDK - WinXP SP3

    MinGW has its own D3D headers and libraries if I recall correctly. It's certainly possible to compile a D3D application with MinGW.
  10. Drawing 3D object in screen space

    Or you just could set the projection matrix accordingly for drawing your GUI stuff. Edit: Oh sorry I'm a fool, I overlooked that you wanted to render a 3D object
  11. [XAudio2] Equalizer causes crackling noises

    Thanks, you were absolutely right. I just didn't realize that I can't use the same effect for multiple streams.
  12. [XAudio2] Equalizer causes crackling noises

    Okay, after some experimenting I was able to isolate the problem a bit more: So I have two submix voices, which represent the groups for sound effects and background music, which send their output directly to the mastering voice. The EQ effect is applied to both submix voices with the same parameters. If there are multiple source voices which send their data to the same submix voice and there are no source voices which send their data to the other submix voice everything is fine. Also everything works perfectly if I deactivate the effect for one of the submix voices even if both submix voices send data to the mastering voice. So my guess is that these crackling sounds occur if the mastering voice receives data from multiple submix voices, which have the EQ effect enabled. But why? Has anybody an idea why this happens? Shall I put together a minmal example to show what I mean?
  13. Hi, currently I'm wondering about an issue I ran into recently: In order to get an overall dull sound in certain situations, I decided to use the built-in equalizer effect of XAPOFX. I declared the FXEQ_PARAMETERS-structure as follows: [source lang="cpp"] FXEQ_PARAMETERS params; params.FrequencyCenter0 = FXEQ_DEFAULT_FREQUENCY_CENTER_0; params.Bandwidth0 = FXEQ_DEFAULT_BANDWIDTH; params.Gain0 = 1.0f; params.FrequencyCenter1 = FXEQ_DEFAULT_FREQUENCY_CENTER_1; params.Bandwidth1 = FXEQ_DEFAULT_BANDWIDTH; params.Gain1 = 1.0f; params.FrequencyCenter2 = FXEQ_DEFAULT_FREQUENCY_CENTER_2; params.Bandwidth2 = FXEQ_DEFAULT_BANDWIDTH; params.Gain2 = 0.2f; params.FrequencyCenter3 = FXEQ_DEFAULT_FREQUENCY_CENTER_3; params.Bandwidth3 = FXEQ_DEFAULT_BANDWIDTH; params.Gain3 = 0.2f; [/source] So as you can see I use default values mostly. The result is, as expected, a dull sound. But consider the following: I have two source voices (one represents background music, the other one a short sound effect) and each of these voices has its own submix voice, which uses the EQ effect described above. As long as the effect is deactivated everything is fine but otherwise there is a strange crackling sound, which only occurs if both voices are playing and the effect is enabled. So what am I doing wrong? Do I have to account of something I missed when using the equalizer effect? Thanks in advance.
  14. Stack Overflow? (Operator Overloading)

    [quote name='coderWalker' timestamp='1308318309' post='4824449'] I keep getting a stack overflow error when running the below code. Can anyone tell me why this is? Thanks [code]//Create the array char testWorld[25*16][25*16][25*16]; //Populate the array for (int z=0; z<25*16; z++) { for (int y=0; y<25*16; y++) { for (int x=0; x<25*16; x++) { testWorld[x][y][z] = testWorld[x+16][y][z]; } } } //Move the array fps->start(); for (int z=0; z<25*16; z++) { for (int y=0; y<25*16; y++) { for (int x=0; x<24*16; x++) { testWorld[x][y][z] = testWorld[x+16][y][z]; } } } cout << fps->get_ticks();[/code] [/quote] Your array is just to big for the Stack. You'll need to allocate it dynamically.
  15. Issues with XAudio2 & mono Ogg Vorbis

    Oh man, just when I was checking the pointers of the pAudioData pointers I realized that those contain only zeros. For some reason the ov_read()-function copies only zeros into the buffer while not generating any error. I really should have checked that at first. *facepalm* Btw: The pointers are in fact odd, but it doesn't seem to bother XAudio2 in contrary to empty buffers. Thanks for your help, I think I can fix this finally.