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

more...

microsoft ... graphics Profile…
 Up
DX10 tutor7 Texture question         


Author: gd
Date: Sep 17, 2008 06:30

i'm new in developing dx10.

in tutorial7 are about using texture to draw on the cube.
i tried to make my own code like the tutorial does. i create 2 cubes that
the first cube using texture, the second is not.
but the texture shown on the second one. whats the problem perhaps?

sorry my bad in english but thanks in advance :) .
5 Comments
Re: DX10 tutor7 Texture question         


Author: Anton Roth
Date: Sep 17, 2008 14:54

"gd" gawab.com> schrieb im Newsbeitrag
news:DD0779E6-3F5F-4F07-A873-D25273A85CBD@microsoft.com...
> i'm new in developing dx10.
>
> in tutorial7 are about using texture to draw on the cube.
> i tried to make my own code like the tutorial does. i create 2 cubes that
> the first cube using texture, the second is not.
> but the texture shown on the second one. whats the problem perhaps?
>
> sorry my bad in english but thanks in advance :) .

How did you render that second cube? Cause if you use the same code

g_pTechnique->GetDesc( &techDesc );
for( UINT p = 0; p < techDesc.Passes; ++p )
{
g_pTechnique->GetPassByIndex( p )->Apply( 0 );
g_pd3dDevice->DrawIndexed( 36, 0, 0 );
}
Show full article (1.06Kb)
no comments
Re: DX10 tutor7 Texture question         


Author: gd
Date: Sep 18, 2008 08:35

"Anton Roth" wrote in message
news:u6fjHARGJHA.3720@TK2MSFTNGP02.phx.gbl...
> "gd" gawab.com> schrieb im Newsbeitrag
> news:DD0779E6-3F5F-4F07-A873-D25273A85CBD@microsoft.com...
>> i'm new in developing dx10.
>>
>> in tutorial7 are about using texture to draw on the cube.
>> i tried to make my own code like the tutorial does. i create 2 cubes that
>> the first cube using texture, the second is not.
>> but the texture shown on the second one. whats the problem perhaps?
>>
>> sorry my bad in english but thanks in advance :) .
>
> How did you render that second cube? Cause if you use the same code
>
> g_pTechnique->GetDesc( &techDesc );
> for( UINT p = 0; p < techDesc.Passes; ++p )
> {
> g_pTechnique->GetPassByIndex( p )->Apply( 0 );
> g_pd3dDevice->DrawIndexed( 36, 0, 0 ); ...
Show full article (1.35Kb)
no comments
Re: DX10 tutor7 Texture question         


Author: Anton Roth
Date: Sep 18, 2008 15:59

>
> 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
Show full article (1.71Kb)
no comments
Re: DX10 tutor7 Texture question         


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() ) );
> } ...
Show full article (2.41Kb)
no comments
Re: DX10 tutor7 Texture question         


Author: Anton Roth
Date: Sep 19, 2008 01:53

> 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.
>

if you used my fx file and that code, yes, it would draw twice, but you'd
only see the second draw as there is no alpha component in it and you would
just draw over the already drawn cube.
Show full article (1.87Kb)
no comments

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