Jump to content

Opacity Problems In A Volumetric Shader


Recommended Posts

Hi coders!

I am developing a volumetric shader and I have some opacity problems.

The shader is intended to be applied to a particle system that have spheres copied to the particles.

The shader applies a 3Dtexture per sphere, so apply the same small 3dtexture to every sphere.

My problem comes in the parts where the sphere have no density (using integrate3d to test the interesting areas), in these parts the shader assign s black color and a 0 opacity.

This work quite well when you have only one sphere, or you are aplying the 3d texture to the whole geometry, but when you have several spheres then the black areas, supposed to be transparent, overlaps to areas behing them, causing erroneous results.

I show these tests, here I have assign a red color to the areas with no density, and an opacity of 0, to see the effect clearer:

Spheres no overlapped:

spheresNoOverlaped.jpg

Spheres overlaped:

spheresOverlaped.jpg

Spheres more overlaped:

spheresMoreOverlaped.jpg

Spheres overlaped with a background object(now the color for the no density areas is black):

spheresOverlapedBack.jpg

And again the strange artifact, using for the no density areas red:

spheresOverlapedRedBack.jpg

In spite of setting the opacity (Of) to 0 it seems that the surface is still opaque, or semi transparent.

With black color and a different background object the shader works.

But why it doesn't work when I set red, and mantein 0 opacity?

And even worse, the spheres bounduaries problem between them.

I don't know if it is related to the fact that the spheres are contained in the same geometry operator, but the parts of the spheres that overlap other spheres and are transparent (Of set to 0) occludes spheres that are behind them, creating this black or red zones where is supposed that the sphere behing it should be rendered.

I suppose that is a problem due to being in the same geometry object because the transparency works with other background objects that are in different geometry operators.

The final alpha is correct except that in the render process is not correctly treated it and it occludes some sphere behind it.

See this image, comapre color and alpha to see the effect:

http://personales.ya.com/lisux/spheresOpacTest.tiff

Sorry for the large message but I try to explain as best as posibble this strange problems.

Can anybody give me some advice about why it is produced, or how to solve this?

Thanks

PD: I have tested with both sphere primitives and poly spheres and the result is the same

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...