Re: [Flightgear-devel] Trees, alpha, and the sky
Andy Ross wrote: Wolfram Kuss wrote: Andy Ross wrote: You could also experiment with turning off backface culling instead of rendering two quads for each direction. In principle, it should be faster. In practice, it's probably a good way to detect driver bugs. :) The speed difference will be very, very small. Are you sure? It reduces the vertex count by a full factor of two. IMHO you can use indexes (sp?) into the same vertices, so the vertex count would stay the same. The pixel count would off course also be the same. Andy Bye bye, Wolfram. ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Trees, alpha, and the sky
http://www.megginson.com/flightsim/tree.png [...] 2. While other scenery shows through the alpha parts of the texture, the sky often doesn't, as you can see in the above screenshot (note how you can see the grass and river near the bottom of the trunk, but not the sky near the crown). This is very similar to what I saw with the propeller disk, Martin. -- Unix _IS_ user friendly - it's just selective about who its friends are ! -- ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Trees, alpha, and the sky
Andy wrote: Also, that's an awfully small texture. While it's good to not waste space, this thing is tiny -- one eighth the size of a single panel instrument's face. IMHO, it would look much better at 128x256 or so, with no measurable loss of performance. I agree. Some modders I know use one 512 x 512 texture file per instrument (for the face including the bezel (sp?) and the needle). This works very well, with GeForce 2 and higher you get no measurable slow down compared to smaller textures. You could also experiment with turning off backface culling instead of rendering two quads for each direction. In principle, it should be faster. In practice, it's probably a good way to detect driver bugs. :) The speed difference will be very, very small. Andy Bye bye, Wolfram. ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Trees, alpha, and the sky
Jim wrote: I've been thinking about that: how about not at the top, but halfway? Essentially, you'd have the XY, YZ, and XZ planes, one unit wide, all intersecting at the origin. Is that clear? Yes. You want to make the horizontal polygon at the largest extension of the leaf canopy. This means the chance that in your view the horizontal poly extends over the other two polygons is lowest. BTW, I recommend setting the origin to the place where the stem goes into the earth. Jon That might work...was even thinking about at the bottom so you'd only really see it from above. No - if you do not look directly from above, it will look very bad. Say the leaf canopy is a sphere (two polys with circular mask textures) and the horizontal poly is a circular disc as well. When looking with a pitch of say 20 degrees down onto it, you will see the sphere above and a ellipse below the shere. Best, Jim Bye bye, Wolfram. ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Trees, alpha, and the sky
Wolfram Kuss wrote: Andy Ross wrote: You could also experiment with turning off backface culling instead of rendering two quads for each direction. In principle, it should be faster. In practice, it's probably a good way to detect driver bugs. :) The speed difference will be very, very small. Are you sure? It reduces the vertex count by a full factor of two. For a single tree, that's a savings of 12 vertices; immesurable noise for a single tree, but for a forest of thousands? I could easily see us running into GPU throughput issues with this. It's probably not something to worry about for a good while, though. As David points out, it can't be done without hacking plib's internals. Andy -- Andrew J. RossNextBus Information Systems Senior Software Engineer Emeryville, CA [EMAIL PROTECTED] http://www.nextbus.com Men go crazy in conflagrations. They only get better one by one. - Sting (misquoted) ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
RE: [Flightgear-devel] Trees, alpha, and the sky
Andy Ross Wolfram Kuss wrote: Andy Ross wrote: You could also experiment with turning off backface culling instead of rendering two quads for each direction. In principle, it should be faster. In practice, it's probably a good way to detect driver bugs. :) The speed difference will be very, very small. Are you sure? It reduces the vertex count by a full factor of two. For a single tree, that's a savings of 12 vertices; immesurable noise for a single tree, but for a forest of thousands? Well if we are worried about vertex counts then by using impostors for all execpt the very closest trees you would only have 4 vertices per for the vast majority :-)) Norman ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Trees, alpha, and the sky
Or draw the trees as step four? But, how do I know where I can draw a tree? Marcio Shimoda ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Trees, alpha, and the sky
Would small dense green clouds work? Jon Berndt wrote: Jon Berndt writes: can you use a sphere? That's a lot of triangles for each tree. Oh, blast it! That's right. OGL has no real sphere. Jon ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Trees, alpha, and the sky
Marcio Shimoda writes: What function draws the sky and the tile? The sky is drawn in SimGear -- see simgear/sky/dome.cxx. It's not integrated with the SSG graph, and that may or may not be part of the problem. All the best, David -- David Megginson, [EMAIL PROTECTED], http://www.megginson.com/ ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Trees, alpha, and the sky
Marcio Shimoda writes: What function draws the sky and the tile? The code to draw the sky is in simgear. Curt. -- Curtis Olson IVLab / HumanFIRST Program FlightGear Project Twin Cities[EMAIL PROTECTED] [EMAIL PROTECTED] Minnesota http://www.menet.umn.edu/~curt http://www.flightgear.org ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Trees, alpha, and the sky
David Megginson writes: Marcio Shimoda writes: What function draws the sky and the tile? The sky is drawn in SimGear -- see simgear/sky/dome.cxx. It's not integrated with the SSG graph, and that may or may not be part of the problem. The scene drawing is split into several phases: Step 1: the sky dome, the sun, moon, stars, planets. This forms the back drop. Everything else is drawn in front of these sky items. Step 2: draw the terrain. This needs to go in front of sky back drop so it is drawn next. Step 3: draw the clouds. The clouds have alpha so they are drawn last. However, if the tree has been already drawn, then the sky won't show throw because the depth buffering of the tree polygons masks it out. Everything with alpha really needs to be thrown in a big bin and all drawn back to front in one step. However, with things like the clouds that are huge relative everything else, how do you calculate the distance of the cloud layer? Probably to the nearest point is what we want, but I doubt that is what plib uses ... it probably goes off the 'reference' point or center of the bounding sphere of each partially transparent leaf node. This is a problem ... this might be a good one to ask on the plib list to see if they can provide suggestions? Curt. -- Curtis Olson IVLab / HumanFIRST Program FlightGear Project Twin Cities[EMAIL PROTECTED] [EMAIL PROTECTED] Minnesota http://www.menet.umn.edu/~curt http://www.flightgear.org ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Trees, alpha, and the sky
David Megginson [EMAIL PROTECTED] said: Curtis L. Olson writes: Step 1: the sky dome, the sun, moon, stars, planets. This forms the back drop. Everything else is drawn in front of these sky items. Step 2: draw the terrain. This needs to go in front of sky back drop so it is drawn next. Step 3: draw the clouds. The clouds have alpha so they are drawn last. I assume that steps 2 and 3 are in this order so that you'll be able to see a mountain (for example) through gaps in the clouds. If you reversed the two, we'd lose that but alpha on trees (etc.) would start working. Ouch. Or draw the trees as step four? Best, Jim ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Trees, alpha, and the sky
Jim Wilson writes: David Megginson [EMAIL PROTECTED] said: Curtis L. Olson writes: Step 1: the sky dome, the sun, moon, stars, planets. This forms the back drop. Everything else is drawn in front of these sky items. Step 2: draw the terrain. This needs to go in front of sky back drop so it is drawn next. Step 3: draw the clouds. The clouds have alpha so they are drawn last. I assume that steps 2 and 3 are in this order so that you'll be able to see a mountain (for example) through gaps in the clouds. If you reversed the two, we'd lose that but alpha on trees (etc.) would start working. Ouch. Or draw the trees as step four? If we do that, then you won't see any of the trees through the breaks in the clouds if you are above a cloud layer. Curt. -- Curtis Olson IVLab / HumanFIRST Program FlightGear Project Twin Cities[EMAIL PROTECTED] [EMAIL PROTECTED] Minnesota http://www.menet.umn.edu/~curt http://www.flightgear.org ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Trees, alpha, and the sky
Jim Wilson [EMAIL PROTECTED] said: Or draw the trees as step four? Nope that won't work...uggh. Best, Jim ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
[Flightgear-devel] Trees, alpha, and the sky
I've been experimenting with a simple tree model in FlightGear. Here's the result: http://www.megginson.com/flightsim/tree.png The tree consists of a 32x64 RGBA texture mapped onto three sets of back-to-back rectangles at 120-degree angles to each other. From any given viewing angle (other than directly overhead) it looks more-or-less 3D, but there are two problems: 1. I need to clean up the edges of the texture to avoid artifacts. 2. While other scenery shows through the alpha parts of the texture, the sky often doesn't, as you can see in the above screenshot (note how you can see the grass and river near the bottom of the trunk, but not the sky near the crown). I suspect that the sky problem has something to do with drawing order, clip planes, or a combination of the above. We may need to draw the sky before the scenery so that it will show through transparent parts. Any hints? This model is light-weight enough that we could build fairly large groves, at least near airports. All the best, David -- David Megginson, [EMAIL PROTECTED], http://www.megginson.com/ ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
Re: [Flightgear-devel] Trees, alpha, and the sky
David Megginson [EMAIL PROTECTED] said: What about overhead? Should I plop one more rectangle on the top? You don't usually look straight down from a plane, but it will happen during aerobatics. Hmmm...it'd be hard to make that not look weird from some angle. Best, Jim ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
RE: [Flightgear-devel] Trees, alpha, and the sky
Jon Berndt writes: can you use a sphere? That's a lot of triangles for each tree. Oh, blast it! That's right. OGL has no real sphere. Jon smime.p7s Description: application/pkcs7-signature
RE: [Flightgear-devel] Trees, alpha, and the sky
Jim Wilson writes: That might work...was even thinking about at the bottom so you'd only really see it from above. That might actually be the best idea, but it will make placement very sensitive (I usually sink models slightly into the ground to avoid gaps). All the best, David -- David Megginson, [EMAIL PROTECTED], http://www.megginson.com/ ___ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel