octa... hecta... tile problems
This was actually a lot simpler than my brain could recognize
apologies to both of you 
Ok thank you for making it very very easy for me Jonathan (it seems I'm worse than I thought right now), I sincerely appreciate your patience because it enabled me to make a tiled dual texture grid that is correct. I've been talking about rotation before and that was totally misguided because no rotation should be done (bah I kinda should have realized when my Gradient floor worked but oh well...). I'm sorry for confusing you with that Your_Mom.
Quick and dirty:
- first I made the tile I wanted as a 20x20 texture
- floor_a.png is stretched in the horizontal direction (relative to just seeing the texture itself in your image program) and floor_b.png is stretched in the vertical direction.
- from the 20x20 texture I enlarged it to 2000 pixels in the vertical direction (yes vertical, not a mistake) and saved as floor_a.png
- from the 20x20 texture I enlarged it to 2000 pixels in the horizontal direction (once again on purpose) and saved as floor_b.png.
Why does it work:
- now what you see as a result actually sort of only contains the information one would have in a 20x20 pixel image (well and the info from however your image program scaled the textures before you saved them) and a sort of blending between the pixels by the program (afaik mipmap does this but only to a certain degree).
- by making the height of floor_a.png (2000) the same as the end result of the program scaling floor_a horizontaly (2000) you get a square result.
- since floor_b.png is not rotated and you make the same square shape by making its texture width the same as the end result of the vertical scaling you get another identical square.
- floor_a.png and floor_b.png will be different in that floor_a.png will have more color information along its vertical axis and floor_b.png along its horizontal axis. There might be blending issues that distort colors somewhat in comparison to the original image used as a base for making the floor textures.
The screenshot below is taken with grid_size 1 because the textures are actually kinda low on color information the large size nonetheless. The floor rgb is all 0.5.


Ok thank you for making it very very easy for me Jonathan (it seems I'm worse than I thought right now), I sincerely appreciate your patience because it enabled me to make a tiled dual texture grid that is correct. I've been talking about rotation before and that was totally misguided because no rotation should be done (bah I kinda should have realized when my Gradient floor worked but oh well...). I'm sorry for confusing you with that Your_Mom.
Quick and dirty:
- first I made the tile I wanted as a 20x20 texture
- floor_a.png is stretched in the horizontal direction (relative to just seeing the texture itself in your image program) and floor_b.png is stretched in the vertical direction.
- from the 20x20 texture I enlarged it to 2000 pixels in the vertical direction (yes vertical, not a mistake) and saved as floor_a.png
- from the 20x20 texture I enlarged it to 2000 pixels in the horizontal direction (once again on purpose) and saved as floor_b.png.
Why does it work:
- now what you see as a result actually sort of only contains the information one would have in a 20x20 pixel image (well and the info from however your image program scaled the textures before you saved them) and a sort of blending between the pixels by the program (afaik mipmap does this but only to a certain degree).
- by making the height of floor_a.png (2000) the same as the end result of the program scaling floor_a horizontaly (2000) you get a square result.
- since floor_b.png is not rotated and you make the same square shape by making its texture width the same as the end result of the vertical scaling you get another identical square.
- floor_a.png and floor_b.png will be different in that floor_a.png will have more color information along its vertical axis and floor_b.png along its horizontal axis. There might be blending issues that distort colors somewhat in comparison to the original image used as a base for making the floor textures.
The screenshot below is taken with grid_size 1 because the textures are actually kinda low on color information the large size nonetheless. The floor rgb is all 0.5.
so
floor =W x H
floor_a = W x (H x 100)
Floor_b = (W x 100) x H
one problem is ummm its not working....
floor =176 x 146
floor_a = 176 x 14600
Floor_b = 17600 x 146
problem is its not working.
floor =W x H
floor_a = W x (H x 100)
Floor_b = (W x 100) x H
one problem is ummm its not working....
floor =176 x 146
floor_a = 176 x 14600
Floor_b = 17600 x 146
problem is its not working.
Last edited by Your_mom on Thu Mar 17, 2005 6:20 am, edited 1 time in total.
Just posting this to show the next step you're/we're likely to have to figure out if hex gids are to work well in dual rendering: we need to get a feel of the blending etc. so we can change our colors wisely or perhaps use transparent areas in one of the pngs to enhance sharpness...
The screenshot below is of a 20x20 pixel red and white triangle pattern with the same settings as in the example above, now these are perfectly even alternating triangles in the original texture but as one can see the white color bleeds a lot into the red after dual rendering so be prepared to tweak your images a lot Your_Mom
The screenshot below is of a 20x20 pixel red and white triangle pattern with the same settings as in the example above, now these are perfectly even alternating triangles in the original texture but as one can see the white color bleeds a lot into the red after dual rendering so be prepared to tweak your images a lot Your_Mom

ummm i guess i'll post the floor texture and hope n54 can sort it out bucause its not working for me, its a couple pixils different then the one i was rescaling but its the same thing trust me
- Attachments
-
- feel free to play with this i like grid size 2 on single texture
- floor.png (1023 Bytes) Viewed 9310 times
Ok you've got to make a perfect square out of whatever you want (I know this is a complete drag in relation to hexagons, if you want to I'll share the calculations/sketch I've made so far for trying to figure it out). It's got to be square to be precise and easy to manipulate when making floor_a and floor_b.Your_mom wrote:problem is its not working.
Nevertheless you've got the rest right:
floor = w x h | 176 x 146 // ok by this I guess we mean the width and height of our original texture (I've kept your figures for examples even though they really need to be square), this will make:
floor_a = w x (h x 100) | 176 x 14600 // and:
floor_b = (w x 100) x h | 17600 x 146
just like you said

But since you didn't make the original image square it trows a spanner into the details somewhere (exactly why I'm not sure of)

Edit: Ok I'll give it a try but it's 06:25 here now so well umm don't expect it returned today lol

Edit: Quick update: that sure didn't work well for hexagons


Edit @ 0736 lol:
out of curiosity I made a perfect octogonal pattern (I've realized a perfect hexagonal pattern within a square is impossible, ah well, but it will be close) using the reversed colours you used, the original tile was 96x96. I did all as worked with the two first tiles I made but I got the same result as with the hexagonal tile. I tried switching _a and _b just to chech but it still didn't work (although the patterns can be kinda nice when I switched _a and _b) the textures still stretch in a different manner than the original dual texture tiles. I think we might be overstepping some kind of threshold which makes the code behave differently so next thing to try for me is to make a 50% smaller version of this last octagonal attempt. Maybe now, maybe after I wake up with qwerty on my forehead

just a bump since edits don't get flagged
Edit:
the octagonal gone wrong screenshot, at least it proves that nice diagonal lines are posssible (btw yes I have noticed there are a few more lines than intended in any case; it's an error in the original image tile I'll have to correct)
Edit:
the octagonal gone wrong screenshot, at least it proves that nice diagonal lines are posssible (btw yes I have noticed there are a few more lines than intended in any case; it's an error in the original image tile I'll have to correct)
Last edited by n54 on Thu Mar 17, 2005 8:16 am, edited 1 time in total.
Done down to 20x20 now and no success so my main suspect is now the color white 
Maybe those two tiles that worked were flukes or I've misunderstood what made them work, anyway it's soon 9 in the morning here and my peanut brain is out of oil so I'm logging out
(we're not giving up though but I really should be finishing some other stuff first lol)

Maybe those two tiles that worked were flukes or I've misunderstood what made them work, anyway it's soon 9 in the morning here and my peanut brain is out of oil so I'm logging out

(we're not giving up though but I really should be finishing some other stuff first lol)
- Jonathan
- A Brave Victim
- Posts: 3391
- Joined: Thu Feb 03, 2005 12:50 am
- Location: Not really lurking anymore
About the blending (I'm talking about what happens to each pixel):
- First floor_a is drawn using the known alpha blending. The texture color is multiplied by its alpha, the old framebuffer contents are multiplied by 1-texture alpha, and the results are added and stored in the framebuffer.
- Then floor_b is drawn using additive blending. The texture color is multiplied by its alpha, but the old framebuffer contents are left alone, and they are added and stored in the framebuffer.
- First floor_a is drawn using the known alpha blending. The texture color is multiplied by its alpha, the old framebuffer contents are multiplied by 1-texture alpha, and the results are added and stored in the framebuffer.
- Then floor_b is drawn using additive blending. The texture color is multiplied by its alpha, but the old framebuffer contents are left alone, and they are added and stored in the framebuffer.
ˌɑrməˈɡɛˌtrɑn
I've continued to experiment and the more I've done the more I'm convinced that we're lacking some part of understanding of how the stretch actually works, as an example I have the following screenshot, the original tile is a 100x100 square with a 1 pixel rim with color and a centered 4x4 square with color and the rest is 100% transparent, the floor_a and _b are multipllied by 100 in the direction that is not stretched.
Still it is obvious from the screenshot that the textures are still stretched which forms the middle weak stripes (same effect that you see in your last example) making more of a quilt pattern than anything else.
It might be that it's simply impossible to do anything about this.
Still it is obvious from the screenshot that the textures are still stretched which forms the middle weak stripes (same effect that you see in your last example) making more of a quilt pattern than anything else.
It might be that it's simply impossible to do anything about this.
Yeah that would be because of the same "stretching/blending within the stretch" afaik.
I guess the one way to work around this is to make patterns where the blending either improves the design or at least doesn't toally obliterate it, so it becomes hard (or impossible) to take a specific texture you want and then make a dual version of it...
Well there's one thing we haven't tried yet: splitting the design into different parts, I'm going to try that next.
I guess the one way to work around this is to make patterns where the blending either improves the design or at least doesn't toally obliterate it, so it becomes hard (or impossible) to take a specific texture you want and then make a dual version of it...
Well there's one thing we haven't tried yet: splitting the design into different parts, I'm going to try that next.