RE: TEXMAP extension thoughts and findings.
2018-01-12, 23:00 (This post was last modified: 2018-01-16, 1:05 by Joshua Delahunty. Edit Reason: had my dates off. TEXMAP was designed in 2009, not 2012 )
2018-01-12, 23:00 (This post was last modified: 2018-01-16, 1:05 by Joshua Delahunty. Edit Reason: had my dates off. TEXMAP was designed in 2009, not 2012 )
(2018-01-12, 21:39)Roland Melkert Wrote:(2018-01-12, 18:31)Joshua Delahunty Wrote: If I'm understanding correctly, the spec would not change from a user perspective, only the technical discussion talking about how the u-v are calculated? The user specifies the base "center" of the wrapped texture around the cylinder, and the renderer will correct for the fact that this doesn't line up with expectations for PLANAR, or are you saying the user should specify P3 as the top middle point of the texture application?I'm ok ether way, just wanted to bring this oddity/ambiguity to light as support for cylindrical textured parts is still very limited so changing something now won't break much.
What have you set-up in LDCad at this point? I recently reported a TEXMAP issue to Leonardo Zide about LeoCAD and as part of that conversation he reminded me that he's ready to implement CYLINDRICAL and SPHERICAL (he was one of the first to do PLANAR) as soon as I gave him info from the spec -- and he has been for years .
Believe it or not, making the relationship of P1-P2-P3 so different from that of PLANAR was purposeful. I had to remember back 8 years as to why we tried to go that way, and as I recall it, we wanted a strong differentiation from how the points worked in a planar example (all points basically "on" the texture) to how they worked in CYLINDRICAL (two off-texture, and the third at a midpoint rather than a corner).
That said, while I objected to changes to the spec because of a large volume of work I'd done defining PLANAR TEXMAP parts between 2009 and adoption of the standard, since both Benjamin and yourself found it counter-intuitive, I'd be willing to have this change to CYLINDRICAL opened up and potentially changed. Unfortunately, the spec specifically forbids change without ratification of the LSC, which could make it tough.
Again, how does LDCad work currently? I'll ask Leo to mirror that work, and if the only two working examples are out of spec, at least they will be consistent.
------
Side notes:
Yes, 'a' was meant to be expressed in degrees.
CYLINDRICAL was designed specifically because PLANAR textures would start to shear/warp at the edges if one textured the "entire" face of the mini-figure; and it was expected to help solve that particular issue. SPHERICAL came along for completeness. The implementation details, PLANAR, CYLINDRICAL and SPHERICAL were all based on OpenGL source examples from "the literature" (I've yet been able to go back and find them, unfortunately), and were intended to therefore be pretty straightforward. I regret the angst SPHERICAL has caused you guys in your attempts to implement.
CYLINDRICAL as conceived was always presumed to max out at a=180, since we'd not seen a texture that wrapped an entire cylinder at the time. If I were to use CYLINDRICAL on a mini-figure double-inked head, I would use two separate textures -- I do that now with PLANAR. I suppose by extension, SPHERICAL was never meant to go over a hemisphere either.
Everything about TEXMAP was meant to make it easier for end-user participation and experimentation without having to understand 3D concepts to a super high degree (this is also why we focused on PLANAR so heavily). If the user created a TEXMAP source rectangle that ran past the extents of the geometry, that was acceptable. If smaller, yeah, infinite outer transparency was expected -- the idea was if the heavy lifting had been skipped at the PNG generation stage, it could be "tweaked" in the texturing stage.
We figured that after two separate renderers had been able to implement the standard without too much headache, then it would be easy to forward to other renderers. I didn't get a blow-by-blow from Leonardo about how hard LeoCAD was, but he made it seem really simple: I asked, he implemented.
(2018-01-12, 18:31)Joshua Delahunty Wrote: BTW, I think it's interesting the way you're using FALLBACK above. FALLBACK was intended to allow "dual-use" decorated parts. The existing geometric designs (we called this Design By Architecture) would go in the FALLBACK section, and the new, often-less-complicated geometry would appear in 0 !: lines. The intent being that TEXMAP parts could be issued in the wild that would not break existing implementations (such as MLCAD).
Following the spec, your last example should work just as well with the less-work-intensive:
Quote:Quote:Makes sense, I'll have to check my implementation.
Again, it was meant to keep things really easy. If a part never had DBA designs in it, it shouldn't have nor need FALLBACK or cryptic 0 !: lines
I think I saw you putting in GLOSSMAP in some examples as well; that's meant to be an optional parameter. if it's absent, no problem, if it's present, then the PNG file should follow else it's an error.
Finally, attached is my hand-drawn diagram of what I recall (from memory and reading the spec) CYLINDRICAL to be. Did you place P3 where it shows, or at the other end of the black line (in the colored version)?
[img]file://Users/jdelahunty/Downloads/cylindrical.jpg[/img]