Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#Actualbelfegor

Posted 23 April 2013 - 08:15 AM

d3d9device->SetTexture(0, detailTex);
        d3d9device->SetTexture(1, terr1Tex);

        d3d9device->SetTextureStageState( 0, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2 );
        d3d9device->SetTextureStageState( 1, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2 );

        D3DXMATRIX detailTrans, tex1Trans;
        D3DXMatrixScaling(&detailTrans, 16.f, 16.f, 1.f);
        D3DXMatrixScaling(&tex1Trans, 1.f, 1.f, 1.f);
        d3d9device->SetTransform( D3DTS_TEXTURE0, &detailTrans );
        d3d9device->SetTransform( D3DTS_TEXTURE1, &tex1Trans );

        d3d9device->SetTextureStageState( 0, D3DTSS_TEXCOORDINDEX, 0 );
        d3d9device->SetTextureStageState( 1, D3DTSS_TEXCOORDINDEX, 0 );

        d3d9device->SetSamplerState( 0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR );
        d3d9device->SetSamplerState( 0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR );
        d3d9device->SetSamplerState( 0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR );
        d3d9device->SetSamplerState( 1, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR );
        d3d9device->SetSamplerState( 1, D3DSAMP_MINFILTER, D3DTEXF_LINEAR );
        d3d9device->SetSamplerState( 1, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR );

        d3d9device->SetTextureStageState( 0, D3DTSS_COLOROP,   D3DTOP_SELECTARG1 );
        d3d9device->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
        d3d9device->SetTextureStageState( 1, D3DTSS_COLOROP,   D3DTOP_MODULATE );
        d3d9device->SetTextureStageState( 1, D3DTSS_COLORARG1, D3DTA_TEXTURE );
        d3d9device->SetTextureStageState( 1, D3DTSS_COLORARG2, D3DTA_CURRENT );
        d3d9device->SetTextureStageState( 1, D3DTSS_ALPHAOP,   D3DTOP_DISABLE );
        d3d9device->SetTextureStageState( 2, D3DTSS_COLOROP,   D3DTOP_DISABLE );
        d3d9device->SetTextureStageState( 2, D3DTSS_ALPHAOP,   D3DTOP_DISABLE );

        TerrMesh->DrawSubset(0);

        d3d9device->SetTextureStageState( 0, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE );
        d3d9device->SetTextureStageState( 1, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE );

With detail:

trianglepick-2013-04-23-.png

 

Without:

trianglepick-2013-04-23-.png


#1belfegor

Posted 23 April 2013 - 08:10 AM

d3d9device->SetTexture(0, detailTex);
        d3d9device->SetTexture(1, terr1Tex);

        d3d9device->SetTextureStageState( 0, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2 );
        d3d9device->SetTextureStageState( 1, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2 );

        D3DXMATRIX detailTrans, tex1Trans;
        D3DXMatrixScaling(&detailTrans, 16.f, 16.f, 1.f);
        D3DXMatrixScaling(&tex1Trans, 1.f, 1.f, 1.f);
        d3d9device->SetTransform( D3DTS_TEXTURE0, &detailTrans );
        d3d9device->SetTransform( D3DTS_TEXTURE1, &tex1Trans );

        d3d9device->SetTextureStageState( 0, D3DTSS_TEXCOORDINDEX, 0 );
        d3d9device->SetTextureStageState( 1, D3DTSS_TEXCOORDINDEX, 0 );

        d3d9device->SetSamplerState( 0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR );
        d3d9device->SetSamplerState( 0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR );
        d3d9device->SetSamplerState( 0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR );
        d3d9device->SetSamplerState( 1, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR );
        d3d9device->SetSamplerState( 1, D3DSAMP_MINFILTER, D3DTEXF_LINEAR );
        d3d9device->SetSamplerState( 1, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR );

        d3d9device->SetTextureStageState( 0, D3DTSS_COLOROP,   D3DTOP_SELECTARG1 );
        d3d9device->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );
        d3d9device->SetTextureStageState( 1, D3DTSS_COLOROP,   D3DTOP_MODULATE );
        d3d9device->SetTextureStageState( 1, D3DTSS_COLORARG1, D3DTA_TEXTURE );
        d3d9device->SetTextureStageState( 1, D3DTSS_COLORARG2, D3DTA_CURRENT );
        d3d9device->SetTextureStageState( 1, D3DTSS_ALPHAOP,   D3DTOP_DISABLE );
        d3d9device->SetTextureStageState( 2, D3DTSS_COLOROP,   D3DTOP_DISABLE );
        d3d9device->SetTextureStageState( 2, D3DTSS_ALPHAOP,   D3DTOP_DISABLE );

        TerrMesh->DrawSubset(0);

        d3d9device->SetTextureStageState( 0, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE );
        d3d9device->SetTextureStageState( 1, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE );

PARTNERS