From 4013e9143fb4a355e873faea80e0941e15bd8c38 Mon Sep 17 00:00:00 2001 From: David Williams Date: Wed, 16 Jan 2008 20:21:47 +0000 Subject: [PATCH] Debugging materials... --- ...as.material => TextureAtlasMulti.material} | 7 +++-- .../scripts/TextureAtlasSingle.material | 28 +++++++++++++++++++ source/PolyVoxSceneManager.cpp | 5 +++- 3 files changed, 36 insertions(+), 4 deletions(-) rename media/materials/scripts/{TextureAtlas.material => TextureAtlasMulti.material} (86%) create mode 100644 media/materials/scripts/TextureAtlasSingle.material diff --git a/media/materials/scripts/TextureAtlas.material b/media/materials/scripts/TextureAtlasMulti.material similarity index 86% rename from media/materials/scripts/TextureAtlas.material rename to media/materials/scripts/TextureAtlasMulti.material index ba7a8d6e..59c63ae2 100644 --- a/media/materials/scripts/TextureAtlas.material +++ b/media/materials/scripts/TextureAtlasMulti.material @@ -1,4 +1,4 @@ -material TextureAtlasMaterial +material TextureAtlasMultiMaterial { technique { @@ -6,6 +6,8 @@ material TextureAtlasMaterial { ambient 0.0 0.0 0.0 diffuse 0.0 0.0 0.0 + + depth_bias -5 -5 } pass @@ -28,9 +30,8 @@ material TextureAtlasMaterial { texture texture_atlas.png filtering none - } + } - depth_bias 1 1 scene_blend add } } diff --git a/media/materials/scripts/TextureAtlasSingle.material b/media/materials/scripts/TextureAtlasSingle.material new file mode 100644 index 00000000..164a6bc3 --- /dev/null +++ b/media/materials/scripts/TextureAtlasSingle.material @@ -0,0 +1,28 @@ +material TextureAtlasSingleMaterial +{ + technique + { + pass + { + vertex_program_ref TextureAtlasOneLightVertexProgram + { + param_named_auto world world_matrix + param_named_auto viewProj viewproj_matrix + param_named_auto ambient ambient_light_colour + param_named_auto light0.position light_position 0 + param_named_auto light0.diffuseColour light_diffuse_colour 0 + param_named_auto light0.attenuation light_attenuation 0 + } + + fragment_program_ref TextureAtlasFragmentProgram + { + } + + texture_unit + { + texture texture_atlas.png + filtering none + } + } + } +} diff --git a/source/PolyVoxSceneManager.cpp b/source/PolyVoxSceneManager.cpp index 0ea0bb52..b2cd1408 100644 --- a/source/PolyVoxSceneManager.cpp +++ b/source/PolyVoxSceneManager.cpp @@ -181,7 +181,10 @@ namespace Ogre { //We have to create the surfaces singleMaterialSurfacePatchRenderable = new SurfacePatchRenderable(singleMaterialPatch,materialMap->getMaterialAtIndex(1)); - multiMaterialSurfacePatchRenderable = new SurfacePatchRenderable(multiMaterialPatch,materialMap->getMaterialAtIndex(1)); + multiMaterialSurfacePatchRenderable = new SurfacePatchRenderable(multiMaterialPatch,materialMap->getMaterialAtIndex(2)); + + multiMaterialSurfacePatchRenderable->setRenderQueueGroup(RenderQueueGroupID::RENDER_QUEUE_3); + singleMaterialSurfacePatchRenderable->setRenderQueueGroup(RenderQueueGroupID::RENDER_QUEUE_4); m_singleMaterialSurfaces[regionX][regionY][regionZ] = singleMaterialSurfacePatchRenderable; sceneNode->attachObject(singleMaterialSurfacePatchRenderable);