Texture coordinates - Printable Version +- Xonotic Forums (https://forums.xonotic.org) +-- Forum: Creating & Contributing (https://forums.xonotic.org/forumdisplay.php?fid=10) +--- Forum: Xonotic - Editing and Concept Art (https://forums.xonotic.org/forumdisplay.php?fid=11) +--- Thread: Texture coordinates (/showthread.php?tid=5456) |
Texture coordinates - homs - 04-26-2015 Hi, I wrote a little tool [1] to make a terrain from brushes from an image. It is quite limited in usefulness, but I wondered for while about a central shortcoming: I couldn't figure out how to set texture coordinates correctly such the texture seams match. [1] https://github.com/fps/map0 Is there a way to get the textures aligned correctly if considered as projected from the top? Patches welcome.. NOTE: Don't try this with images much larger than 100x100 pixels RE: Texture coordinates - tZork - 05-02-2015 Usually, as a mapper, one solve this by using texture projection at shader level. heres an example from data/xonotic-maps.pk3dir/scripts/terrain01x.shader Code: textures/terrain01x/blends-mars-rock01-ground01-projected the magic line here is Code: q3map_tcGen ivector ( 1024 0 0 ) ( 0 1024 0 ) RE: Texture coordinates - homs - 05-11-2015 Thanks for your reply tZork. Using a shader to do the texture projection is a nice way around this problem I suppose. I must admit though that I was kind of lazy in my first post about this subject and while I described the consequence of my problem OK I should really have asked about the source. The source of my problem really was that I didn't quite understand the texture coordinate mapping in .map files, especially in the brushDef format. Interestingly enough that shader line you mention Code: q3map_tcGen ivector ( 1024 0 0 ) ( 0 1024 0 ) looks suspiciously again like the interesting parts of the brushDefs. From searching the web I found out that it's the two rows of a homogenous transform which is applied to the vertices after being transformed into a different basis. That transformation into a different basis is the missing part that is not well documented sadly. Can you maybe shed light on that issue, too? I will also experiment with the shader you mentioned Thanks again, homs RE: Texture coordinates - tZork - 05-13-2015 unfortunately i only know how to use the .shaders, not how the code behind them works. if you manage to catch div0 on irc he may be able to give you some pointers.. thats abt the only option i can think of RE: Texture coordinates - homs - 05-19-2015 (05-13-2015, 12:58 PM)tZork Wrote: unfortunately i only know how to use the .shaders, not how the code behind them works. if you manage to catch div0 on irc he may be able to give you some pointers.. thats abt the only option i can think of Thanks for the replies anyways. Your input is highly appreciated |