WS30: Pass material parameter/edge-hardness to shader
This commit is contained in:
@@ -397,7 +397,7 @@ SGMaterialCache::Atlas SGMaterialLib::getMaterialTextureAtlas(SGVec2f center, co
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
atlas.dimensions->setElement(materialLookupIndex, osg::Vec4f(mat->get_xsize(), mat->get_ysize(), mat->get_shininess(), 1.0f));
|
atlas.dimensions->setElement(materialLookupIndex, osg::Vec4f(mat->get_xsize(), mat->get_ysize(), mat->get_shininess(), mat->get_parameter("edge-hardness")));
|
||||||
atlas.ambient->setElement(materialLookupIndex, mat->get_ambient());
|
atlas.ambient->setElement(materialLookupIndex, mat->get_ambient());
|
||||||
atlas.diffuse->setElement(materialLookupIndex, mat->get_diffuse());
|
atlas.diffuse->setElement(materialLookupIndex, mat->get_diffuse());
|
||||||
atlas.specular->setElement(materialLookupIndex, mat->get_specular());
|
atlas.specular->setElement(materialLookupIndex, mat->get_specular());
|
||||||
|
|||||||
@@ -1438,6 +1438,12 @@ void VPBTechnique::applyMaterials(BufferData& buffer, Locator* masterLocator)
|
|||||||
const osg::Array* vertices = buffer._landGeometry->getVertexArray();
|
const osg::Array* vertices = buffer._landGeometry->getVertexArray();
|
||||||
const osg::Array* texture_coords = buffer._landGeometry->getTexCoordArray(0);
|
const osg::Array* texture_coords = buffer._landGeometry->getTexCoordArray(0);
|
||||||
osgTerrain::Layer* colorLayer = _terrainTile->getColorLayer(0);
|
osgTerrain::Layer* colorLayer = _terrainTile->getColorLayer(0);
|
||||||
|
|
||||||
|
if (!colorLayer) {
|
||||||
|
SG_LOG(SG_TERRAIN, SG_ALERT, "No landclass image for " << _terrainTile->getTileID().x << " " << _terrainTile->getTileID().y << " " << _terrainTile->getTileID().level);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
osg::Image* image = colorLayer->getImage();
|
osg::Image* image = colorLayer->getImage();
|
||||||
|
|
||||||
if (!image || ! image->valid()) {
|
if (!image || ! image->valid()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user