LightType did send too much data (wasn't causing troubles as the values got overwritten again)

Solid material shader should only have 1 texture coordinate.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@4949 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2014-09-29 23:42:39 +00:00
parent 1961023281
commit 36de8ea6a4
2 changed files with 8 additions and 8 deletions

View File

@ -6,7 +6,6 @@ attribute vec3 inVertexPosition;
attribute vec3 inVertexNormal;
attribute vec4 inVertexColor;
attribute vec2 inTexCoord0;
attribute vec2 inTexCoord1;
/* Uniforms */

View File

@ -140,13 +140,14 @@ void COGLES2MaterialBaseCB::OnSetConstants(IMaterialRendererServices* services,
LightSpecular[i] = CurrentLight.SpecularColor;
}
services->setPixelShaderConstant(LightTypeID, reinterpret_cast<f32*>(LightType), 24);
services->setPixelShaderConstant(LightPositionID, reinterpret_cast<f32*>(LightPosition), 24);
services->setPixelShaderConstant(LightDirectionID, reinterpret_cast<f32*>(LightDirection), 24);
services->setPixelShaderConstant(LightAttenuationID, reinterpret_cast<f32*>(LightAttenuation), 24);
services->setPixelShaderConstant(LightAmbientID, reinterpret_cast<f32*>(LightAmbient), 32);
services->setPixelShaderConstant(LightDiffuseID, reinterpret_cast<f32*>(LightDiffuse), 32);
services->setPixelShaderConstant(LightSpecularID, reinterpret_cast<f32*>(LightSpecular), 32);
const int MAX_SHADER_LIGHTS = 8; // must be the same as MAX_LIGHTS define in the shader
services->setPixelShaderConstant(LightTypeID, LightType, MAX_SHADER_LIGHTS);
services->setPixelShaderConstant(LightPositionID, reinterpret_cast<f32*>(LightPosition), 3*MAX_SHADER_LIGHTS);
services->setPixelShaderConstant(LightDirectionID, reinterpret_cast<f32*>(LightDirection), 3*MAX_SHADER_LIGHTS);
services->setPixelShaderConstant(LightAttenuationID, reinterpret_cast<f32*>(LightAttenuation), 3*MAX_SHADER_LIGHTS);
services->setPixelShaderConstant(LightAmbientID, reinterpret_cast<f32*>(LightAmbient), 4*MAX_SHADER_LIGHTS);
services->setPixelShaderConstant(LightDiffuseID, reinterpret_cast<f32*>(LightDiffuse), 4*MAX_SHADER_LIGHTS);
services->setPixelShaderConstant(LightSpecularID, reinterpret_cast<f32*>(LightSpecular), 4*MAX_SHADER_LIGHTS);
}
services->setPixelShaderConstant(FogEnableID, &FogEnable, 1);