Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

125 Neutral

About TomMettam

  • Rank
  1.   That's the conclusion I came to, also.  However, as you mention, we don't get any "device lost" signalled when this happens (with DX11, "device lost" only occurs on major events  such as a driver upgrade).   I guess I will have to just ignore this and let DX do its thing internally.
  2.   To be clear, I'm not talking about locking buffers - I mean physically locking the workstation (Ctrl - Alt - Delete  -> Lock) - for some reason this causes the effect mentioned.
  3.   Interesting. If true, is there anything I can do to prevent this?
  4. Hi all   I'm building an engine, and in this case it's built for Windows / DirectX 11 via Visual Studio 2013. I'm trying to diagnose a really awkward problem.  When I build for release configuration only, the memory usage of my application doubles when the screen is locked. (I'm running Windows 8.1 if it makes a difference).   It doesn't happen when built for debug, and while the memory profiler shows the huge memory leap, it doesn't show any sign of it in the heap:   I'm not really sure how to go about diagnosing this issue. If I take a look at one of these snapshots, it shows the heap at approximately 32mb, and nothing else.   Does anyone have any idea what the culprit might be?
  5. TomMettam

    Skinning - normal calculations

    Yes, was that silly typo. D'oh.   Thanks for your help, anyway!
  6. TomMettam

    Skinning - normal calculations

    I think someone on IRC found the issue: tempNormal += mul(output.normal, (float3x3)b.boneMatrix) * jointWeight; I missed the =   I will test the change tonight, hopefully it resolves the issue!   Thanks for your shader code, that will be very helpful :)
  7. Hi all   I have implemented HLSL hardware skinning (based on a Collada source).   While the vertices are fine, and the model skins and animated properly, for some reason unfortunately my normals are not being calculated correctly.  Any chance someone might be able to suggest a reason why?   cbuffer MatrixBuffer : register(b0) { matrix worldMatrix; matrix viewMatrix; matrix projectionMatrix; }; struct Bone {     matrix boneMatrix; }; cbuffer JointBuffer : register(b2) {     float4x4 bindShapeMatrix;     int boneCount;     Bone bones[256]; }; ////////////// // TYPEDEFS // ////////////// struct VertexInputType { float4 position : POSITION; float4 tex : TEXCOORD0; float4 normal : NORMAL; uint4 jointindices1 : BLENDINDICES0; uint4 jointindices2 : BLENDINDICES1; float4 jointweights1 : BLENDWEIGHT0; float4 jointweights2 : BLENDWEIGHT1; int4 parameters : TEXCOORD1; }; struct PixelInputType { float4 position : SV_POSITION; float2 tex : TEXCOORD0; float3 normal : NORMAL; }; //////////////////////////////////////////////////////////////////////////////// // Vertex Shader //////////////////////////////////////////////////////////////////////////////// PixelInputType TextureVertexShader(VertexInputType input) {     PixelInputType output;      output.position = input.position;     output.normal = input.normal;     float totalWeight = 0.0f;     float4 tempVertex = {0.0f, 0.0f, 0.0f, 0.0f};     float4 tempNormal = {0.0f, 0.0f, 0.0f, 0.0f};     bool adjusted = false;     for(int x = 0; x < input.parameters.y; x++)     {         int jointIndex = [SNIP - code to get the jointIndex here];         float jointWeight = [SNIP - code to get the jointWeight here];         if (jointIndex > -1 && jointIndex < boneCount)         {             Bone b = bones[jointIndex];             tempVertex += mul(output.position, b.boneMatrix) * jointWeight;             tempNormal += mul(output.normal, (float3x3)b.boneMatrix) * jointWeight;             totalWeight += jointWeight;             adjusted = true;         }     }     if (adjusted)     {         tempVertex *= (1.0f / totalWeight);         tempNormal *= (1.0f / totalWeight);         output.position.x = tempVertex.x;         output.position.y = tempVertex.y;         output.position.z = tempVertex.z;         output.position.w = output.position.w;         output.normal.x = tempNormal.x;         output.normal.y = tempNormal.y;         output.normal.z = tempNormal.z;     }     output.normal = mul(output.normal, (float3x3)worldMatrix);     output.position = mul(output.position, worldMatrix);     output.position = mul(output.position, viewMatrix); output.position = mul(output.position, projectionMatrix);     output.normal = normalize(output.normal); return output; }
  • 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!