[solved] Some sort of clipping problem.
[solved] Some sort of clipping problem.
(Edit: see my last post on this thread, on page 2, for a solution.)
I am using the svn as of a few weeks ago.
I'm experiencing incorrect clipping... (possibly an Irrlicht memory buffer overflow?)
http://img401.imageshack.us/i/screensho ... 19291.png/
The blue cyan background is the "sea"... it's a 2-triangle polygon. Its z-buffering is set to on.
Each distinct area is made up of a lot of different triangles. Under almost each "flag" (the square white thing) are models of forts. Under certain viewing angles, various areas start disappearing, like Britain and a bit of northern Europe, in this case.
The problem disappears if I remove the model.
Edit: I managed to make the problem go away, but I think it's a memory overflow issue.. I did use gdb and didn't get any hits with it.
What I have done is this: I exploded two rectangles (rectangles that have textures) in my modeling program (Sketchup 7) and re-exported.
It's very odd. I have this exact same texture setup for those textures in some other models... leaning towards a memory overflow somewhere.
I am using the svn as of a few weeks ago.
I'm experiencing incorrect clipping... (possibly an Irrlicht memory buffer overflow?)
http://img401.imageshack.us/i/screensho ... 19291.png/
The blue cyan background is the "sea"... it's a 2-triangle polygon. Its z-buffering is set to on.
Each distinct area is made up of a lot of different triangles. Under almost each "flag" (the square white thing) are models of forts. Under certain viewing angles, various areas start disappearing, like Britain and a bit of northern Europe, in this case.
The problem disappears if I remove the model.
Edit: I managed to make the problem go away, but I think it's a memory overflow issue.. I did use gdb and didn't get any hits with it.
What I have done is this: I exploded two rectangles (rectangles that have textures) in my modeling program (Sketchup 7) and re-exported.
It's very odd. I have this exact same texture setup for those textures in some other models... leaning towards a memory overflow somewhere.
Last edited by agamemnus on Thu Jan 27, 2011 7:32 pm, edited 1 time in total.
No one can help you until you give people some way to reproduce the problem... which means reduce the problem to a minimal code example + post models necessary to reproduce it.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
But I can't do that because I'm coding in Freebasic and I have tens of thousands of lines of interconnected code... :\ It would take absolutely forever to distill the various parts of code and make a C++ example.
Here is something similar:
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=40378
Except... I checked the bounding boxes and they are all fine.
All I can say is that it's some sort of "bounding box" problem when objects without a zbuffer are in the scene; perhaps the bounding boxes are internally corrupted -- they show up fine via a bounding box visual test. Both some objects with and without a zbuffer are affected, but again, only when I have objects without a zbuffer.
Here is something similar:
http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=40378
Except... I checked the bounding boxes and they are all fine.
All I can say is that it's some sort of "bounding box" problem when objects without a zbuffer are in the scene; perhaps the bounding boxes are internally corrupted -- they show up fine via a bounding box visual test. Both some objects with and without a zbuffer are affected, but again, only when I have objects without a zbuffer.
INFO: my program's models/geography/etc. are done with a drawall command.
Can you think of any combo of render states & settings that could possibly blank an object like I described? Just looking for some speculation so I could try SOMETHING...
A possibility, yes.hybrid wrote:Maybe the wrapper does not set up all render states properly.
Can you think of any combo of render states & settings that could possibly blank an object like I described? Just looking for some speculation so I could try SOMETHING...
Any other theories?
I don't think it's the wrapper not "setting the render states properly", because:
* It just uses a drawAll command.
* Everything is fine on one angle, but a change of .1 degree of the view will cause Britain (for instance) to disappear. If this is a wrapper bug, it would have to be quite a fiendish bug!
See the links here--
http://img696.imageshack.us/i/screensho ... 00360.png/ -- OK
http://img443.imageshack.us/i/screensho ... 00361.png/ -- not OK!
Just a slight rotation in the camera caused this.
Edit: So again, to get rid of the problem I just have to get rid of my flat rectangle, which currently works as "the sea"... here is the wrapper code for setting material flags.
I don't think it's the wrapper not "setting the render states properly", because:
* It just uses a drawAll command.
* Everything is fine on one angle, but a change of .1 degree of the view will cause Britain (for instance) to disappear. If this is a wrapper bug, it would have to be quite a fiendish bug!
See the links here--
http://img696.imageshack.us/i/screensho ... 00360.png/ -- OK
http://img443.imageshack.us/i/screensho ... 00361.png/ -- not OK!
Just a slight rotation in the camera caused this.
Edit: So again, to get rid of the problem I just have to get rid of my flat rectangle, which currently works as "the sea"... here is the wrapper code for setting material flags.
Code: Select all
/* ----------------------------------------------------------------------------
set the material of a node
*/
#define MAX_MAT_FLAGS 17
void DLL_EXPORT IrrSetNodeMaterialFlag( void *vptrNode, unsigned int uiFlag, bool boValue )
{
E_MATERIAL_FLAG emfFlagTable[] = {
EMF_WIREFRAME,
EMF_POINTCLOUD,
EMF_GOURAUD_SHADING,
EMF_LIGHTING,
EMF_ZBUFFER,
EMF_ZWRITE_ENABLE,
EMF_BACK_FACE_CULLING,
EMF_FRONT_FACE_CULLING,
EMF_BILINEAR_FILTER,
EMF_TRILINEAR_FILTER,
EMF_ANISOTROPIC_FILTER,
EMF_FOG_ENABLE,
EMF_NORMALIZE_NORMALS,
EMF_TEXTURE_WRAP,
EMF_ANTI_ALIASING,
EMF_COLOR_MASK,
EMF_COLOR_MATERIAL
};
// if a valid flag is selected
if ( uiFlag < MAX_MAT_FLAGS )
{
// change the flags property on this node
((ISceneNode*)vptrNode)->setMaterialFlag(
emfFlagTable[uiFlag], boValue );
}
}
Maybe it has something to do with the Irrlicht model loader.
I guess it wouldn't hurt to post one of the "problem" models here .. maybe someone can check if they don't load properly (I would if I knew how).
There are two models. One is almost exactly the same. 1x_b causes problems, and 1x does not. The only difference between them is that the two textures on the roof of the fort are grouped in separate rectangles for 1x_b. For 1x, they are not grouped in separate rectangles -- they are part of the roof group.
If I remove the textures on the roof, the problem goes away... but I don't see any problems with the textures.
Here's the link:
http://filegator.net/files/fN9JYyz71295988277.html
I guess it wouldn't hurt to post one of the "problem" models here .. maybe someone can check if they don't load properly (I would if I knew how).
There are two models. One is almost exactly the same. 1x_b causes problems, and 1x does not. The only difference between them is that the two textures on the roof of the fort are grouped in separate rectangles for 1x_b. For 1x, they are not grouped in separate rectangles -- they are part of the roof group.
If I remove the textures on the roof, the problem goes away... but I don't see any problems with the textures.
Here's the link:
http://filegator.net/files/fN9JYyz71295988277.html
I'm jumping back to drawAll() now.
It seems that there is just no way to set the draw order for objects where the zbuffer is off... in one frame, one node will draw first, and in another, another node will draw first...
This is only apparent when the scene changes in a certain way -- as far as I can tell, any extra object with a zbuffer set to "on" will cause the draw order to fluctuate depending on your viewing angle. :-\
It seems that there is just no way to set the draw order for objects where the zbuffer is off... in one frame, one node will draw first, and in another, another node will draw first...
This is only apparent when the scene changes in a certain way -- as far as I can tell, any extra object with a zbuffer set to "on" will cause the draw order to fluctuate depending on your viewing angle. :-\
-
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
I just think that in general it's not a good idea to turn off the z-buffer, especially when it's just for a couple of elements in your scene since you will get these unexpected resultsagamemnus wrote:I'm jumping back to drawAll() now.
It seems that there is just no way to set the draw order for objects where the zbuffer is off... in one frame, one node will draw first, and in another, another node will draw first...
This is only apparent when the scene changes in a certain way -- as far as I can tell, any extra object with a zbuffer set to "on" will cause the draw order to fluctuate depending on your viewing angle. :-\
There are other ways to solve your problem...