Jump to content
  • Advertisement

catrexis

Member
  • Content Count

    9
  • Joined

  • Last visited

Community Reputation

113 Neutral

About catrexis

  • Rank
    Newbie
  1. Okay I reduced my project to keep my upload small. You should be able to open and run it now. short description of my project: starting point is graphicsClass.cpp -> initialize function look for: // Initialize the model object.     m_texFileArray = new std::wstring[2];     m_texFileArray[0] = L"../Engine/data/stone01.dds";     m_texFileArray[1] = L"../Engine/data/bump01.dds";     result = m_Model->Initialize(m_D3D->GetDevice(), "../Engine/data/square.txt", m_texFileArray, 2);and a little later: // Initialize the multitexture shader object.     result = m_MultiTextureShader->Initialize(m_D3D->GetDevice(), hwnd, BUMPMAPPING);I read in my model there: a square. But you could also take cube.txt. Then it will be a cube. The textures loaded before are the color texture (stone01.dds) and the bump map texture (bump01.dds) in the initialize function of the multitextureshader just the last parameter is important. It specifies that I use bumpmapping. You could change this to DEFAULTMAPPING and use dirt01.dds and not bump01.dds this will merge the two textures used. But if you want to, you must change sth in the render function:   // Render the model using the multitexture shader in Bump mode.     m_MultiTextureShader->RenderBump(m_D3D->GetDeviceContext(), m_Model->GetIndexCount(), modelWorldMatrix, viewMatrix, projectionMatrix, m_Model->GetTextureArray(), m_Light->GetDirection(), m_Light->GetDiffuseColor());     // Render the model using the multitexture shader.     //m_MultiTextureShader->Render(m_D3D->GetDeviceContext(), m_Model->GetIndexCount(), modelWorldMatrix, viewMatrix, projectionMatrix, m_Model->GetTextureArray());comment the first out and uncomment the second, if you want to use DEFAULTMAPPING. With W,A,S,D you could rotate the model. With esc you quit. My Problem again: With Bumpmapping active, The sqare and Cube are not drawn correctly, when you build the project in release and start the .exe in the release folder. In your visual studio and in debug mode the problem does not occur. There is no problem when you use the DEFAULTMAPPING.     http://uploaded.net/file/l0h7hga6
  2. Okay I initialized all member Variables now... but still have the same Problem. I uploaded my Project and source Code, because I don't know how to continiue...   Again my Problem: VS 2010 Debug: OK VS 2010 Release: OK open debug executable: OK open release executable: Problem: Some Triangles of my cube are not visible... (by the way: on the notebook of a friend, one of the triangles, that are not visible on mine is visible there)   short description of my programm: there is a spinning specular mapped cube in the middle. With left and right arrow key you can turn around left and right. with esc you close the programm. When you click the left mouse key a sound is played (you have also background music). In the upper left corner there is a render to texture image (which does not support the arrow keys jet -> it disappeares when you turn around)   whole project: http://uploaded.net/file/75ex3rxy   source only: at the end of the post.   thanks for your help so far by the way ;-)
  3. Is it okay, when I initialize the member variables in the constructor to 0 and later in my initialize functions to some value? Can anybody explain me, why they must be initialized in the constructor when I'm in release mode?   And why does the problem not occur, when I start my project in the Visual Studio in Release mode? Just when I'm starting the release .exe?
  4.   I will do it in future. But your advise doesn't help me today..   I will write again when I got rid of all the warnings from cppcheck...
  5. Okay thanks for your hints so far... I downloaded cppcheck and now I'am solving the tons of warnings (many member variables not initialized in the constructor)       How can I debug with warning level 4?       How to use this DX Control Panel, or is it self-explaining (I didn't try it yet)?
  6. Heyho I follow the tutorials from rastertek.com. I'am at Lesson 22 and tried to change my engine to release mode the first time. Now my problem: my engine works in VS 2010 debug AND release mode. BUT: When I start the executables in my engine-folder, the debug one is fine but the release one not. On the right side of my spinning cube, a triangle is sometimes missing (black) and also the whole backside is lost... And I don't know why... And why does the problem just occur, when I start the executable and not when I start it in the Visual Studio? Could anybody help me? Cat
  7. Okay, thanks so far =) You discribed it very well =)   Just one more question: In my tutorials, he just switches alpha-blending on when its needed. Couldn't I leave it switched on during the whole drawing process? Or does it speed up the programm, when it doesn't have to evaluate the alpha value?
  8. Hi =) I follow the tutorials from rastertek.com (#13 today) and just created my own pikachu-cursor. I took a PNG-File, deleted the background and switched it to a DDS-File. When I view only the alpha-channel of this file, the pikachu is white and the background is black. So far so good... In his/her Tutorails he added a function called "TurnOnAlphaBlending();", that registers a BlendingState with the following D3D11_BLEND_DESC:    blendStateDescription.RenderTarget[0].BlendEnable = TRUE;     blendStateDescription.RenderTarget[0].SrcBlend = D3D11_BLEND_ONE;     blendStateDescription.RenderTarget[0].DestBlend = D3D11_BLEND_INV_SRC_ALPHA;     blendStateDescription.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD;     blendStateDescription.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ONE;     blendStateDescription.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_ZERO;     blendStateDescription.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD;     blendStateDescription.RenderTarget[0].RenderTargetWriteMask = 0x0f; When I understand alpha blending right, now a Pixel won't be drawn on the screen, if its alpha-channel is 0.0f and you can see what's below it... But when I draw my Cursor its background is not totally transparent. You can see through but its like you see through a violett glass. I had to add a few lines in my PixelShader: if(textureColor.a == 0.0f)     {         textureColor = float4(0.0f,0.0f,0.0f,0.0f);     } Then I get the result I want. But I don't know why??? If the alpha-value is zero, that sould be enough, shouldn't it? Why does the color have to be black? Or what sould I change to get the right result without the last lines?   I hope, you can help me =)   Cat        
  • Advertisement
×

Important Information

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

GameDev.net 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!