Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

113 Neutral

About arkerone

  • Rank
  1. Thanks kauna it works fine ;)!
  2. Hello, I create a terrain from a heightmap, I would like to correctly calculate the texture coordinates for this terrain. At the moment I apply this formula: [source lang="cpp"]tu.x = vertex.x/terrainWidth; tu.y = vertex.z/terrainHeight;[/source] but I get this: how to calculate the texture coordinates? thx.
  3. Hello, i have a question, i found a tutorial to implement water in directx http://rastertek.com/dx11tut29.html and in shader to compute the textures coordinates of refraction and reflection, the y coordinates is reversed. Why? [source lang="cpp"] // Calculate the projected reflection texture coordinates. reflectTexCoord.x = input.reflectionPosition.x / input.reflectionPosition.w / 2.0f + 0.5f; reflectTexCoord.y = -input.reflectionPosition.y / input.reflectionPosition.w / 2.0f + 0.5f; // Calculate the projected refraction texture coordinates. refractTexCoord.x = input.refractionPosition.x / input.refractionPosition.w / 2.0f + 0.5f; refractTexCoord.y = -input.refractionPosition.y / input.refractionPosition.w / 2.0f + 0.5f;[/source] thx!
  4. arkerone

    Why reverse the light direction?

    thank you everyone I have just realized
  5. Hello, I have a question why do reverse the direction of a directional light? [source lang="cpp"] // Invert the light direction for calculations. lightDir = -lightDirection; // Calculate the amount of light on this pixel. lightIntensity = saturate(dot(input.normal, lightDir));[/source] Thx!
  6. arkerone

    Rotate an object on another

    yes, but if I apply a rotation to rotate the propeller, the transformation matrix isn't same.
  7. arkerone

    3D scrolling

  8. Hello, I have a little problem, I have an object split into two (this is a helicopter) and I would like to turn the propellers of the helicopter, so I applied successive rotations each frame on propellers so that they turn on themselves. The problem is that the helicopter can move in four directions (left, right, down, up) so I applied rotations (20 °) on the helicopter and the propellers but the worry is that propellers no longer remain attached to the helicopter. How to keep "hanging" the propellers on the helicopter? Here's a video of the problem:
  9. arkerone

    3D scrolling

    Hi, I develop a 3D shoot'em up with vertical scrolling. I want to know how to calculate the edges of the screen (the cone of vision?) to that my aircraft remains in the screen when the camera moves? thx.
  10. Hi everybody, I have a problem, I use DXUT and at times when I move my camera, it's jerky. I use these callback : DXUTSetCallbackFrameMove (OnFrameMove, scene); DXUTSetCallbackD3D11FrameRender (OnFrameRender, scene); void WINAPI OnFrameMove( double fTime, float fElapsedTime, void* pUserContext ) { Scene &s = *static_cast<Scene*>(pUserContext); // if the camera move if(s.pCamera.getMove()){ s.pCamera.frameMove(fElapsedTime); // update the position s.pCamera.render(); // compute the matrix s.pCamera.renderReflection(s.pWaterPlane->getHeight()); // compute the matrix of reflection } //move the water s.pShaderWater.setWaterMove(s.pShaderWater.getWaterMove() + 0.0001f); if(s.pShaderWater.getWaterMove() > 1.0f) { s.pShaderWater.setWaterMove(s.pShaderWater.getWaterMove()- 1.0f); } }; The message callback : LRESULT CALLBACK WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam,bool *pbNoFurtherProcessing,void *pUserContext) { Scene &s = *static_cast<Scene*>(pUserContext); switch( msg ) { case WM_KEYDOWN:{ switch(wParam) { case VK_UP : s.pCamera.setMoveForward(true);break; case VK_DOWN : s.pCamera.setMoveBackward(true);break; case VK_LEFT: s.pCamera.setMoveLeft(true);break; case VK_RIGHT : s.pCamera.setMoveRight(true);break; case 'A': s.pCamera.setMoveUp(true);break; case 'Z' : s.pCamera.setMoveDown(true);break; } } break; case WM_KEYUP:{ switch(wParam) { case VK_UP : s.pCamera.setMoveForward(false);break; case VK_DOWN : s.pCamera.setMoveBackward(false);break; case VK_LEFT: s.pCamera.setMoveLeft(false);break; case VK_RIGHT : s.pCamera.setMoveRight(false);break; case 'A': s.pCamera.setMoveUp(false);break; case 'Z' : s.pCamera.setMoveDown(false);break; } } break } return 0; } And the move function : void Camera::MoveForward(float p_time){ if(m_moveForward) m_position.z+=m_speed * p_time; } and in my function onFrameRender , i draw the differents objects of my scene one by one. in 7 sec my camera jumps: [media][/media] An idea of this problem?
  11. arkerone

    Dynamic array on Shader

    Thx, i solved my problem i used a buffer like a ressource. And in my shader i used my buffer : struct cbInstance { Matrix mWorldInstance; float4 colorInstance; }; StructuredBuffer<cbInstance> instanceObject : register(t10); VSout VSmain( VSin Vin,uint InstId:SV_InstanceID) { VSout Vout = (VSout)0; float4 worldPosition; worldPosition = mul(float4(Vin.pos,1), instanceObject[InstId].mWorldInstance); Vout.pos = mul(worldPosition, mViewProj); return Vout; };
  12. Hi, I would create a dynamic table on a shader that contains a global matrix like this: CPU: D3DXMATRIX * mWorld; GPU: Matrix *mWorld How do that? Thx.
  13. Hi everybody, i would like enable the anisotropic filtering? How do this in directx 11? Thx.
  • 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!