View topic - Transparency not working correctly

Transparency not working correctly

Post here questions about using YafaRay materials, texturing and procedural models.

Transparency not working correctly

Post Fri Mar 11, 2016 2:08 pm

Hi all,

I'm having troubles with transparency when set from an image; I get this result:

transparency.png


The white area is not trully transparent because it gets the diffuse component into account.
So if the diffuse is black, I get no transparency.

I upload the blend file also.

Thanks.
Attachments
transparency.7z
(68 KiB) Downloaded 209 times
surena
 
Posts: 109
Joined: Sat Apr 26, 2014 6:37 am
Location: Spain

Re: Transparency not working correctly

Post Fri Mar 11, 2016 4:49 pm

Hello,

Thank you for your report and test scene. I'm looking at materials at this time so I will look at this asap.

Thanks!
User avatar
David Bluecame
 
Posts: 460
Joined: Mon Jan 21, 2013 12:42 pm
Location: Spain

Re: Transparency not working correctly

Post Sat Mar 12, 2016 5:29 pm

hi all,

From documentation:

Mapping color filtering
Color filtering is tinting of light that goes through a coloured transparent surface. In YafaRay this is done by multiplying transparency for the value component of the HSV coordinates of a color. It means that a white color on the texture can be made fully transparent if Transparency=1 while a black color on the texture can't be made any transparent even if Transparency=1.


This does not have sense. How is supposed to make a black texture or diffuse material be transparent?

I have tried also to make a blend material made of black and diffuse transparent ones, but I obtain a not fully transparent object when viewed behind a glass one with photon mapping. This is really strange. (but this have to be tested so ignore it).

I think texture transparency should be achieved with the transparency map, not only blending materials. So it should be disconnected from diffuse channel. Is it any reason for it? Could be something related to energy conserving?

If this is correct. Is the only way to blend materials?

edit: I've seen some posts about it and you need to apply some white map to transparent areas. Seems a redundant and not efficient solution to me.
surena
 
Posts: 109
Joined: Sat Apr 26, 2014 6:37 am
Location: Spain

Re: Transparency not working correctly

Post Sat Mar 12, 2016 6:32 pm

This is the same scene with the forum procedure, it produces a white rim.

as_tuts.png
surena
 
Posts: 109
Joined: Sat Apr 26, 2014 6:37 am
Location: Spain

Re: Transparency not working correctly

Post Sun Mar 13, 2016 8:45 am

Hello,

Thank you for your comments. I'm currently reviewing the material system. I agree there are things like this that do not make much sense.

However, I will also compare how other render engines do this (Blender Internal, Blender Cycles and LuxRender for example) and I will try to implement a better and more "standard" material texture mapping, etc.

But this will take some time as you can imagine...
User avatar
David Bluecame
 
Posts: 460
Joined: Mon Jan 21, 2013 12:42 pm
Location: Spain

Re: Transparency not working correctly

Post Sun Mar 13, 2016 9:12 am

Thanks!

If I can help you just tell me.
surena
 
Posts: 109
Joined: Sat Apr 26, 2014 6:37 am
Location: Spain

Re: Transparency not working correctly

Post Sun Mar 13, 2016 12:27 pm

Hello,

Thanks for offering! Something that would be useful is to give me some information about how YafaRay compares with other software (Blender, LuxRender, VRay, etc).

For example, in YafaRay the mapping depends on the actual value of the property. As you have mentioned, the color influences transparency, and sometimes mapping also depends on the base value (final value = base value * mapping from texture).

I would like to know if those are "industry standards" or if, for some strange reason, YafaRay is doing things in a different way respect to the major renderers are doing.

My objective is to bring YafaRay to a more standard, intuitive and interoperable level. So, any real data and comparison would be very helpful.
User avatar
David Bluecame
 
Posts: 460
Joined: Mon Jan 21, 2013 12:42 pm
Location: Spain

Re: Transparency not working correctly

Post Sun Mar 13, 2016 12:41 pm

Hi all,

Did some research and:
To obtain a stencil the workflow is:

Prepare a png with alpha channel.
Set it as diffuse and check Use Alpha

Screenshot - 13_03_2016 , 13_28_37.png


This is the correct render:

correct.png


transparency_alpha_png.7z
(68.52 KiB) Downloaded 191 times


But there is still the transparency map issue, if we want to control the shader transparency with the transparent channel texture the shader code has to change (imho).

Another solution is to make another transparency channel (real) and rename this as Transparency Color Filtering or something.

Thanks
surena
 
Posts: 109
Joined: Sat Apr 26, 2014 6:37 am
Location: Spain


Return to Materials and Texturing



Who is online

Users browsing this forum: No registered users and 0 guests