Re: DX10 tutor7 Texture question
  Home FAQ Contact Sign in
microsoft.public.win32.programmer.directx.graphics only
 
Advanced search
POPULAR GROUPS

more...

 Up
Re: DX10 tutor7 Texture question         

Group: microsoft.public.win32.programmer.directx.graphics · Group Profile
Author: gd
Date: Sep 19, 2008 01:30

"Anton Roth" wrote in message
news:OW3%%23RJeGJHA.2580@TK2MSFTNGP05.phx.gbl...
>>
>> please see the .fx file code http://www.pastebin.us/m3c236b8b.
>> or there are something wrong in code placement. i.e. IASetVertexBuffer or
>> something..
>
> The .fx file is as it should be.
>
> You could change the code from
>
> technique10 RenderWithLight
> {
> pass P0
> {
> SetVertexShader ( CompileShader ( vs_4_0, VS() ) );
> SetGeometryShader ( NULL );
> SetPixelShader ( CompileShader ( ps_4_0,
> PSLight() ) );
> }
> }
> technique10 RenderWithLightandTexture
> {
> pass P0
> {
> SetVertexShader ( CompileShader ( vs_4_0, VS() ) );
> SetGeometryShader ( NULL );
> SetPixelShader ( CompileShader ( ps_4_0,
> PSLightAndTexture() ) );
>
> }
> }
>
>
> to
>
> technique10 Render
> {
> pass P0
> {
> SetVertexShader ( CompileShader ( vs_4_0, VS() ) );
> SetGeometryShader ( NULL );
> SetPixelShader ( CompileShader ( ps_4_0,
> PSLight() ) );
> }
>
> pass P1
> {
> SetVertexShader ( CompileShader ( vs_4_0, VS() ) );
> SetGeometryShader ( NULL );
> SetPixelShader ( CompileShader ( ps_4_0,
> PSLightAndTexture() ) );
>
> }
> }
>
> and then watch what code you use in the cpp file, but both works.
>
> If you use that effect file as linked that should work, you just have to
> watch that you use another technique handler, as the g_pTechnique in the
> tutorial07 (which is what you used) is linked to the technique "Render",
> or in your case most likely RenderWithLightAndTexture.
>
> Could you post the code of your Render() function, too?

i've solved it :D . yes, i did wrong in Render() code.
http://www.pastebin.us/d4d456d8a

so, do we should modify all g_pEffect before calling this code?

D3D10_TECHNIQUE_DESC techDesc;
g_pTechnique->GetDesc( &techDesc );
for( UINT p = 0; p < techDesc.Passes; ++p )
{
g_pTechnique->GetPassByIndex( p )->Apply(0);
g_pd3dDevice->DrawIndexed( 36, 0, 0 );
}

and also i have question, if i follow your .fx file code and call the code
above. will it draw twice? both of non-textured and textured. I wonder.
no comments
diggit! del.icio.us! reddit!

RELATED THREADS
SubjectArticles qty Group
Re: Challenge 13 - Textures - JoeB #2 - two texturescorel.PaintShopPro_Photography ·