Volumetric lighting in progress

--HG--
extra : convert_revision : svn%3A7752d6cf-9f14-4ad2-affc-04f1e67b81a5/trunk%40152
This commit is contained in:
kearwood
2012-11-09 09:18:38 +00:00
parent 19a6689245
commit 602425dd51
36 changed files with 886 additions and 211 deletions

View File

@@ -17,6 +17,7 @@
#import "KRInstance.h"
#import "KRParticleSystem.h"
#import "KRParticleSystemBrownian.h"
#import "KRVolumetricFog.h"
#import "KRAABB.h"
#import "KRQuaternion.h"
@@ -147,12 +148,22 @@ KRNode *KRNode::LoadXML(KRScene &scene, tinyxml2::XMLElement *e) {
new_node = new KRSpotLight(scene, szName);
} else if(strcmp(szElementName, "brownian_particles") == 0) {
new_node = new KRParticleSystemBrownian(scene, szName);
} else if(strcmp(szElementName, "volumetric_fog") == 0) {
float lod_min_coverage = 0.0f;
if(e->QueryFloatAttribute("lod_min_coverage", &lod_min_coverage) != tinyxml2::XML_SUCCESS) {
lod_min_coverage = 0.0f; //1.0f / 1024.0f / 768.0f; // FINDME - HACK - Need to dynamically select the absolute minimum based on the render buffer size
}
new_node = new KRVolumetricFog(scene, szName, szName, lod_min_coverage);
} else if(strcmp(szElementName, "mesh") == 0) {
float lod_min_coverage = 0.0f;
if(e->QueryFloatAttribute("lod_min_coverage", &lod_min_coverage) != tinyxml2::XML_SUCCESS) {
lod_min_coverage = 0.0f; //1.0f / 1024.0f / 768.0f; // FINDME - HACK - Need to dynamically select the absolute minimum based on the render buffer size
}
new_node = new KRInstance(scene, szName, szName, e->Attribute("light_map"), lod_min_coverage);
bool receives_shadow = true;
if(e->QueryBoolAttribute("receives_shadow", &receives_shadow) != tinyxml2::XML_SUCCESS) {
receives_shadow = true;
}
new_node = new KRInstance(scene, szName, szName, e->Attribute("light_map"), lod_min_coverage, receives_shadow);
}
if(new_node) {
@@ -164,7 +175,7 @@ KRNode *KRNode::LoadXML(KRScene &scene, tinyxml2::XMLElement *e) {
#if TARGET_OS_IPHONE
void KRNode::render(KRCamera *pCamera, KRContext *pContext, const KRViewport &viewport, KRVector3 &lightDirection, KRMat4 *pShadowMatrices, GLuint *shadowDepthTextures, int cShadowBuffers, RenderPass renderPass) {
void KRNode::render(KRCamera *pCamera, KRContext *pContext, const KRViewport &viewport, const KRViewport *pShadowViewports, KRVector3 &lightDirection, GLuint *shadowDepthTextures, int cShadowBuffers, RenderPass renderPass) {
}
#endif
@@ -211,3 +222,14 @@ const KRMat4 &KRNode::getModelMatrix()
}
return m_modelMatrix;
}
void KRNode::physicsUpdate(float deltaTime)
{
}
bool KRNode::hasPhysics()
{
return false;
}