Skip to main content
GameDev.net gamedev.net
🔒 Locked

Bindless Textures

Started by Scienthsine Jan 30, 2010 at 6:34 PM 1 replies 3.6k views
Original Post
Scienthsine
Scienthsine
I'm playing around with OpenGL 3.2, and it seems to me that binding textures really fragments what could otherwise be a pretty strait-forward batch drawing of primitives. IE: When drawing a bunch of 2d sprites, a vbo containing all of the data needed to draw them is trivial; however binding textures fragments the drawing calls. The best I can think of is to sort by image and draw each range from the vbo, but if drawing order is important, and not related to texture... this may not help much at all. It just seems to me that I should be able to pass an attribute to specify which texture to use... the texture is already in the gpu... so what's the problem? I could use texture arrays and all of my texture slots for a somewhat usable hack to get what I want, but it has it's limits. It seems nvidia's bindless extension is meant for buffers only, not textures... unless I'm missing something. Now... there are texture buffers, which may? be able to be bindless. They come out as a 1d texel array with no filtering or anything, so not ideal either. Does anyone know of something that would allow me to do this? Is there something I'm missing, or do I gotta just live with it?
KulSeran
KulSeran
Quote:

When drawing a bunch of 2d sprites

Have you tried making texture atlases? batch together all your sprites of one kind (terrain, people, trees/shrubs/buildings, items) all onto one big texture. Use UV coordinates to select the relevant parts of the sprite sheet. Then, hopefully you can reduce the number of times you'd need to switch textures.
bubu LV
bubu LV
Quote:
The best I can think of is to sort by image and draw each range from the vbo, but if drawing order is important, and not related to texture... this may not help much at all.

You can enable depth buffer, and z coordinate for your sprites to get correct order of sprites.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.