Stuart :
> 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:
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user