1

I have some model in Blender. I'd like to:

  1. Connect a few different textures into one and save it as bitmap
  2. Make UV mapping for these connected textures

I need to solve this problem for textured models in OpenGL. I have data structure which giving me possibility to bind one texture into one model, so I'd like to have one texture per one model. I'm aware of fact that I can use Texture GL_TEXTURE_xD_ARRAY, but I don't want to complicate my project. I know how to do simple UV mapping in Blender.

My questions:

  • Can I do 1. and 2. phases exclusively in Blender?
  • Is Blender Bake technique is what I'm searching for?
  • Is there some tutorials shows how to do it? (for this one specific problem)
  • Maybe somebody advise me another Blender technique (or OpenGL solution)
genpfault
  • 51,148
  • 11
  • 85
  • 139
CppMonster
  • 1,216
  • 4
  • 18
  • 35

2 Answers2

2
  1. Connect a few different textures into one and save it as bitmap
  2. Make UV mapping for these connected textures

You mean generating a texture atlas?

Can I do 1. and 2. phases exclusively in Blender?

No. But it would be surely a well received add-in.

Is Blender Bake technique is what I'm searching for?

No. Blender Bake generates texture contents using the rendering process. For example you might have a texture on a static object into which you bake global illumination; then, instead of recalculating GI for each and every frame in a flythrough, the texture is used as source for the illumination terms (it acts like a cache). Other applications is generating textures for the game engine, from Blender's procedural materials.

Maybe somebody advise me another Blender technique (or OpenGL solution)

I think a texture array would be really the best solution, as it also won't make problems for wrapped/repeated textures.

datenwolf
  • 159,371
  • 13
  • 185
  • 298
  • So, the best solution would be texture array and I had to prepare UV mapping for every texture of model in Blender and load all textures into OpenGL App with GL_TEXTURE_3D_ARRAY method? Do I have to use glActiveTexture() per one texture and shader code would be more complex (many texture samplers)? – CppMonster Jul 18 '13 at 10:21
  • 1
    @CppMonster: glActiveTexture does something entirely different: It allows you to load several textures in several texture targets. This is not the same as a texture array, where you have several 2D images available within one single texture (target). The shader code is actually much much simpler than if multiple textures were used. You see, you simply choose which of the array slices/layers you want to use by the third texture coordinate component. So you have ST (==UV from Blender) for the location within the array, and the 3rd component R designates the layer index. – datenwolf Jul 18 '13 at 11:14
  • Your answer is full. I know all I need to prepare OpenGL code and my textures (with this post and SuperBible 5th book), it seems that my code isn't demand so many changes I thought. Thanks. – CppMonster Jul 18 '13 at 11:32
1

Another possibility is to use projection painting. An object in blender can have multiple uvmaps, if importing it doesn't create each uvmap then you may need to align each one by hand. Then you create a new uvmap that lays the entire model onto one image.

In Texture painting mode you can use projection painting to use the material from one uvmap as the paint brush for painting onto the new image.

enter image description here

sambler
  • 6,917
  • 1
  • 16
  • 23