Jump to content

  • Log In with Google      Sign In   
  • Create Account


csdcsz

Member Since 23 May 2012
Offline Last Active Aug 23 2012 04:22 AM

Topics I've Started

Collada animation loading with DirectX

29 July 2012 - 03:40 AM

hi , everyone !
Now i have a problem with loading collada animation loading in DirectX! I have read the tutorial from thecansin.com
The tutorial is good and i run the animation application and it works ok!
But i use my .dae ( i convert it in maya) , it can't work! (but i seems ok in the assimpViewer) i wonder why?
Here is the app(include the sample .dae and my own .dae) .
I hope someone can help me. I have confused for so long!
Thanks for any reply!

how to play bg music and fx sound at the same time

03 June 2012 - 05:12 PM

Hi , everyone!
I have problem with xact audio. I want to play bg music and play sound effect at the same time.
Now i create a stream wave bank for the bg music , and create a in-memery wave bank for the sound effect, and create two soundbanks for each.
The problem is these two soundbanks point to the same block! I just do it like this:

...
...
audioEngine->CreateSoundBank( sbData1, fileSize, 0, 0, &pSoundBank1 ) ;

...
...
audioEngine->CreateSoundBank( sbData2 ,fileSize, 0, 0, &pSoundBank2) ;


i wonder if the audioEngine can hold multiple soundbanks, if can , how to play them at the same time?

Any words helps, thanks in advance!

light shader in different PC

24 May 2012 - 08:34 PM


Hi, i have problem with the light shader! It is strange and i don't know why. i wrote the light shader, and apply it to the obj mesh, and i run the app at different PC, there are some strange different results: the light keep shinning on and off; or the light become dark; and so on.

why the result of lighting at different pc is different? i really wonder to know!
thanks in advance!


my light shader: ( i use shadermodel 4.0 )


Texture2D colorMap : register( t0 );
SamplerState colorSampler : register( s0 );

cbuffer cbWVP : register( b0 )
{
row_major matrix WVP;
row_major matrix WorldMatrix;
};

struct VS_Input
{
float4 pos : POSITION;
float2 tex0 : TEXCOORD0;
float3 norm : NORMAL;
};

struct PS_Input
{
float4 pos : SV_POSITION;
float2 tex0 : TEXCOORD0;
float3 worldNorm : TEXCOORD1
float3 lightDir : TEXCOORD2;
};


PS_Input VS_Main( VS_Input vertex )
{
PS_Input vsOut = ( PS_Input )0;

float3 worldPos = mul( vertex.pos, WorldMatrix ).xyz;

vsOut.pos = mul(vertex.pos,WVP);

vsOut.tex0 = vertex.tex0;

vsOut.worldNorm = mul( vertex.norm, (float3x3)WorldMatrix );

float3 lightPos = float3(-0.7f,2.0f,2.5f);
vsOut.lightDir = lightPos - worldPos;


return vsOut;
}


float4 PS_Main( PS_Input frag ) : SV_TARGET
{


//texture color
float4 finalTexColor;
finalTexColor = colorMap.Sample(colorSampler,frag.tex0);



//light color
frag.lightDir = normalize(frag.lightDir );

float4 finalLightColor;
float3 ambientColor = float3(0.02f,0.02f,0.02f); //final ambient

float3 lightDiffuse = float3(0.85f,0.8f,0.8f);
float3 lightSpecular = float3(0.4f,0.4f,0.4f);
float SpecularPower = 1.0f;




float fSpecularCosine = saturate(dot(frag.lightDir,frag.worldNorm));
float3 diffuseColor = lightDiffuse * fSpecularCosine; // light final diffuse
float fSpecularLevel = pow(fSpecularCosine,SpecularPower);
float3 specularColor = lightSpecular * fSpecularLevel; // light final specular

finalLightColor.rgb = ambientColor + specularColor + diffuseColor;
finalLightColor.a = 1.0f;

//final color
float4 finalColor;
finalColor = finalTexColor * finalLightColor;

return finalColor;
}

directX 11 Debug output warning

23 May 2012 - 11:34 PM

Hi, I am beginning to learn directX 11. Now i have problem with the run-time debug output of the directX 11 app. here is the debug output warning:

