View Full Version : Using a Texutre Atlas (Sampling Specific Texture Coordinates)
09-23-2010, 06:27 PM
I have an alpha sheet that has several decal textures in it. Rather than making an entirely new texture I was wondering if there was some way of sampling a sub section of it and then using that as a material for a particle.
It seams like there should be some way to do this but I can't figure anything out. If anyone has any suggestions I would greatly appreciate it.
09-23-2010, 07:36 PM
Would this do what you want?
09-23-2010, 10:46 PM
Thanks for the reply :)
I don't think so because it looks like that system requires you to have an evenly divided texture. The texture i'm using is just a sheet of random images from all over the level. I wanted to pack a few particles in there to fill space since I already had an alpha chan.
Dividing up the texture evenly like that isn't an option, I was looking for some general way in the material editor to sample an arbitrary sub section of a texture.
that should do
09-24-2010, 02:49 PM
I got it working here is the result:
Now i'm left wondering how good of an idea this is in the first place.
Pros: Less textures need to be loaded into memory
More complex shader is needed to sample a sub section of a larger texture.
This texture can't be re-used for other parts of the mission without loading the ENTIRE 512x512 sheet.
Can someone offer an opinion as to whether its better to go with a separate texture, or to sample a sub-section like this. Is this really unoptimized or a valid approach given that I could just make this its own, much smaller, 32x32 texture.
maybe use the whole decal sheet on one material without extracting a part of it and just offset and scale it via the placement widgets to get just the part of the sheet to show up that you want at that position.
09-24-2010, 08:13 PM
I don't think that is really a viable solution since this is going to be used as particle not a decal :(
vBulletin® v3.8.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.