I have a texture which is a grid of smaller textures and which I am not able in this application to split into individual files. I need to tile these subtextures over a model.

Splitting the geometry could work, but would increase scene complexity and potentially introduce visual artifacts if thin triangles are generated.

Allocating new textures copied from the original at runtime could work, but would increase texture-memory usage and would involve stale data if the primary texture changes (which I cannot detect in this application).

If there really is no way to directly bind a subtexture to allow OpenGL tiling to work, what would be the next best way to do it?

有帮助吗?

解决方案

If you need to do this, the correct way is to use a fragment shader to tile your texture coordinates directly.

That seems like massive overkill and might interfere with the application's existing rendering pipeline

The only way it would interfere is if you're not using fragment shaders. And if you're not... you should be.

Modern hardware design doesn't generally add fixed functionality anymore; it's all about giving shaders more power and options. If you need a feature, "code it in a shader" is generally the correct solution.

But if you're not allowed to use shaders, the only alternative is to modify your geometry, as you suggested.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top