[Papervision3D] RE : The Culler vs. Me
Patrick Matte | BLITZ
PMatte at blitzagency.com
Sun Dec 16 20:05:51 PST 2007
What are your camera's zoom and focus values ? Once I had a similar problem because i was using a small zoom value. I changed it from 1 to 11 with a focus of 100 and the hole problem disapearred.
________________________________
De : papervision3d-bounces at osflash.org [papervision3d-bounces at osflash.org] de la part de Carlos Ulloa [carlos at papervision3d.org]
Date d'envoi : 15 décembre 2007 23:32
À : papervision3d at osflash.org
Objet : Re: [Papervision3D] The Culler vs. Me
Hi Eric-Paul,
I'm not sure it would be possible to draw a triangle with only one vertex. When vertices are behind the camera, we are not able to project them into 2D. This is a classic problem when doing floors. Solutions? Increase the zoom of your camera, decrease the focus value, or maybe try precise materials.
C4
Eric-Paul Lecluse wrote:
Hey there people. I'm having difficulties bending my mind around the culling process while working on my project. I'll explain what I'm trying to accomplish and what I encounter along the way. Please correct me if I make some false assumptions on the workings of Papervision.
The idea is that you're moving through a landscape viewed from a first person perspective, like a camera mounted in front of a car. The scene is pretty big and the camera is supposed to be pretty close to the floor, giving a little sense of how "big" it all is. [see screenshot 1] With the scene being so big I need to use a mesh with very big faces and that's why the effect I'm having is extra annoying.
[cid:part1.03090502.07090205 at papervision3d.org]
In the render process, PV walks through all the faces in the scene and hides all that are presumably not in the camera's view. That way the least amount of CPU is wasted on invisible objects or faces, it's called culling. However, the culler and I don't seem to agree on when to hide a face from the renderer. The result is that holes appear in the mesh that's supposed to appear as a solid landscape. [see screenshot 2]
[cid:part2.07020604.07060908 at papervision3d.org]
What you're seeing are two viewports. The left one renders the view from my FreeCamera3D and that's where the holes appear. For the sake of figuring out how PV goes about culling I added a little top view on the right. That one contains a little blue object that shows the position and rotation of the camera, including the camera's transversal plane. The white faces you see is a little selection to better explain what's happening. I've been playing with the combination of zoom and focus, but the holes kept appearing, no matter what extremities I used.
Now what you see in the next screenshot, is the same position of the camera as number 2, but rotated a little to the left: Just far enough for the transversal plane of the camera's position to no longer intersect with the face. The moment that happens, the face pops back into existance again.
[cid:part3.03090105.05000602 at papervision3d.org]
So, after digging through the DefaultTriangleCuller and RectangleTriangleCuller I’ve found that my problem is not a culling problem perse. I’m thinking it might even be something that can’t be tricked, but please prove me wrong. In the Vertex3Dinstance class there’s the “visible” property if a vertex is in front of a camera plane or behind. That property is used in the rt-culler. If all three vertices of a face are in front of the camera plane, the face will be drawn. If only one is behind the plane, the face is not drawn anymore. Changing the culler to keep drawing as long as at least one of the vertices is in front of the cam results in very nice but also absolutely unwanted visual effects, and that’s where my hacking abilities end, unfortunately for me but fortunately for Ralph’s culling classes…
Would it somehow be possible/feasible to have the renderer draw faces when at least one vertex is in the visible area? That way you never block a face that might very well be in the camera's visible area and get a viewport full of pretty pink polygons! What are your thoughs and findings on this subject?
Cheers, Eric-Paul.
________________________________
_______________________________________________
Papervision3D mailing list
Papervision3D at osflash.org<mailto:Papervision3D at osflash.org>
http://osflash.org/mailman/listinfo/papervision3d_osflash.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20071216/27701a45/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ATT00001
Type: image/jpeg
Size: 68517 bytes
Desc: ATT00001
Url : http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20071216/27701a45/attachment-0003.jpe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ATT00002
Type: image/jpeg
Size: 75042 bytes
Desc: ATT00002
Url : http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20071216/27701a45/attachment-0004.jpe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ATT00003
Type: image/jpeg
Size: 70242 bytes
Desc: ATT00003
Url : http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20071216/27701a45/attachment-0005.jpe
More information about the Papervision3D
mailing list