huaner

Members
  • Content count

    57
  • Joined

  • Last visited

Community Reputation

100 Neutral

About huaner

  • Rank
    Member
  1. hi: i found the precipice of Warcraft III World Editor is very cool. but, i didn't think a good way to do it. then, i hope some people all to discuss how to do it. thanks.
  2. hi: i found a problem about the api of CreateStreamWaveBank. if the .xwb file is error, the reture value of CreateStreamWaveBank is ok,and the value of xactsoundbank is not null. but then if i used this xactsoundbank, there is an error of "Unhandled exception" At the same, if the .xwb file is error, i uesd api of CreateInMemoryWaveBank, the return value can tell me the error. so, how to know the stream .xwb file is error before i use xactsoundbank . i can't fall across "Unhandled exception". Thanks!
  3. hi: i found if i do it like this: LRESULT WINAPI MsgProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) { if( g_audioState.pEngine ) { CleanupXACT(); PrepareXACT(); } } win7 system, the memory will be rasied when the exe ran all time. i didn't why the memory can be rasied.i do "release" before create! thanks
  4. HI: i found if i shutdown and release pXACTEngine; and then create it XACT3CreateEngine( 0 /*| XACT_FLAG_API_DEBUG_MODE | XACT_FLAG_API_AUDITION_MODE*/, &m_pXACTEngine); and,initialize it. HRESULT hr = m_pXACTEngine->Initialize(&Params); the value of hr is not s_OK,and the error message is invalid_data.why? thanks!
  5. HI: I fallen across a problem that xact soundbank failed. My PC operation is win7.The operation process is: 1. I run my demo which is using xact engine to play some music. 2. During running the demo, i pull out my earplug, after some seconds, insert earplug. 3. then, I press Space key to play another music, the error is happend. the error message is n/a.the i try to use the xact3Engine api of GetRenderCount, the error message is invalid device. 4. i close my demo. and pull out my earplug. then start to run the same demo, there is no error message. After, insert earplug, but i can't listen any vocie. why? I found if i pull out my earplug, and then insert earplug. that xactengine can't connect audio device. It's like graphic device is lost, it need restore. I want to the xact is has some api to do this? or, need manual deal with. or some other good methods. thanks!
  6. HI: I fallen across a problem that xact soundbank failed. My PC operation is win7.The operation process is: 1. I run my demo which is using xact engine to play some music. 2. During running the demo, i pull out my earplug, after some seconds, insert earplug. 3. then, I press Space key to play another music, the error is happend. the error message is n/a.the i try to use the xact3Engine api of GetRenderCount, the error message is invalid device. 4. i close my demo. and pull out my earplug. then start to run the same demo, there is no error message. After, insert earplug, but i can't listen any vocie. why? I found if i pull out my earplug, and then insert earplug. that xactengine can't connect audio device. It's like graphic device is lost, it need restore. I want to the xact is has some api to do this? or, need manual deal with. or some other good methods. thanks!
  7. hi: i has falled cross two questions about xact. first, the process is no voice on some computer.so, It exsits some hardware compatibility problems when using xact? second, the volumn of cue become largen abruptly when the listener's position, top,front direction and cue's position not changed.why?what's reason can effect it? thanks!
  8. Hi: I met a problem is that xact DoWork failed.Because i can't debug the process,I want to know when dowok will be faild? thanks!
  9. hi: i found if i resize rendering window, the demo will be crashed at effect->end(). when i resize the window,i used OnResetDevice to reset my effect. but, there is unusefull. so, why? thanks a lot!
  10. hi: i came across a problem is: Quote: error X4509: invalid register semantic 'b0', or variable must be bound to multiple register banks (c register binding required) why happened this? thanks!
  11. hi: i use pixpiple render my secne.but, i found if i set gloabl ambient and diffuse of direction light to zero, i can see the vertex color of terrain. i thought this is black, but not.so i did't know if i set which rendrestade to result this. if i change it to shader, my vs light computation is: Quote: Out.color[0].rgb = gAmbient * matAmbient + In.color[0].rgb * gLightDiffuse * dot(normal, dir); Out.color[0].a = In.color[0].a; this is black.
  12. .fx fog && pixed piple fog

    Quote: // grab a handle to the parameter D3DXHANDLE enableFogHandle = fx->GetParameterByName("g_enableFog"); // to enable fog fx->SetBool(enableFogHandle, true); // to disable fog fx->SetBool(enableFogHandle, false); i just hava another question that confused. i just used SetValue as follow: bool fogenable = true; g_pEffect->SetValue("bEnableFog", &fogenable, sizeof(bool)); this also didn't work. why?
  13. .fx fog && pixed piple fog

    Quote: You can control all render states and sampler state settings with parameters (makes it easy to e.g. control texture filtering from the app). At first, thanks for your reply. i try this method befor, but failed. my pass is: Quote: pass P0 { Sampler[0] = (LayerMap0Sampler); Sampler[1] = (BlendMapSampler); vertexShader = compile vs_2_0 Terrain_MultiTexVS(); pixelShader = compile ps_2_0 Terrain_MultiTexPS1(); FogEnable = bEnableFog; FogStart = g_FogStart; FogEnd = g_FogEnd; FogColor = g_FogColor; } and transforming fog parameter by: Quote: //set fog start D3DXHANDLE FogStartHandle = g_pEffect->GetParameterByName(0, "g_FogStart"); g_pEffect->SetFloat(FogStartHandle, 300.0f); //set fog end D3DXHANDLE FogEndHandle = g_pEffect->GetParameterByName(0, "g_FogEnd"); g_pEffect->SetFloat(FogEndHandle, 3000.0f); //set fog color D3DXVECTOR4 colorfog = D3DXVECTOR4(1.0f, 1.0f, 1.0f, 1.0f); D3DXHANDLE FogColorHandle = g_pEffect->GetParameterByName(0, "g_FogColor"); g_pEffect->SetVector(FogColorHandle, &colorfog); it can't work:(
  14. .fx fog && pixed piple fog

    Quote:Original post by MJP Quote:Original post by huaner Quote:Original post by MJP When you call FogEffect->BeginPass(0), the ID3DXEffect interface calls IDirect3DDevice9::SetRenderState and sets the fog states according to what you have in the effect file. This means it will override the render states you're setting later, after you've drawn everything. You'll have to either... a) Set the render state after you call BeginPass and before you render your terrain. You'll also have to do it every frame, since every time you call BeginPass the effect will set things as they are in the technique b) Make 2 techniques, one with fog and one without. Then pick the technique you want based on user input. This, IMO, is more ideal than a). if i beginpass at first, will it override the render states later? i found if i disable the fog in the pass, later i enable it by SetRenderState, the somethings i draw out shader is effected by fog. ID3DXEffect will always set render states in BeginPass. If you're confused about the order in which things are occurring, go ahead and capture a frame in PIX and look at the order in which SetRenderState calls occur. thank your for your reply. i also confused that i enable the fog in pass 0; after endpass(0), i just use SetRenderState to enable fog, my intention just next rendering is effected by fog and not rendering by pass(0). the renderstate can be changed by different pass; so, i think, why i end a pass, its also effected by later? thanks a lot!
  15. hi: i want to do fog effect by vs. so i test the Semantics of fog. but i found if i use fog, creating the .fx file is failed. why? struct VS_OUTPUT { float4 pos : POSITION; float4 color[2] : COLOR0; float fog : FOG; float2 tex : TEXCOORD0; }; struct VS_INPUT { float3 pos : POSITION; float3 vNormal : NORMAL; float4 color[2] : COLOR0; float2 tex : TEXCOORD0; }; VS_OUTPUT Terrain_MultiTexVS(VS_INPUT In) { VS_OUTPUT Out; Out.pos = mul(float4(In.pos,1), matWVP); //计算坐标的位置 //将法线转换到世界坐标系下 float3 normal = normalize(mul(In.vNormal, (float3x3)matWorld)); Out.color[0] = In.color[0] * ( gAmbient + gLightDiffuse * max(0, dot(normalize(gLightDir), normal) ) ); Out.color[1] = In.color[1]; Out.fog = 1.0f; Out.tex = In.tex; return Out; } float4 Terrain_MultiTexPS0(VS_OUTPUT In) : COLOR0 { float4 rgba = tex2D(LayerMap0Sampler, In.tex) * In.color[0] * 4.0f; return lerp( g_FogColor, rgba, In.fog ); } technique Terrain_MultiTex { pass P0 { Sampler[0] = (LayerMap0Sampler); vertexShader = compile vs_2_0 Terrain_MultiTexVS(); pixelShader = compile ps_2_0 Terrain_MultiTexPS0(); } } and, i want to use diffuse and specular color; how can i transform fog variable to ps? thanks!