Big texture into small texture


Ummmmmmmm two things. First, this is maybe tech discussion? Itchio lists those as "decision and techniques reagrding the tools used to build the project" but I don't know if this technically means like ways to set switches on your game engine to hope that it "hopefully sometimes like 92% but maybe 56% of the time" works 100% of the time or if it means anything techy like in my case where i'm just trying to get this loop to sample from a large texture into a tiny one. So I guess ban me if i'm not allowed to do this or just tell me what type of discussion or what not to categorize this under so I can do that.
Secondly, I was going to just upload a video directly to this site but I guess they don't allow that sooooooo I would reccomend that you check this Twitter post https://twitter.com/AndrewNReinke/status/1437791610805305353 of mine to understand what i'm talking about.

Basically, you're sampling into your smaller texture (backbuffer) some amount from a larger texture. The question of where you're sampling out of the bigger texture has already been answered but this for loop wants to be as fast as possible so you don't really want to do something like.
for(ys < tinytexture y && yl < large texture y)
{
xl = xlbound to tiny texture start so an offset into the large texture by some amount;
for(xs < tinytexture x && xl < large texture x)
{
d = xs + ys * tiny texture width;
s = xl + yl * large texture width;
TinyTexture[d] = LargeTexture[s];
}
}
As this is going to get slow (especially since you have to do something to ensure that xl and yl don't go out of bounds of the large texture (so like using if statements, one in y's stack frame, and one in x's stack frame (if C language))).
So i'm trying to figure out a way to just do a dumb copy in one loop or just have two passes where you do half and half of the dest (tiny) buffer.
Can't wait to get time to solve this again! Life gets hectic but I will have time soon to work harder on this game very soon :)

Get Funmi

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.