locked
Cubemap update problem on Surface Tablet.

    Question

  • I port the Elements Defender into the Windows Store apps with d3d11 recently.

    I implement a dynamic light map with cubemap in game. Every actor get a cubemap for the realtime environment light.  The cubemaps update frequently in game logic. 

    It's running correctly on my pc( dx feature level 11.1 ), and get problem on the Surface Tablet( tegra3, dx feature level 9.1 ).

    It's correct on Surface when i update one cubemap in a frame. When I update more than one cubemap in a frame, the cubemap map sampling get into chaos.

    I create the cubemap textures with D3D11_USAGE_DEFAULT flag, use UpdateSubresource to update texture data, because it will occur d3d error if I use D3D11_USAGE_DYNAMIC. 

    And there is no dx warning or error output for the problem when i enable the dx debug in the game. 

    Is anyone can help me or can tell me is it possible to update multi cubemap in a frame on Surface Tablet?

    Thanks. 


    Saturday, December 8, 2012 9:33 AM

Answers

  • I doubt the problem has anything to do with your shader.

    You should use the VS 2012 Graphics Debugger and try to go step-by-step to see where your update cycle is failing on FL 9.1.

    Have you made sure your program works correctly on a x86 or x64 system using FL 9.1?

    Are you sure the SDK Debug Layer is properly activated on the Surface when doing remote debugging?

    Make sure you are fitting the limits of resources for FL 9.1 when doing this operation (although if you were violating these I would have expected an error a SDK Debug Layer warning).

    • Marked as answer by vincentely Wednesday, December 12, 2012 11:18 AM
    Tuesday, December 11, 2012 7:44 PM

All replies

  • Are you rendering the cubemap using multiple render targets, or just doing one render to texture per face per cubemap?
    Monday, December 10, 2012 7:40 PM
  • The cubemap is not a render target. I update the cubemap from cpu memory with "UpdateSubresource" before draw actor. 

    Firstly I update one face every frame for the performences, and I update six face later. The error remains.

    "pixel shader use the cubemap":

    Texture2D diffuseMap;
    TextureCube lightMap;

    SamplerState samplerLinear {
    Filter = MIN_MAG_MIP_LINEAR;
    }

    float3 vTexRange1;
    float4 vColorState;

    float4 main(float4 v_"Apple-tab-span" style="white-space:pre;">float4 diffuseColor = diffuseMap.Sample(samplerLinear, v_texcoord0);

    float4 lightColor = lightMap.Sample(samplerLinear, v_texcoord1);

    lightColor.rgb = lightColor.rgb * vTexRange1;

    return diffuseColor * lightColor * vColorState;
    }

    Tuesday, December 11, 2012 2:25 AM
  • I doubt the problem has anything to do with your shader.

    You should use the VS 2012 Graphics Debugger and try to go step-by-step to see where your update cycle is failing on FL 9.1.

    Have you made sure your program works correctly on a x86 or x64 system using FL 9.1?

    Are you sure the SDK Debug Layer is properly activated on the Surface when doing remote debugging?

    Make sure you are fitting the limits of resources for FL 9.1 when doing this operation (although if you were violating these I would have expected an error a SDK Debug Layer warning).

    • Marked as answer by vincentely Wednesday, December 12, 2012 11:18 AM
    Tuesday, December 11, 2012 7:44 PM
  • I doubt the problem has anything to do with your shader.

    You should use the VS 2012 Graphics Debugger and try to go step-by-step to see where your update cycle is failing on FL 9.1.

    Have you made sure your program works correctly on a x86 or x64 system using FL 9.1?

    Are you sure the SDK Debug Layer is properly activated on the Surface when doing remote debugging?

    Make sure you are fitting the limits of resources for FL 9.1 when doing this operation (although if you were violating these I would have expected an error a SDK Debug Layer warning).

    ^^

    Thank you for your reply, I resolve the problem now.

    I malloc six face memory in cpu for each cubemap,  update one face in cpu and update six faces to GPU( use UpdateSubresource ) every frame.

    On opengl or gles I can update one face to GPU everyframe, also in the d3d FL 11. Maybe the driver implements are different.

    The above shader string get some error when I copy form txt file( maybe is't modified on my Mac ).  No warning or error when I compile & use the shader.

    • Edited by vincentely Wednesday, December 12, 2012 11:18 AM
    Wednesday, December 12, 2012 11:18 AM