Jump to content
  • Advertisement

swecoder

Member
  • Content Count

    40
  • Joined

  • Last visited

Community Reputation

181 Neutral

About swecoder

  • Rank
    Member

Personal Information

  • Interests
    Education
    Programming
  1. swecoder

    Triangelplockaren

    A tool to investigate rendering while game software is running. Useful to identify rendering issues.
  2. Hi all,   I just want to post some information about my current hobby project. Hopefully it will live outside my home in the future.   This is a Windows 8 based remote gaming system where the game runs on the server PC and the user interaction comes from a connected client (currently Windows or Android). There are other related systems out there already, like Nvidia Shield, PS4 -> Vita, Splashtop, Kainy, StreamMyGame and more...   Below are three demo videos, please comment and tell me what you think.   Overview and some intro [media]http:[/media]   Battlefield 4 demo, Surface Pro unit as client [media]http:[/media]   Android demo [media]http:[/media]
  3. Sample funcion to get 2d screen coords from a 3d position with ability to offset the 3d position. some of the identifiers have to be set by you; WORLD_POSITION, SCREEN_WIDTH and SCREEN_HEIGHT. I put it like this to be able to use the function in classes then you want position offsets. If you are going to use it as a global function then the PositionOffset could be the world position directly. returns true if object is in front of camera and false if object is behind camera bool GetScreenPosition(D3DXVECTOR2& ScreenPosition, float& Distance, D3DXVECTOR3 PositionOffset = D3DXVECTOR3(0,0,0)) { D3DXMATRIX m; D3DXVECTOR4 s; D3DXVECTOR3 w; w = WORLD_POSITION + PositionOffset; //VIEW * PROJECTION m = mCamView * mCamProjection; //get vectors from view * proj s.x = w.x * m._11 + w.y * m._21 + w.z * m._31 + m._41; s.y = w.x * m._12 + w.y * m._22 + w.z * m._32 + m._42; s.z = w.x * m._13 + w.y * m._23 + w.z * m._33 + m._43; s.w = w.x * m._14 + w.y * m._24 + w.z * m._34 + m._44; //get inverse of w float w_inv = 1.0f / s.w; //get center of screen float fWidth2 = SCREEN_WIDTH * 0.5f; float fHeight2 = SCREEN_HEIGHT * 0.5f; //get screen coordinates ScreenPosition.x = (1.0f + (s.x * w_inv)) * fWidth2; ScreenPosition.y = SCREEN_HEIGHT - ((1.0f + (s.y * w_inv)) * fHeight2); //get distance to object from camera position Distance = s.z; return (s.z > 0.0f); }
  4. swecoder

    LHCoord sys and RHCord sys

    You find some useful information here, http://msdn.microsoft.com/en-us/library/bb204853.aspx Good luck!
  5. Great article! I think it's a really good thing to have the compilation process done like this. I've always just used the Nvidia build rule-file for this. In their SDK examples there is a complete rule file that can be used as well. From now on I think I'll stick on to yours instead :) Keep it up!
  6. swecoder

    C++ and Vector/Iterator Question

    try change to if ((*i).id == id) { (*i).count++; }
  7. swecoder

    FPS Weapon Clipping

    short, try render using zenable = false or take advantage of stencil buffer and render the weapon first [Edited by - swecoder on February 22, 2008 9:45:31 AM]
  8. sorry, i made a mistake in my original code. please try the new updated version.
  9. swecoder

    [D3D10] Shader reflection question

    Maybe this could be something for you? http://msdn2.microsoft.com/en-us/library/bb173633(VS.85).aspx ID3D10EffectBlendVariable::GetBlendState
  10. maybe the exporter "Deep Exploration" can do it. Here you can see all formats supported by DE, http://www.righthemisphere.com/support/help/supported_file_formats/Deep_Exploration_Supported_File_Formats.pdf Good luck!
  11. hi! use the inverse of the view matrix. then it's easy to translate the gun anyway you want. Below code is written from head so it may not work D3DXMATRIX viewInv, deltaTrans; D3DXMatrixInverse(&viewInv, 0, &cam->getView()); //place gun 3 units forward along z-axis D3DXMatrixTranslation(&deltaTrans, 0, 0, 3.0f); worldMatrix = deltaTrans * viewInv; [Edited by - swecoder on January 24, 2008 1:10:52 PM]
  12. swecoder

    Geometry Shader - triangleadj qn

    Here I wrote a simple example. The adjacent vertices have index 1,3,5 therefore i output index 0,2,4 Don't forget to call Mesh->GenerateGSAdjacency(); before trying to render :) [maxvertexcount (6)] void GS(triangleadj GS_INPUT input[6], inout TriangleStream<GS_OUTPUT> Stream) { GS_OUTPUT output = (GS_OUTPUT)0; for(int i = 0; i <= 4; i+=2) { output.Pos = mul(input.Pos, viewProjMatrix); output.Normal = input.Normal; output.Tex = input.Tex; Stream.Append(output); } Stream.RestartStrip(); } Hope this helps. Please let me know if you have more questions.
  13. swecoder

    d3d10 adjacent primitives

    Quote:Original post by Quat Quote: For example if you have two triangles in a vertex buffer they will automatically be adjacent to each other. You can have two triangles in a vertex buffer that are disjoint. Yes, but if you look at the link i posted the theory might not be the same as for standard triangle lists. If you have disjoint triangles in a buffer the adjancent topology might not work as expected. More info: http://www.gamedev.net/community/forums/topic.asp?topic_id=464067
  14. Hi! Please give us more information. For a start, how and what do you measure? Are you sure everything is done correctly? Have you looked at the stream out status (http://msdn2.microsoft.com/en-us/library/Bb205335.aspx)? It's alot easier to help if we get all the variables. Maybe you find the final answer by answering my questions.
  15. swecoder

    d3d10 adjacent primitives

    Hello! I think that you (or maybe me:)) have misunderstood what adjacent triangles really are. For example if you have two triangles in a vertex buffer they will automatically be adjacent to each other. Take a look at this page, http://msdn2.microsoft.com/en-us/library/bb205124.aspx Good Luck!
  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!