Jump to content


Texture coordinate


2 replies to this topic

#1 idreamlovey

    Member

  • Members
  • PipPip
  • 91 posts

Posted 24 July 2007 - 03:56 PM

I am using 3 stages of textures for terrain rendering(splatting). And i want to do multitexturing stuff only for near distant not for far distant to improve the frame rate. In order to that Can i simply turn off the stage like as follows for far distant:-

pd3dDevice->SetTexture(1,NULL);
pd3dDevice->SetTextureStageState( 1, D3DTSS_COLOROP, D3DTOP_DISABLE );
pd3dDevice->SetTextureStageState( 1, D3DTSS_ALPHAOP, D3DTOP_DISABLE );

pd3dDevice->SetTexture(2,NULL);
pd3dDevice->SetTextureStageState( 2, D3DTSS_COLOROP, D3DTOP_DISABLE );
pd3dDevice->SetTextureStageState( 2, D3DTSS_ALPHAOP, D3DTOP_DISABLE );

Is this a good practice or i have to render the far distant with one texture stage with different vertex buffer and near distant with 3 texture stages with different vertex buffer. I have only one large static Vertex buffer with three texture stages. And i am using Dynamic Index Buffer.

#2 Reedbeta

    DevMaster Staff

  • Administrators
  • 4782 posts
  • LocationBellevue, WA

Posted 24 July 2007 - 04:25 PM

You will have to make two separate draw calls. It doesn't matter very much if you are drawing different parts of the same vertex buffer, or from two separate vertex buffers.
reedbeta.com - developer blog, OpenGL demos, and other projects

#3 idreamlovey

    Member

  • Members
  • PipPip
  • 91 posts

Posted 24 July 2007 - 05:40 PM

Allright then i am going to render the near distant faces (multitexturing in single pass )in one draw call and distant faces (with no multitexturing ) with another simple draw call by disabling the Stage states as i have given in my previous post. And no need to make different vertex buffers...
It seems i have to do in floowing manner:-

1.Set Vertex Buffer
2.Set Indices for Near Distant faces.
3.Set render states and Draw them.(Multitexturing in single Pass)
4.Set Indices for distant faces.
5 Set render states and Draw them..(Without multitexturing with one texture)

Note that my VERTEX format is
D3DVERTEX
{
D3DVECTOR3 p;
D3DVECTOR3 n;
FLOAT tu ,tv;
FLOAT tu1 ,tv1;
FLOAT tu2 ,tv2;
}
const DWORD D3DVERTEX_2T_FVF = D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_TEX3;





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users