SetTextureStageState

okies… Hi, OPGNL guru(s)

What is the equivalent function for m_pd3dDevice->SetTextureStageState?

and also equivalent glenum(s) for D3DTSS_COLORARG1,D3DTSS_COLORARG2,D3DTSS_COLOROP,D3DTA_DIFFUSE?

The equivalent is a string of calls from the ancient register-combiners interface… yuck. Look at the glTexParameteri()

not glTexEnvf???

yeah, that too. And other stuff that only tortures an implementation to do what you should do from the beginning: make shaders.

pDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_BLENDTEXTUREALPHA );

pDevice->SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_TEXTURE );

pDevice->SetTextureStageState( 0, D3DTSS_COLORARG2, D3DTA_DIFFUSE );

PLEASE … SOMEBODY HELP ME…
How to write those in OPENGL???

It is too easy for you guys…
Please answer!!!..

Its a lot easier to do those sort texture states in a shader,
Similiar under DX9 the SetTextureStageState interface is much simpler realized in a shader than through API calls, thats why you dont see that sort of API interface under DX10, its pain in the ass to work with if not realized in shaders/effects.

The amount of time spending on decoding API documentation just aint worth the effort when thou can express virtually anything you want regarding blend operations in shaders. So get up to speed is my advice :wink:

I beleive that all you need is
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);

which would do texture * primary_color where primary color comes from glColor if lighting is off.
If on, then it comes from the lighting calculation.