why render invisible object3d??

Started by roninjnj, August 27, 2008, 10:15:20 PM

Previous topic - Next topic

roninjnj

Hi!! a new question!!

I have next code:


              if (!wireframe)
             {                
        cursorMouse.setVisibility(false);
       
        shadowHelper.updateShadowMap();       
        buffer.clear(java.awt.Color.GRAY);       
                         shadowHelper.drawScene();                                 
             }
             else
             {
        buffer.clear(java.awt.Color.BLACK);
                     world.drawWireframe(buffer, colorWireFrame);
             }       

             buffer.update();
             buffer.displayGLOnly();
             canvas.repaint(); 
            
             cursorMouse.setVisibility(true);
        }


NOTE: CursorMouse is a Object3D instance.

Ok, the problems...

1)  I can´t switch to wireframe mode, it only draw a black screen.

2)  cursorMouse is displayed in any frames, in another frames is displayed his shadow only (but cursorMouse is not added to shadowHelper (not set to addcaster or addreciver), and in another cases, both are displayer, geometry with texture and shadow. Why? Its is set not visible before render and set visible after render. (it is always in mode non-selectable).

Thanks!!!

EgonOlsen

I'm not sure what exactly you are talking about. Do you have a screen shot?

roninjnj

Its a sample of my problem.

I have a map dividided in squares to a turn based strategy game.

I use a gemometry with texture (with blending actived) to know in what square in 3d world is aiming mouse (using 2DInteract).

I had this error, and i didn´t know what code is doing some bad. Then I decided go directly to render bucle and do that test:   

                                             1) hide object3D mouseCursor.
                                             2) render shadows and scene.
                                             3) and finally, set object3D mouseCursor setVisible(true).

In theory, object3D mouseCursor should be not visible in window. BUT in some frames, it appears!

I don´t know why... ¿?



I have assigned a geometry with texture to aim positions with mouse. , but a got this problem.


EgonOlsen

Again, which version of jPCT? 1.16 has a major problem with enabling/disabling object via the ShadowHelper. Please let me know what Config.getVersion() returns.

roninjnj

Version returned is  1.17.

I solve the problem removing this object3D from world, updating shadowmap, inserting again this object into the world, and rendering scene with shadowHelper.

If the object3D is not in world, it can be appear in shadow map rendering.

If a new version of JPCT is relase in future, I will modify the code. Now, it is runing rigth with that method.

Thanks for all!!

EgonOlsen

Can you create a simple test case that shows the problem, so that i can find and fix it in a later version? Right now, i can't reproduce it. Obviously, i'm doing something different... ???

EgonOlsen

I've checked the visibility-handling in the ShadowHelper of 1.17 again...it seems correct to me. Are you by any chance adding or removing objects to/from the world from another thread?

roninjnj

I was looking the problem.

Code is larger, need more time. I have another thread to put-remove object3Ds in the world variable.

Problem only appear with a polygon attached to mouse movements ,mouse.getX() and mouse.getY() is checked in main thread.

But nerver NEVER is add this poligon to a shadowCaster with addCaster o reciveCaster, and sometimes a shadow of this poligon appear .

I´m going more test to find problem and send you results.

Is version 1.17 lastest version of JPCT??

Thanks!  (Sorry my english)



EgonOlsen

1.16 is the latest official release. What is in the download/beta-directory is a pre-release version of 1.17, which is the latest available version. The ShadowHelper affects object visibility even when an object is no caster and/or receiver, because it has to exclude all other objects from the process. If another thread adds/removes objects to the world while the helper is running, everything may happen. Never ever add/remove objects from outside the rendering thread without synchronizing things. jPCT isn't thread safe...please keep that in mind.

roninjnj