animats Posted February 24, 2022 Share Posted February 24, 2022 Four cylinders with planar mapping. Left to right, 1) Mesh, Blender-generated normals, 2) Mesh, uploader-generated normals, no UVs, 3) Mesh, uploader generated normals, Blender UVs. 4) Prim cylinder. Texture scales 1,1. Planar mapping is somewhat obscure, and because I'm working on rendering, I need to understand how it's supposed to behave. it turns out that UVs are totally ignored for planar mapping. It's the normals that matter. This sort of make sense. For a flat surface, you want the texture to map perpendicular to the flat surface. For curved surface, though, the effects are wierd. One side effect is that there are objects in world with no UVs, or junk UVs. They have to be used in planar mapping mode. I have a mesh signboard like that. If you set it to default mapping, one pixel of the texture gets picked to fill the whole sign, instead of the texture being displayed. I need to know the function you apply to a mesh coordinate and a normal to get a UV. Anyone really understand this? Link to comment Share on other sites More sharing options...
ChinRey Posted February 24, 2022 Share Posted February 24, 2022 3 minutes ago, animats said: I need to know the function you apply to a mesh coordinate and a normal to get a UV. Anyone really understand this? I'm not sure if this helps but planar mapping is entirely client side so it's all hidden somewhere in the open source code. Link to comment Share on other sites More sharing options...
animats Posted February 24, 2022 Author Share Posted February 24, 2022 42 minutes ago, ChinRey said: I'm not sure if this helps but planar mapping is entirely client side so it's all hidden somewhere in the open source code. Right. What has me puzzled is the vertical distortion of the texture. The normals on the cylinders are fine for lighting purposes. There's no vertical distortion. Does anybody actually use planar UV mapping on non-flat surfaces? Link to comment Share on other sites More sharing options...
animats Posted February 24, 2022 Author Share Posted February 24, 2022 Prim cylinder, planar mapping, highest LOD. Prim cylinder, planar mapping, lowest LOD. The low LOD is shown by setting Firestorm LOD factor to 0. (Which is why most of my avatar is gone.) The cylinder has been reduced to 6 sides, which is normal prim behavior at low LOD. That worked fine. The texture has flipped and torn. Now, that's totally wrong. Planar mapping was apparently documented in SNOW-586, written by Patch Linden, but that's gone from the JIRA. A 2008 video tutorial indicates that planar projection on non-flat surfaces is "funky", and shows similar distortions. So, planar mapping for non-rectangular objects seems to be undefined behavior. In other words, don't try to do that, because it will render very strangely. 1 Link to comment Share on other sites More sharing options...
Coffee Pancake Posted February 24, 2022 Share Posted February 24, 2022 Please don't feel the need to recreate the garbage effect we get in the Linden Viewer .. "couldn't be bothered to make it work" isn't a feature. 2 Link to comment Share on other sites More sharing options...
animats Posted April 12, 2022 Author Share Posted April 12, 2022 Elizabeth Jarvenen explained to me how planar mapping is supposed to work. She showed me how Substance Painter does it right. Here's a paper on the theory. There's single planar mapping, which is like illuminating something with a projected pattern along one axis. That's how land textures work in SL, and it's why steep slopes look so bad. Then there's triaxial planar mapping, where the object is illuminated along all three axes, from both directions. That's hard to do and usually requires special shaders in the GPU. So, is that feature actually used? Yes. I've found it twice in New Babbage. Savory Street Market, Port Babbage. Across from the docks. Rendered with Animats renderer, not a standard viewer. The bays on the facade use planar texture projection. The top, front, and sides of the bay are all one SL face. So this needs triaxial planar projection. Notice that the stonework texture is lines instead of stone blocks on the top and front side, but correct on the angled faces. This works in the LL renderer and Firestorm. I'm surprised that it does, after seeing what the LL renderer does with other hard cases. My renderer only has single planar mapping, and that's not enough. I have to handle the hard cases. Still much to do, but getting there. This doesn't come up often. The only other place I've seen it is the cockpit windows of the Albatross, the sky ship permanently parked above Babbage Palisade alongside the railroad track to The Fells. If you know of other places, please let me know, and I'll go look. Planar mapping tends to be used on large surfaces, so, when it's a problem, it shows. In SL, we're used to looking at blur in close-up. Once that's fixed, as it is in my viewer, and textures go to high resolution before you get close enough to see blur, problems like this stand out more. (Is that fixed in the "performance viewer"?) 2 Link to comment Share on other sites More sharing options...
animats Posted April 13, 2022 Author Share Posted April 13, 2022 Anyone have a copy of SNOW-586, or the video by Patch Linden mentioned here? That's the documentation for planar texture mapping, and it seems to be lost. Link to comment Share on other sites More sharing options...
Christhiana Posted May 6, 2022 Share Posted May 6, 2022 I use planar mapping for my LH shells. I have noticed the same distortions on none flat surfaces and I found for me they happened when I didn't triangulate my mesh before exporting. I hope this helps. Link to comment Share on other sites More sharing options...
Jenna Huntsman Posted May 6, 2022 Share Posted May 6, 2022 On 4/13/2022 at 5:54 AM, animats said: Anyone have a copy of SNOW-586, or the video by Patch Linden mentioned here? That's the documentation for planar texture mapping, and it seems to be lost. Not sure if you got an answer for this, but here you go: http://web.archive.org/web/20151227192030/https://jira.secondlife.com/browse/SNOW-586 1 Link to comment Share on other sites More sharing options...
animats Posted May 6, 2022 Author Share Posted May 6, 2022 3 hours ago, Jenna Huntsman said: SNOW-586 Thanks! Key line there: "The result is meaningful only if all the selected faces are on the same plane." So I can stop worrying about the weird cases for curved surfaces. Planar mapping for non-flat faces doesn't seem to be very meaningful. Look at those cylinders above. What I do is this: Start with mesh. Separate triangles by their primary normal axis, X, Y, or Z, constructing 1 to 3 new meshes. Give each of those meshes UVs appropriate for the axis they face. Put resulting meshes into the main rendering system, which only handles meshes with UVs. This gives consistent results. It looks like what you'd see if you had faraway light projectors aimed at a blank object from all six axis directions. It's not exactly the same as what LL does, but it's the same for all flat axis-aligned faces, which is what planar texture mapping is used for in practice. That wall at Savory Market now works. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now