   d3d - opengl
  hello,anyone knows how to write these d3d stage ops in opengl, please?pDev->SetRenderState(D3DRS_SPECULARENABLE,FALSE);pDev->SetTextureStageState(0,D3DTSS_COLORARG1,D3DTA_TFACTOR);pDev->SetTextureStageState(0,D3DTSS_COLOROP,D3DTOP_SELECTARG1);pDev->SetTextureStageState( 1, D3DTSS_COLOROP, D3DTOP_DISABLE );pDev->SetRenderState(D3DRS_TEXTUREFACTOR,D3DXCOLOR(m_Color));pDev->SetRenderState(D3DRS_ZFUNC,D3DCMP_LESS);pDev->SetRenderState(D3DRS_ALPHABLENDENABLE,FALSE);pDev->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_ZERO);pDev->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_ONE);thank you very much. Is it possible to do it on fixed pipeline?   
  Requires GL 1.2I think your D3D code is doing texture * colorglActiveTexture(GL_TEXTURE0);glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);//The colorglColor4ubv((ubyte *)&m_Color);glDepthFunc(GL_LESS); //I recommend GL_LEQUAL, alwaysglDisable(GL_BLEND);glBlendFunc(GL_ONE, GL_ZERO);  //source and destor even betterglActiveTexture(GL_TEXTURE0);glEnable(GL_TEXTURE_2D);glBindTexture(GL_TEXTURE_2D, textureID);glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);//The colorglColor4ubv((ubyte *)&m_Color);glDepthFunc(GL_LESS); //I recommend GL_LEQUAL, alwaysglDisable(GL_BLEND);;  are you sure?It was taken from:void C3DLight::Render( C3DRenderer &inRenderer ){   const int _ARROW_CY_SIDES=32;   const int _POINT_CY_SIDES=4;   IDirect3DDevice8 *pDev=inRenderer.GetDirectXDevice();  assert(pDev);   pDev->SetRenderState(D3DRS_CULLMODE,D3DCULL_NONE);   pDev->SetPixelShader(0);   pDev->SetTexture(0,0);   pDev->SetTexture(1,0);   pDev->SetTexture(3,0);   pDev->SetRenderState(D3DRS_SPECULARENABLE,FALSE);   pDev->SetTextureStageState(0,D3DTSS_COLORARG1,D3DTA_TFACTOR);   pDev->SetTextureStageState(0,D3DTSS_COLOROP,D3DTOP_SELECTARG1);   pDev->SetTextureStageState( 1, D3DTSS_COLOROP, D3DTOP_DISABLE );   pDev->SetRenderState(D3DRS_TEXTUREFACTOR,D3DXCOLOR(m_Color));   pDev->SetRenderState(D3DRS_ZFUNC,D3DCMP_LESS);   pDev->SetRenderState(D3DRS_ALPHABLENDENABLE,FALSE);   pDev->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_ZERO);   pDev->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_ONE);   POLYBUMPVERTEX array[_ARROW_CY_SIDES*2+2];   pDev->SetVertexShader(inRenderer.m_ShaderManager.m_dwVS_Standard);   D3DXVECTOR3 vTo;   D3DXVECTOR3 vFrom;   D3DXVECTOR3 vDir=GetTo()-GetFrom();   float fLength=D3DXVec3Length(&(GetFrom()-GetTo()));   if(inRenderer.GetForceDirLight())  // directional light   { // Arrow consists of 3 Cones vFrom=GetFrom()-vDir*0.5f; vTo=GetFrom()-vDir*0.51f; Build3DCone(array,_ARROW_CY_SIDES,fLength*0.03f,0,vFrom,vTo); pDev->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,_ARROW_CY_SIDES*2,array,sizeof(POLYBUMPVERTEX)); vFrom=GetFrom()-vDir*0.3f; vTo=GetFrom()-vDir*0.5f; Build3DCone(array,_ARROW_CY_SIDES,fLength*0.03f,fLength*0.03f,vFrom,vTo); pDev->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,_ARROW_CY_SIDES*2,array,sizeof(POLYBUMPVERTEX)); vFrom=GetFrom()-vDir*0.3f; vTo=GetFrom()-vDir*0.1f; Build3DCone(array,_ARROW_CY_SIDES,fLength*0.05f,0.0f,vFrom,vTo); pDev->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,_ARROW_CY_SIDES*2,array,sizeof(POLYBUMPVERTEX));   }   else   { vFrom=GetFrom()-vDir*0.03f; vTo=GetFrom(); Build3DCone(array,_POINT_CY_SIDES,0,fLength*0.03f,vFrom,vTo); pDev->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,_POINT_CY_SIDES*2,array,sizeof(POLYBUMPVERTEX)); vFrom=GetFrom(); vTo=GetFrom()+vDir*0.03f; Build3DCone(array,_POINT_CY_SIDES,fLength*0.03f,0,vFrom,vTo); pDev->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP,_POINT_CY_SIDES*2,array,sizeof(POLYBUMPVERTEX));   }}i see disabling texture stages only.Code fragment is from: http://www.crytek.com/fileadmin/user_upload/downloads/shaderx4/TangentSpaceCalculation_ShaderX4.zip;  Yes, it looks like it is disabling texturing with those SetTexture calls.What exactly do you want to achieve?   ;Quote:Original post by V-manYes, it looks like it is disabling texturing with those SetTexture calls.What exactly do you want to achieve?simulate simple lighting - i'd like to simply iluminate scene geometry.;  Ok, but there are plenty of examples on the web. just google opengl+ tutorialYou aren't forced to find Direct3D code and convert to GL.   ;  Ditch the fixed function pipeline. Here is (almost) all you ever wanted to know about OpenGL lighting, especially this and this. Ok it doesn't deal with deferred shading or other advanced techniques but chances are you ain't there yet.   ;lightbringer> i know how to write glsl - i'm not opengl beginner as you think. i didn't ask for deferred shading or similar technique, i just wanted know how posted code fragment works (coz i don't know d3d).V-man> so, you simply don't know. It's only example uses this simple lighting technique which i found.