More tweaks to GLES legacy pipeline

This commit is contained in:
Deve 2017-03-02 22:19:10 +01:00
parent 067518df5d
commit 11024569b0
2 changed files with 8 additions and 1 deletions

View File

@ -108,7 +108,7 @@ void main ()
else if(uMaterialType == Solid2Layer)
gl_FragColor = render2LayerSolid();
else if(uMaterialType == LightMap)
gl_FragColor = renderLightMap();
gl_FragColor = renderSolid();
else if(uMaterialType == DetailMap)
gl_FragColor = renderDetailMap();
else if(uMaterialType == SphereMap)

View File

@ -92,6 +92,7 @@ bool COGLES2FixedPipelineRenderer::OnRender(IMaterialRendererServices* service,
Driver->setTextureRenderStates(Driver->getCurrentMaterial(), false);
s32 materialType = 0;
bool second_texture = false;
switch(Driver->getCurrentMaterial().MaterialType)
{
@ -102,10 +103,13 @@ bool COGLES2FixedPipelineRenderer::OnRender(IMaterialRendererServices* service,
case EMT_LIGHTMAP_ADD:
case EMT_LIGHTMAP_M2:
case EMT_LIGHTMAP_M4:
materialType = 2;
break;
case EMT_LIGHTMAP_LIGHTING:
case EMT_LIGHTMAP_LIGHTING_M2:
case EMT_LIGHTMAP_LIGHTING_M4:
materialType = 2;
second_texture = true;
break;
case EMT_DETAIL_MAP:
materialType = 3;
@ -160,6 +164,9 @@ bool COGLES2FixedPipelineRenderer::OnRender(IMaterialRendererServices* service,
s32 TextureUnit0 = 0;
//s32 TextureUnit1 = 1;
if (second_texture)
TextureUnit0 = 1;
IMaterialRendererServices::setPixelShaderConstant("uTextureUnit0", &TextureUnit0, 1);
//IMaterialRendererServices::setPixelShaderConstant("uTextureUnit1", &TextureUnit1, 1);