octa... hecta... tile problems
octa... hecta... tile problems
umm i need help making the floor shown here work in 'dual texture plain'. i've tried a couple of things but am still pretty lost was hoping someone could describe how the effect in the picture can be created in 'dual texture plain'. it was extremly easy to make it work in 'texture plain' but using modified versions of the original tile i made didnt quite work (although it did make an interesting effect).
edit: img redirection didnt work its the pic i posted in this thread http://guru3.sytes.net/viewtopic.php?t=1684&start=15
edit: img redirection didnt work its the pic i posted in this thread http://guru3.sytes.net/viewtopic.php?t=1684&start=15
I do have some advice 
I saw your post earlier but because the tv trapped me I forgot to reply before I was logged off and bla bla bla-di-blah
It looks nice and now saves me the trouble of making that floor (I had almost done so but then I began messing about with dual textured floors).
Quick answer: you can't do what you want easily (or maybe even at all).
Long answer: because dual layered floors are made to stretch floor_a in one direction, floor_b in another direction (90 degrees difference) you just can't make textures keep their detail unless you figure out something like this (no I won't do it):
floor_a.png relates to floor_b.png in that floor_b.png has it's texture rotated 90 degress (cw or ccw, not sure) AND you figure out what the max stretch size (there is one as my Gradient Floor revealed) for the dual layered floor textures is (it's probably visible somewhere in the code and if you're lucky it's a static percentage rather than interdependent on things like grid_size, arena size and/or texture size). Because when you know the max stretch for your texture you can use mathematics to both calculate how much distortion you want to account for in the stretching direction on each texture so as to make a hexagon a likesided (true) hexagon as well as their placemenet in the non-stretched direction so that the textures (_a/_b) perfectly overlap each other.
"Easy" goes through your brain I bet but there's an additional problem which can render (pun intended) the entire business moot: dual texturing makes lines spanning the complete texture in the direction of stretch render sharply, but to my experience it does not do so for lines crossing the direction of stretch. So if you actually do all the hard work and manage to make dual rendered textures that map for example a hexagrid perfectly on top of each other they might not actually look any sharper than the same in a single textured floor. NOTE: I can't say this is what will happen for sure, probably there will be some improvement (and it might even be fantastic) but don't be crushed if this is actually the result. I'm undecided myself as to wheter the effect would cancel out or strenghten itself.
Enjoy and please share your own experiences

I saw your post earlier but because the tv trapped me I forgot to reply before I was logged off and bla bla bla-di-blah

It looks nice and now saves me the trouble of making that floor (I had almost done so but then I began messing about with dual textured floors).
Quick answer: you can't do what you want easily (or maybe even at all).
Long answer: because dual layered floors are made to stretch floor_a in one direction, floor_b in another direction (90 degrees difference) you just can't make textures keep their detail unless you figure out something like this (no I won't do it):
floor_a.png relates to floor_b.png in that floor_b.png has it's texture rotated 90 degress (cw or ccw, not sure) AND you figure out what the max stretch size (there is one as my Gradient Floor revealed) for the dual layered floor textures is (it's probably visible somewhere in the code and if you're lucky it's a static percentage rather than interdependent on things like grid_size, arena size and/or texture size). Because when you know the max stretch for your texture you can use mathematics to both calculate how much distortion you want to account for in the stretching direction on each texture so as to make a hexagon a likesided (true) hexagon as well as their placemenet in the non-stretched direction so that the textures (_a/_b) perfectly overlap each other.
"Easy" goes through your brain I bet but there's an additional problem which can render (pun intended) the entire business moot: dual texturing makes lines spanning the complete texture in the direction of stretch render sharply, but to my experience it does not do so for lines crossing the direction of stretch. So if you actually do all the hard work and manage to make dual rendered textures that map for example a hexagrid perfectly on top of each other they might not actually look any sharper than the same in a single textured floor. NOTE: I can't say this is what will happen for sure, probably there will be some improvement (and it might even be fantastic) but don't be crushed if this is actually the result. I'm undecided myself as to wheter the effect would cancel out or strenghten itself.
Enjoy and please share your own experiences

