Reversed recent shader changes that broke specular

Implementation of deferred rendering in progress

--HG--
extra : convert_revision : svn%3A7752d6cf-9f14-4ad2-affc-04f1e67b81a5/trunk%4030
This commit is contained in:
kearwood
2012-04-06 01:07:23 +00:00
parent 33c5b754de
commit aadc5c840c
3 changed files with 18 additions and 2 deletions

View File

@@ -555,6 +555,20 @@ void LoadMesh(std::vector<KRResource *> &resources, KFbxGeometryConverter *pGeom
void LoadLight(std::vector<KRResource *> &resources, KFbxNode* pNode) {
KFbxLight* pLight = (KFbxLight*) pNode->GetNodeAttribute();
const char *szName = pNode->GetName();
fbxDouble3 light_color = pLight->Color.Get();
fbxDouble1 light_intensity = pLight->Intensity.Get();
fbxDouble1 light_hotspot = pLight->HotSpot.Get(); // light inner cone angle (in degrees). Also know as the HotSpot
fbxDouble1 light_coneangle = pLight->ConeAngle.Get(); // light outer cone angle (in degrees). Also known as the Falloff
KFbxLight::EDecayType light_decaytype = pLight->DecayType.Get(); // decay type
fbxDouble1 light_decaystart = pLight->DecayStart.Get(); // decay start distance
// KFbxLight::eNONE - does not attenuate with distance
// KFbxLight::eLINEAR - attenuation of 1/d
// KFbxLight::eQUADRATIC - attenuation of 1/d^2
// KFbxLight::eCUBIC - attenuation of
switch(pLight->LightType.Get()) {
case KFbxLight::ePOINT:
resources.push_back(new KRPointLight(szName));

View File

@@ -109,9 +109,9 @@ void main()
#if ENABLE_PER_PIXEL == 1
mediump float lamberFactor = max(0.0,dot(lightVec, normal));
mediump float specularFactor = 0.0;
//if(material_shininess > 0.0) {
if(material_shininess > 0.0) {
specularFactor = max(0.0,pow(dot(halfVec,normal), material_shininess));
//}
}
#endif
#if HAS_DIFFUSE_MAP == 1

View File

@@ -128,6 +128,8 @@
//m_scene.addInstance(pModelManager->getModel("ballroom"), KRMat4());
//m_scene.addInstance(pModelManager->getModel("HoganCombined"), KRMat4());
//m_scene.addInstance(pModelManager->getModel("polySurface12848"), KRMat4(), "PillarLightmap2k");
//m_scene.addInstance(pModelManager->getModel("Wall2"), KRMat4(), "Wall2_lightmap");
std::map<std::string, KRModel *> models = pModelManager->getModels();
for(std::map<std::string, KRModel *>::iterator itr=models.begin(); itr != models.end(); itr++) {
std::string lightmap = (*itr).first;