Texture transparency

(terrachild) #1

I posted a question about this once, but no one had an answer.

Look at the picture below.
The left image of the girl was created by using the Addon, “Import images as plane.”
It correctly shows the image with transparency, even though it appears that nothing is set to display transparency on the texture tab.

The right image of the girl was created by me. I added a plane loaded the same image, set everything for transparency, as you can see in the texture panel. UV unwrapped it, and as you can see there is no transparency showing in the viewport.

Why?
How is “Import images as plane” magically displaying transparency, and why can’t I achieve the same thing by creating the plane myself?

Thanks

(MatanteDodo) #2

I did something of the sort once (created hair from transparent conical objects with the hair image on them), here’s how it worked:
Set alpha to 0, then have the image affect both colour and alpha. It may work better if you use that image as colour value only and make a second version with a white background and all the non-transparent parts black, but when I did it it wasn’t necessary to go through that extra work.

(ridix) #3

I messed around with Alpha image map setting for 2.57. And, found it as difficult as 2.49! Man, just as many buttons need to be pushed!! It’s just all at different places!!!

http://i1135.photobucket.com/albums/m626/cabby24/Blender%20Pics%202011/Alpha2.png

Scene Buttons:
Under Shading, have Textures, Ray Tracing, Shadows, and Color Management checked.

Material Buttons:
Under Shading, Shadeless needs to be checked. Translucent set to zero.
Check Transparency, pick Z transparency and set Alpha to zero
Under Shadow, uncheck every box.

Texture Buttons:
Under Preview, check Show Alpha.
Under Image, Load image there, and check Premultiply.
Under Image Mapping, Extension set to Clip. This way image will not tile.
Under Mapping, Coordinates set to Generated. Projection to Flat.
Under Influence, Check Color, and Alpha box. Blend set to “Mix.”

Also if you want to cast shadow of Alpha image, that object material needs to have “Receive Transparent” checked under Shadow.

(terrachild) #4

I can punch in the settings and achieve that result in a render, but in the viewport, there is something mysterious going on.

Examples 1:


There are two images of the girl again, the one on the left was created by using the Addon “Import images as plane;” the girl on the right was created by me by adding a plane, UV unwrapping it, and adding the same material as the other girl.

So, let me say that again, they are both using the same material.
Thus, they are both using the same texture and all of the same settings!
There shouldn’t be any difference between them.

But as you can see, the one on the left displays with an alpha channel, and the one on the right has black where it should be transparent. Why?

Note the “Shading” is set to “Multitexture.”

Example 2:

Here is the same scene with only one difference.
Note the “Shading” is set to “GLSL.”
Now both images display the alpha transparency correctly in the viewport.
What is different between these two planes?
Why don’t they both display transparency with the shading set to “Multitexture” ?

Here is the file: transparency

Thanks

(test-dr) #5

this is simple!

You are mixing the views, mixing your expectations and
wonder why you get different results.

  1. the blender 3D-View is only a kind of preview!
    Imagine you can use different types of render-engines to get special light-calculations.
    (those engines range from old povray to new ones … octane …etc.)
  2. transparency for a material is not the same like for an texture!
  3. the addon import-images-as-planes is so kind and nice and configures some
    of the settings at once for the material and the loaded texture.

you should use it as the first step if you get totally confused by this all.

again: material transparency is not the same like texture(image) transparency.
and last there are 2 big differences about transparency,
raytraced or not.
Both have different usages - and settings!
If you are confused, first try to understand the settings for a material without any textures.

(terrachild) #6

If it is so simple, why didn’t you answer the question?

There are two planes, and both are using the same material. Bother render fine with transparency, but in the viewport, they don’t display the same when “Multitexture” is chosen under “Shading.”

Why not?
Again, what is different about the two planes?
Can you make them both display with transparency with “Multitexture” set?

I provided the file, give it a try.

Thanks

(Richard Marklew) #7

I don’t have access to blender at the moment so cannot test this myself.
For the image added with the addon, if I recall it also has the texture mapped to it in the uv image editor as well as the texture applied to the material. Check with your manually added plane if you have also done this. If one does and one doesn’t even though they have the same material, in Multitexture view they could look different. With GLSL view you are looking at the material so in that case they would look the same.

(test-dr) #8

like Richard said,
it is not the same material-to-mesh combination.
There is a difference in the display-modes: multitexture, glsl
both have still some flaws compared to the render-output.
If you ever get the point to do some on-screen-texture-painting
you will soon notice the difference. This would never work with
project-painting if the 3D-VIEW would not do a restricted render
(compared to a full render like the final image-generation).

For example: you can setup an uv-unwrap and a loaded image
in the uv-editor and it will be displayed in the 3D-View but will
never be rendered (this was already possible in Blender-2.49).

The point is, you can even have meshes (3d-objects) without
a material, but with a mapped image.

And this will make it very complicated to understand, if mixed
all together without difference.

The addon “load-images-as-planes” uses the way to create a flat
surface with a material AND a texture with an uv-mapping.
If you use an image with alpha transparency (like a png-image can have)
you need to enable
in the texture-settings for the image:
X alpha-using
X pre-multiply (to avoid the bright borders)
X use alpha (thats below the use-color setting)
and in the material eable
X Transparency AND
pull down the transparency slider how transparent it should be.

then the difference between preview Multitexture and GLSL
in the 3D-View should only be the “brightness, shading” and
differences in the textured-display
for the uv-mapping of not-flat-objects and/or objects with
multiple uv-maps.

For example a generated cube-mapping to a simple cube
of an image only appears in my 3D-VIEW on one face
and not on all faces - but when rendered it will be on all faces.
Thats for the GLSL-display-mode, … in Multitexture-Mode there
is no texture visible in the 3D-VIEW.

Similiar restrictions are for generated textures and using “smoke” etc.
to a flat surface

edit: by the way, i answered your question: its the difference usage of display-mode, which uses other configurations than only the material-settings(like for render-output).
edit2: the above is not correct at all, its only true for objects with material (what about nodes-material? … No, this not… and so on up to the point, where a mesh has no material and ?vertex-painting… etc.)

(terrachild) #9

I did UV unwrap my plane with the same image in the image editor, but as you can see, the transparency in “Multitexture” isn’t showing up.

test-dr, could you download the file I provided and see if you can make the two planes look the same with “Multitexture” ?

(test-dr) #10

i downloaded it, and it was simple -
you have (ok … i know, all people swear they never did it)
enable “OPAQUE” instead of the normal “Transparency”!

And where is this?
It is in the vertice-settings (those 3-triangle-vertice-icon)
for the texture-face (thats normaly below the list of the uv-mappings of
the object and the list of the vertices-groups…)
and
there is another difference, but this will only be visible later?
The “OPAQUE” surface is not set to “Two Sided” … like you want?

btw. like i said, it is not easy, except someone is a genie, and i am not one too.
Thats why i can only suggest to start with simple settings …

edit: those options are part for the “game engine”, i think the “old” engine
did use multitexture and the newer one can make use of glsl … but this are
changes …
and it is right, a new created plane and uv-unwrapped has those game-options
without “Alpha” activated for Transparency (the addon … set these too … and it is not part “of a material setting” … only in the sense of the game-engine…)

(terrachild) #11

Thank you.

This problem has remained unsolved by many people for a long time.

However, when I selected the plane and opened the tab with the triangles, “Object Data,” there was no panel to make those changes. After awhile, I tried tabbing into “Edit” mode and the panel magically appeared. The panel is called “Texture Face.” This is probably why no one has solved this. It is not a material setting, or a texture setting, or a display setting, and you can’t even find the panel unless you are in “Edit” mode!

Thanks again.