D3D11: WARNING: Live Device: Name="Debug_D3D11Device", Addr=0x00676CD0, ExtRef=25 [ STATE_CREATION WARNING #2097297: LIVE_DEVICE ]
D3D11: WARNING: Live Texture2D: Name="unnamed", Addr=0x0342682C, ExtRef=0, IntRef=1 [ STATE_CREATION WARNING #2097235: LIVE_TEXTURE2D ]
D3D11: WARNING: Live Sampler: Name="unnamed", Addr=0x03424CA4, ExtRef=1, IntRef=0 [ STATE_CREATION WARNING #2097268: LIVE_SAMPLER ]
D3D11: WARNING: Live Buffer: Name="unnamed", Addr=0x03424ADC, ExtRef=1, IntRef=0 [ STATE_CREATION WARNING #2097229: LIVE_BUFFER ]
D3D11: WARNING: Live ShaderResourceView: Name="unnamed", Addr=0x03427A84, ExtRef=1, IntRef=0 [ STATE_CREATION WARNING #2097241: LIVE_SHADERRESOURCEVIEW ]
D3D11: WARNING: Live Texture2D: Name="unnamed", Addr=0x03424904, ExtRef=0, IntRef=1 [ STATE_CREATION WARNING #2097235: LIVE_TEXTURE2D ]
D3D11: WARNING: Live Buffer: Name="unnamed", Addr=0x03424614, ExtRef=1, IntRef=0 [ STATE_CREATION WARNING #2097229: LIVE_BUFFER ]
D3D11: WARNING: Live Buffer: Name="unnamed", Addr=0x03425524, ExtRef=1, IntRef=0 [ STATE_CREATION WARNING #2097229: LIVE_BUFFER ]
D3D11: WARNING: Live InputLayout: Name="unnamed", Addr=0x0342536C, ExtRef=1, IntRef=0 [ STATE_CREATION WARNING #2097265: LIVE_INPUTLAYOUT ]
D3D11: WARNING: Live PixelShader: Name="unnamed", Addr=0x0342514C, ExtRef=1, IntRef=0 [ STATE_CREATION WARNING #2097262: LIVE_PIXELSHADER ]
D3D11: WARNING: Live VertexShader: Name="unnamed", Addr=0x0341F6EC, ExtRef=1, IntRef=0 [ STATE_CREATION WARNING #2097250: LIVE_VERTEXSHADER ]
D3D11: WARNING: Live Buffer: Name="unnamed", Addr=0x03423FBC, ExtRef=1, IntRef=0 [ STATE_CREATION WARNING #2097229: LIVE_BUFFER ]
D3D11: WARNING: Live Buffer: Name="unnamed", Addr=0x03423A84, ExtRef=1, IntRef=0 [ STATE_CREATION WARNING #2097229: LIVE_BUFFER ]
D3D11: WARNING: Live Buffer: Name="unnamed", Addr=0x034238BC, ExtRef=1, IntRef=0 [ STATE_CREATION WARNING #2097229: LIVE_BUFFER ]
D3D11: WARNING: Live ShaderResourceView: Name="unnamed", Addr=0x03424464, ExtRef=1, IntRef=0 [ STATE_CREATION WARNING #2097241: LIVE_SHADERRESOURCEVIEW ]
D3D11: WARNING: Live Texture2D: Name="unnamed", Addr=0x0342991C, ExtRef=0, IntRef=1 [ STATE_CREATION WARNING #2097235: LIVE_TEXTURE2D ]
D3D11: WARNING: Live InputLayout: Name="unnamed", Addr=0x03423D6C, ExtRef=1, IntRef=0 [ STATE_CREATION WARNING #2097265: LIVE_INPUTLAYOUT ]
D3D11: WARNING: Live PixelShader: Name="unnamed", Addr=0x034264BC, ExtRef=1, IntRef=0 [ STATE_CREATION WARNING #2097262: LIVE_PIXELSHADER ]
D3D11: WARNING: Live VertexShader: Name="unnamed", Addr=0x034261DC, ExtRef=1, IntRef=0 [ STATE_CREATION WARNING #2097250: LIVE_VERTEXSHADER ]
D3D11: WARNING: Live Buffer: Name="Debug_Md5Mesh_CamPosCB", Addr=0x0342599C, ExtRef=1, IntRef=0 [ STATE_CREATION WARNING #2097229: LIVE_BUFFER ]
D3D11: WARNING: Live Buffer: Name="Debug_Md5Mesh_WorldCB", Addr=0x03412A84, ExtRef=1, IntRef=0 [ STATE_CREATION WARNING #2097229: LIVE_BUFFER ]
D3D11: WARNING: Live Buffer: Name="Debug_Md5Mesh_WVPCB", Addr=0x03412884, ExtRef=1, IntRef=0 [ STATE_CREATION WARNING #2097229: LIVE_BUFFER ]
D3D11: WARNING: Live Buffer: Name="unnamed", Addr=0x03412584, ExtRef=1, IntRef=0 [ STATE_CREATION WARNING #2097229: LIVE_BUFFER ]
D3D11: WARNING: Live Buffer: Name="unnamed", Addr=0x034123BC, ExtRef=1, IntRef=0 [ STATE_CREATION WARNING #2097229: LIVE_BUFFER ]
D3D11: WARNING: Live Buffer: Name="unnamed", Addr=0x034121F4, ExtRef=1, IntRef=0 [ STATE_CREATION WARNING #2097229: LIVE_BUFFER ]
D3D11: WARNING: Live Buffer: Name="unnamed", Addr=0x0341202C, ExtRef=1, IntRef=0 [ STATE_CREATION WARNING #2097229: LIVE_BUFFER ]
D3D11: WARNING: Live ShaderResourceView: Name="unnamed", Addr=0x03412DBC, ExtRef=1, IntRef=0 [ STATE_CREATION WARNING #2097241: LIVE_SHADERRESOURCEVIEW ]
D3D11: WARNING: Live Texture2D: Name="unnamed", Addr=0x034257C4, ExtRef=0, IntRef=1 [ STATE_CREATION WARNING #2097235: LIVE_TEXTURE2D ]
D3D11: WARNING: Live InputLayout: Name="Debug_Md5Mesh_VertexLayout", Addr=0x03429C0C, ExtRef=1, IntRef=0 [ STATE_CREATION WARNING #2097265: LIVE_INPUTLAYOUT ]
D3D11: WARNING: Live PixelShader: Name="Debug_Md5Mesh_PixelShader", Addr=0x0341EF44, ExtRef=1, IntRef=0 [ STATE_CREATION WARNING #2097262: LIVE_PIXELSHADER ]
D3D11: WARNING: Live VertexShader: Name="Debug_Md5Mesh_VertexShader", Addr=0x0341EC0C, ExtRef=1, IntRef=0 [ STATE_CREATION WARNING #2097250: LIVE_VERTEXSHADER ]
D3D11: WARNING: Live Buffer: Name="Debug_Font_VertexBuffer", Addr=0x0067F5C4, ExtRef=0, IntRef=0 [ STATE_CREATION WARNING #2097229: LIVE_BUFFER ]
D3D11: WARNING: Live ShaderResourceView: Name="Debug_Font_FontTex", Addr=0x0067F484, ExtRef=0, IntRef=0 [ STATE_CREATION WARNING #2097241: LIVE_SHADERRESOURCEVIEW ]
D3D11: WARNING: Live Texture2D: Name="unnamed", Addr=0x0067F2AC, ExtRef=0, IntRef=1 [ STATE_CREATION WARNING #2097235: LIVE_TEXTURE2D ]
D3D11: WARNING: Live InputLayout: Name="Debug_Font_VertexLayout", Addr=0x0338AB2C, ExtRef=0, IntRef=0 [ STATE_CREATION WARNING #2097265: LIVE_INPUTLAYOUT ]
D3D11: WARNING: Live PixelShader: Name="Debug_Font_PixelShader", Addr=0x0338A814, ExtRef=0, IntRef=0 [ STATE_CREATION WARNING #2097262: LIVE_PIXELSHADER ]
D3D11: WARNING: Live VertexShader: Name="Debug_Font_VertexShader", Addr=0x0067FC64, ExtRef=0, IntRef=0 [ STATE_CREATION WARNING #2097250: LIVE_VERTEXSHADER ]
D3D11: WARNING: Live RasterizerState: Name="Debug_RasterState", Addr=0x0338A5BC, ExtRef=0, IntRef=0 [ STATE_CREATION WARNING #2097277: LIVE_RASTERIZERSTATE ]
D3D11: WARNING: Live DepthStencilView: Name="Debug_DepthStencilView", Addr=0x0338928C, ExtRef=0, IntRef=0 [ STATE_CREATION WARNING #2097247: LIVE_DEPTHSTENCILVIEW ]
D3D11: WARNING: Live DepthStencilState: Name="Debug_DepthDisableStencilState", Addr=0x0067CD64, ExtRef=0, IntRef=0 [ STATE_CREATION WARNING #2097274: LIVE_DEPTHSTENCILSTATE ]
D3D11: WARNING: Live Texture2D: Name="Debug_DepthTexture", Addr=0x0067C8F4, ExtRef=0, IntRef=1 [ STATE_CREATION WARNING #2097235: LIVE_TEXTURE2D ]
D3D11: WARNING: Live RenderTargetView: Name="Debug_BackBufferTarget", Addr=0x0067C62C, ExtRef=0, IntRef=0 [ STATE_CREATION WARNING #2097244: LIVE_RENDERTARGETVIEW ]
D3D11: WARNING: Live Texture2D: Name="unnamed", Addr=0x0067C0A4, ExtRef=0, IntRef=1 [ STATE_CREATION WARNING #2097235: LIVE_TEXTURE2D ]
D3D11: WARNING: Live Query: Name="unnamed", Addr=0x00678FC4, ExtRef=0, IntRef=1 [ STATE_CREATION WARNING #2097280: LIVE_QUERY ]
D3D11: WARNING: Live Sampler: Name="unnamed", Addr=0x00678ECC, ExtRef=0, IntRef=1 [ STATE_CREATION WARNING #2097268: LIVE_SAMPLER ]
D3D11: WARNING: Live RasterizerState: Name="unnamed", Addr=0x00678DD4, ExtRef=0, IntRef=1 [ STATE_CREATION WARNING #2097277: LIVE_RASTERIZERSTATE ]
D3D11: WARNING: Live DepthStencilState: Name="Debug_DepthStencilState", Addr=0x00678CA4, ExtRef=0, IntRef=1 [ STATE_CREATION WARNING #2097274: LIVE_DEPTHSTENCILSTATE ]
D3D11: WARNING: Live BlendState: Name="unnamed", Addr=0x00678B14, ExtRef=0, IntRef=1 [ STATE_CREATION WARNING #2097271: LIVE_BLENDSTATE ]
D3D11: WARNING: Live Context: Name="Debug_D3D11Context", Addr=0x0338006C, ExtRef=4294967295, IntRef=1 [ STATE_CREATION WARNING #2097226: LIVE_CONTEXT ]
D3D11: WARNING: Live Device Child Summary: Device Addr=0x00676CD0
Using ID3D11Debug::ReportLiveDeviceObjects with D3D11_RLDO_DETAIL will help drill into object lifetimes. Objects with ExtRef=0 and IntRef=0 will be eventually destroyed through typical Immediate Context usage. However, if the application requires these objects to be destroyed sooner, ClearState followed by Flush on the Immediate Context will realize their destruction.
Live Context: 1
Live Buffer: 14
Live Texture1D: 0
Live Texture2D: 7
Live Texture3D: 0
Live ShaderResourceView: 4
Live RenderTargetView: 1
Live DepthStencilView: 1
Live VertexShader: 4
Live GeometryShader: 0
Live PixelShader: 4
Live InputLayout: 4
Live Sampler: 2
Live BlendState: 1
Live DepthStencilState: 2
Live RasterizerState: 2
Live Query: 1
Live Predicate: 0
Live Counter: 0
Live CommandList: 0
Live HullShader: 0
Live DomainShader: 0
Live ClassInstance: 0
Live ClassLinkage: 0
Live ComputeShader: 0
Live UnorderedAccessView: 0


Now, i want to clean these live object , how to do it ? Thanks in advance!

PARTNERS