- Jonathan
- A Brave Victim
- Posts: 3391
- Joined: Thu Feb 03, 2005 12:50 am
- Location: Not really lurking anymore
The tex coords are scaled by 0.01/gridsize in the stretch dimension and by 1/gridsize in the others, so the texture looks a 100 times bigger in the stretch dimension. It's impossible to circumvent it to make it work for things other than lines parallel to the stretch dimension. You'd get a result similar to the single texture floor but slower.
ˌɑrməˈɡɛˌtrɑn
ok so for a testing grid with squares one could try a 256x25600 pixel texture hehe
j/k
*goes off to redo an old concrete slab texture in 20x2000*
(my brain is too beat up to do anything else at the moment)
Edit:
Ah forget it. Because of the compression/decompression (from 2000 to 20 back to 2000 you will lose any detail (shading etc.) that is smaller than 1/100th of the original uncompressed texture so it's not worth it (I realised like a minute into working on it)... and unless the decompressed result (when it's back at 2000) in each direction overlap perfectly it will be the usual stripes effect.
Btw stripes effects can be somewhat nice but too messy for my taste. If you're wondering I'll post my huge (4096x4096 i think it was or maybe that's another attempt and it was 1024x1024) floor_a/_b concrete textures.
Hmm I just thought of a new thing one could try but... *Ack, enough for tonight*

*goes off to redo an old concrete slab texture in 20x2000*

Edit:
Ah forget it. Because of the compression/decompression (from 2000 to 20 back to 2000 you will lose any detail (shading etc.) that is smaller than 1/100th of the original uncompressed texture so it's not worth it (I realised like a minute into working on it)... and unless the decompressed result (when it's back at 2000) in each direction overlap perfectly it will be the usual stripes effect.
Btw stripes effects can be somewhat nice but too messy for my taste. If you're wondering I'll post my huge (4096x4096 i think it was or maybe that's another attempt and it was 1024x1024) floor_a/_b concrete textures.
Hmm I just thought of a new thing one could try but... *Ack, enough for tonight*
Last edited by n54 on Thu Mar 17, 2005 1:23 am, edited 1 time in total.
Ah nice to hear, I'm way too tired to be thinking of this stuff right now I think... and still it's only 01:09 hours 
Edit:
We're getting advanced here but it might be possible to increase detail by splitting an original into two parts containg half of the detail if you understand what I'm thinking of. I.e. _a and _b are not rotated and compressed versions of each other but rather rotated and compressed versions of the result but only containing half the information each....
Edit2: syntax correction
Edit3: Thinking out loud.
If with gridsize 1 it is 0.01/1 and 1/1 and you have the texture format 100x1 you should get 1x1 as a result right? then rotate cw or ccw hmm...
but:
since the two textures are rotated and stretched in different directions the trick would be how to combine the different (relative) stretching of the two textures into the result you want... one direction each for the two textures will have a data/detail of 1/100th of the other hmmmm

Edit:
We're getting advanced here but it might be possible to increase detail by splitting an original into two parts containg half of the detail if you understand what I'm thinking of. I.e. _a and _b are not rotated and compressed versions of each other but rather rotated and compressed versions of the result but only containing half the information each....
Edit2: syntax correction
Edit3: Thinking out loud.
If with gridsize 1 it is 0.01/1 and 1/1 and you have the texture format 100x1 you should get 1x1 as a result right? then rotate cw or ccw hmm...
but:
since the two textures are rotated and stretched in different directions the trick would be how to combine the different (relative) stretching of the two textures into the result you want... one direction each for the two textures will have a data/detail of 1/100th of the other hmmmm
Last edited by n54 on Thu Mar 17, 2005 1:38 am, edited 1 time in total.
i don't think it's possible to do very high level detail stuff this way though. i think the gradients floor work because the gradients are smooth enough that you don't notice
there's also something wrong with what Jonathan said as with grid size 3 that would result in the stretch being (0.01/3=) 0.0033333333333333333333333333333333 i.e. a 100pixel wide texture would be stretched (or rather compressed) to 33.3... which is the opposite of what happens. perhaps it should be grid_size/0.01 instead of the other way around? (maybe it was just a typo)
actually these numbers look wrong no matter what:
with grid_size/0.01 it would make each pixel a 300pixel line with grid_size 3 (the "crossbars" in the gradient floors are 4 pixels wide which should make for 1200pixel lines (600 on each side of the crossing line from the other texture), the other side lenght is 256 and grid_size/1 makes 3 and 256 times 3 makes 768. so according to this the crossbars should almost reach the sides of the squares but when you see them without the blurring from mipmapping they're nowhere close to that size... (can be seen in screenshot posted in the gradient floor thread).
i think we're missing something like how the numbers Jonathan found are actually applied to the textures... where do they take their input from?
there's also something wrong with what Jonathan said as with grid size 3 that would result in the stretch being (0.01/3=) 0.0033333333333333333333333333333333 i.e. a 100pixel wide texture would be stretched (or rather compressed) to 33.3... which is the opposite of what happens. perhaps it should be grid_size/0.01 instead of the other way around? (maybe it was just a typo)
actually these numbers look wrong no matter what:
with grid_size/0.01 it would make each pixel a 300pixel line with grid_size 3 (the "crossbars" in the gradient floors are 4 pixels wide which should make for 1200pixel lines (600 on each side of the crossing line from the other texture), the other side lenght is 256 and grid_size/1 makes 3 and 256 times 3 makes 768. so according to this the crossbars should almost reach the sides of the squares but when you see them without the blurring from mipmapping they're nowhere close to that size... (can be seen in screenshot posted in the gradient floor thread).
i think we're missing something like how the numbers Jonathan found are actually applied to the textures... where do they take their input from?
- Jonathan
- A Brave Victim
- Posts: 3391
- Joined: Thu Feb 03, 2005 12:50 am
- Location: Not really lurking anymore
You just can't do this with the dual texture floor (which is meant for lines parallel to the stretched dimension, and only works for that). Stretching the texture is no option because it would eat VRAM and/or be resized because the hardware can't handle it and it would get blurry again; another rendering pass spent doing nothing useful.
ˌɑrməˈɡɛˌtrɑn
I'm sorry Jonathan but what you're saying just doesn't make any sense to me on it's own, could you please give us a bit more info? Like when you say scaled I automatically interpret that as multiplying the texture with the result, in my previous post I both multiplied the textures by the result of your code as well as with your code changed and compared both with the effects seen and neither added up so there's obviously something I'm misunderstanding or missing 
Btw have you looked at my Gradient Floor which is using dual textures? The gradient can be thought of as a series of slightly differently colored lines perpendicular to the stretched dimension. As for blurring you see that with the incomplete lines going parallel to the stretched direction

Btw have you looked at my Gradient Floor which is using dual textures? The gradient can be thought of as a series of slightly differently colored lines perpendicular to the stretched dimension. As for blurring you see that with the incomplete lines going parallel to the stretched direction
