[Bf-committers] Material/TexFace cleanup round 2 for texture painting

Brecht Van Lommel brechtvanlommel at pandora.be
Wed Jun 19 15:07:06 CEST 2013


Hi Antony,

On Wed, Jun 19, 2013 at 11:11 AM, Antony Riakiotakis <kalast at gmail.com> wrote:
> * Default texture type in blender internal is image, default mapping is UV,
> if a uv layer exists. (Not sure if this is easy to ascertain in the code
> though). I know that people are against changing the defaults , however,
> given that cycles is already using the same system and that most use cases
> are images/uvs I think this change makes sense.

Some way to automatically use UV mapping for image textures sounds good to me.

> * Change the way texture painting image access is done. Two proposals here:
> 1) Use two fields: One for UV layer, one for image. User specifies both
> before painting.
>
> + allows to paint on any image, using any uv layer
> - will forgo the ability to paint on multiple images simultaneously as is
> currently possible
>
> 2) Enumerate materials, and for each material, enumerate the image-using
> texture slots. User selects the texture slot he wants to paint on and the
> image and uv layer of the slot are used (or the active UV layer if there's
> no UV layer selected in the mtex field).
>
> + User gets result he expects and sees it immediately on rendering
> + May be possible to use something other than uv coordinates in the future
> + Allows painting on multiple images per material
>
> - how to properly draw in viewport may be an issue. (I could use a few
> pointers here actually)

I suggest to make this work somewhat similar to Cycles, thought the
Blender Internal situation is more complex.

The way it works in Cycle is that you have one draw mode to show
single textures, and one draw mode to show all of them as part of a
GLSL material. The texture used for painting should match what is
drawn in the draw mode that shows a single texture, and choosing a
texture to draw should be the same as choosing a texture to paint. If
they don't match things will get confusing.

So I think it seems that draw mode changes are needed to make this
system clear. Texture painting specifically could show extra info to
indicate which texture is being painted on, or offer a dropdown menu
to select a texture to paint/draw.

Given the Blender Internal material system, you can have 3 possible
texture sources to paint on:
a) active UV map texture (material texface)
b) active material texture slot
c) active material texture node

For Blender Internal it always draws a) now. The user would not need
to explicitly choose between b) and c) I think, if a material is a
node material it has no texture slots. If you take into account the
active texture slot and active node you can find one texture to use
for a material. That requires a good UI to show what is active.

A question is then how does the user choose between a) and b) c)? Is
this a per object/mesh option? Is it a different draw mode? Or do you
support only one of those two? I'm not sure, but it makes sense to
somehow still support both.


The other problem is how this works in the game engine. Right now
"textured" draw mode is a preview of what is drawn in the game engine.
That's obviously a very useful draw mode to have for the game engine
but it's also confusing. Personally I think it makes sense for Blender
Internal to work similar to Cycles and split Textured draw mode into
two:

* Texture: show a single texture (with solid or scene lighting)
* Material: show GLSL material (which is an approximation of what it
would render)

For the game engine:

* Texture: show a single texture (with solid or scene lighting)
* Game: show as it would render in the game engine, using the
Singletexture/Multitexture/GLSL option (maybe needs a better name)


Brecht.


More information about the Bf-committers mailing list