> Warning: detected OpenGL error 'valeur non valide' after RenderBin::draw(,)

Fixed in the patch below. For some reason the shader didn't like index 16 being used...

The patch also fixes the chequer-board effect that was causing very sparse cloud cover.
This commit is contained in:
fredb
2008-11-24 20:26:12 +00:00
parent 27de1e271e
commit 8303e30033
2 changed files with 5 additions and 3 deletions

View File

@@ -42,12 +42,12 @@ class CloudShaderGeometry : public osg::Drawable
{
public:
const static unsigned int CLOUD_HEIGHT = 10;
const static unsigned int TEXTURE_INDEX_X = 11;
const static unsigned int TEXTURE_INDEX_Y = 12;
const static unsigned int WIDTH = 13;
const static unsigned int HEIGHT = 14;
const static unsigned int SHADE = 15;
const static unsigned int CLOUD_HEIGHT = 16;
CloudShaderGeometry()
{

View File

@@ -157,14 +157,16 @@ SGCloudField::SGCloudField() :
}
}
int leafs = QUADTREE_SIZE / BRANCH_SIZE;
for (int x = 0; x < QUADTREE_SIZE; x++) {
for (int y = 0; y < QUADTREE_SIZE; y++) {
field_group[x][y]= new osg::Switch;
field_group[x][y]->setName("3D cloud group");
// Work out where to put this node in the quad tree
int i = (int) (BRANCH_SIZE * ((float) x) / ((float) QUADTREE_SIZE));
int j = (int) (BRANCH_SIZE * ((float) y) / ((float) QUADTREE_SIZE));
int i = x / leafs;
int j = y / leafs;
quad[i][j]->addChild(field_group[x][y].get(), 0.0f, 20000.0f);
}
}