- Viewport layers, Colladas, and z-fighting

4 messages Options
Embed this post
Permalink
charback

- Viewport layers, Colladas, and z-fighting

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)

Hey all.

 

I’m running into an unusual problem involving Viewport Layers and I can’t seem to find my way past it.

 

I have two primitives, a flat plane for the ground and a very large cylinder for the distant sky. I also have two Colladas: a room that is made of four walls and a ceiling—the floor is the ground plane, and a single object (in this case a teapot) that is within the confines of the room. Everything is just great until I try to use Viewport Layers, at which point the primitives are ALWAYS shown in front of the Colladas.

 

I’ve tried many many things to correct the problem, and the only thing that has worked is completely removing the use of layers. To name just a few: I’ve tried assigning VPL’s for some objects and not others, in basically every possible combination. I’ve tried nesting VPL’s per Andy’s fairly recent blog post. I’ve tried Z-Sort vs Index-sort. I’ve tried adding some or all of the objects to DisplayObject3D containers in varying combinations.

 

The bottom line: I got nothing. Granted, I could just stop using VPL’s to prevent this problem, but there’s a fair amount of Z-Fighting that I get between the different objects if I don’t use layers, which is a problem in itself.

 

So does anyone have any ideas? I’m fresh out, unfortunately.

 

Thanks,

--ChrisH


_______________________________________________
Papervision3D mailing list
[hidden email]
http://osflash.org/mailman/listinfo/papervision3d_osflash.org
tmyers

Re: - Viewport layers, Colladas, and z-fighting

Reply Threaded More More options
Print post
Permalink
Hey Chris,

These problems are kinda fun...like a jigsaw puzzle :) Do you have your example online...so that people can get an idea of the scene and maybe suggest a solution.
Andy Zupko

Re: - Viewport layers, Colladas, and z-fighting

Reply Threaded More More options
Print post
Permalink
In reply to this post by charback
Some javascript/style in this post has been disabled (why?)
There are a few things to note about VPLs...

1) If you put SOME objects on VPLs but not others, they will always be infront of whatever objects don't have layers.  Add your collada's to a new layer and your problem will probably be solved.

2) When using collada/dae - you have to wait till the model is loaded to assign it to a VPL.  Add listeners for FileLoadEvent.LOAD_COMPELTE and then set hte VPL on the object.  This way all children that are loaded in will be properly assigned to the VPL.

If you still can't get it to work, post some code :)

-Andy


On Sep 28, 2008, at 5:33 PM, Chris Harback wrote:

Hey all.
 
I’m running into an unusual problem involving Viewport Layers and I can’t seem to find my way past it.
 
I have two primitives, a flat plane for the ground and a very large cylinder for the distant sky. I also have two Colladas: a room that is made of four walls and a ceiling—the floor is the ground plane, and a single object (in this case a teapot) that is within the confines of the room. Everything is just great until I try to use Viewport Layers, at which point the primitives are ALWAYS shown in front of the Colladas.
 
I’ve tried many many things to correct the problem, and the only thing that has worked is completely removing the use of layers. To name just a few: I’ve tried assigning VPL’s for some objects and not others, in basically every possible combination. I’ve tried nesting VPL’s per Andy’s fairly recent blog post. I’ve tried Z-Sort vs Index-sort. I’ve tried adding some or all of the objects to DisplayObject3D containers in varying combinations.
 
The bottom line: I got nothing. Granted, I could just stop using VPL’s to prevent this problem, but there’s a fair amount of Z-Fighting that I get between the different objects if I don’t use layers, which is a problem in itself.
 
So does anyone have any ideas? I’m fresh out, unfortunately.
 
Thanks,
--ChrisH
_______________________________________________
Papervision3D mailing list
[hidden email]
http://osflash.org/mailman/listinfo/papervision3d_osflash.org


_______________________________________________
Papervision3D mailing list
[hidden email]
http://osflash.org/mailman/listinfo/papervision3d_osflash.org
charback

Re: - Viewport layers, Colladas, and z-fighting

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)

Hi Andy,

 

Number 2 did the trick. I hadn’t bothered to put LOAD_COMPLETE listeners in since this was just a Collada load tester I was working on. I put them in there and the whole thing works like a charm.

 

Thanks a lot for pointing me in the right direction!

 

--ChrisH

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Andy Zupko
Sent: Sunday, September 28, 2008 5:27 PM
To: [hidden email]
Subject: Re: [Papervision3D] - Viewport layers, Colladas, and z-fighting

 

There are a few things to note about VPLs...

 

1) If you put SOME objects on VPLs but not others, they will always be infront of whatever objects don't have layers.  Add your collada's to a new layer and your problem will probably be solved.

 

2) When using collada/dae - you have to wait till the model is loaded to assign it to a VPL.  Add listeners for FileLoadEvent.LOAD_COMPELTE and then set hte VPL on the object.  This way all children that are loaded in will be properly assigned to the VPL.

 

If you still can't get it to work, post some code :)

 

-Andy

 

 

On Sep 28, 2008, at 5:33 PM, Chris Harback wrote:



Hey all.

 

I’m running into an unusual problem involving Viewport Layers and I can’t seem to find my way past it.

 

I have two primitives, a flat plane for the ground and a very large cylinder for the distant sky. I also have two Colladas: a room that is made of four walls and a ceiling—the floor is the ground plane, and a single object (in this case a teapot) that is within the confines of the room. Everything is just great until I try to use Viewport Layers, at which point the primitives are ALWAYS shown in front of the Colladas.

 

I’ve tried many many things to correct the problem, and the only thing that has worked is completely removing the use of layers. To name just a few: I’ve tried assigning VPL’s for some objects and not others, in basically every possible combination. I’ve tried nesting VPL’s per Andy’s fairly recent blog post. I’ve tried Z-Sort vs Index-sort. I’ve tried adding some or all of the objects to DisplayObject3D containers in varying combinations.

 

The bottom line: I got nothing. Granted, I could just stop using VPL’s to prevent this problem, but there’s a fair amount of Z-Fighting that I get between the different objects if I don’t use layers, which is a problem in itself.

 

So does anyone have any ideas? I’m fresh out, unfortunately.

 

Thanks,

--ChrisH

_______________________________________________
Papervision3D mailing list
[hidden email]
http://osflash.org/mailman/listinfo/papervision3d_osflash.org

 


_______________________________________________
Papervision3D mailing list
[hidden email]
http://osflash.org/mailman/listinfo/papervision3d_osflash.org